Optionally show all stig test passes

This commit is contained in:
Bob Mottram 2016-12-01 10:38:23 +00:00
parent 8e6edc7780
commit 3ae78c3765
2 changed files with 11 additions and 0 deletions

View File

@ -33,8 +33,12 @@ PROJECT_NAME='freedombone'
export TEXTDOMAIN=${PROJECT_NAME}-tests export TEXTDOMAIN=${PROJECT_NAME}-tests
export TEXTDOMAINDIR="/usr/share/locale" export TEXTDOMAINDIR="/usr/share/locale"
# Whether to run STIG tests
RUN_STIG= RUN_STIG=
# Whether to show both passes and fails of STIG tests
SHOW_ALL_TESTS=
function show_help { function show_help {
echo '' echo ''
echo $"${PROJECT_NAME}-tests" echo $"${PROJECT_NAME}-tests"
@ -1108,6 +1112,10 @@ do
show_help show_help
;; ;;
-s|--stig) -s|--stig)
shift
if [[ "$1" == 'showall' ]]; then
SHOW_ALL_TESTS=1
fi
RUN_STIG=1 RUN_STIG=1
;; ;;
*) *)

View File

@ -5,6 +5,9 @@ LOG=/dev/null
log_msg() { log_msg() {
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
PASSES=$((PASSES+1)) PASSES=$((PASSES+1))
if [ $SHOW_ALL_TESTS ]; then
echo "[PASS] $2"
fi
else else
FAILS=$((FAILS+1)) FAILS=$((FAILS+1))
echo "[FAIL] $2" echo "[FAIL] $2"