From b8bd75d2adf29185072122bb5c489d42e2fea77a Mon Sep 17 00:00:00 2001 From: Charles Herlin Date: Thu, 14 Feb 2019 17:52:45 +0100 Subject: [PATCH] Rename dismiss_test to skip_tests since test won't even run in this case --- tests/hardening/99.5.4_ssh_keys_from.sh | 2 +- tests/launch_tests.sh | 7 ++++--- tests/lib.sh | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/hardening/99.5.4_ssh_keys_from.sh b/tests/hardening/99.5.4_ssh_keys_from.sh index b694527..f830b5b 100644 --- a/tests/hardening/99.5.4_ssh_keys_from.sh +++ b/tests/hardening/99.5.4_ssh_keys_from.sh @@ -1,6 +1,6 @@ # run-shellcheck test_audit() { - dismiss_test + skip_tests # shellcheck disable=2154 run genconf /opt/debian-cis/bin/hardening/"${script}".sh --audit-all diff --git a/tests/launch_tests.sh b/tests/launch_tests.sh index 71704fb..6871ebf 100755 --- a/tests/launch_tests.sh +++ b/tests/launch_tests.sh @@ -24,7 +24,7 @@ tests_list="" testno=0 testcount=0 -dismiss_test=0 +skip_tests=0 dismiss_count=0 nbfailedret=0 nbfailedgrep=0 @@ -69,8 +69,9 @@ get_stdout() clear_registered_tests() { unset REGISTERED_TESTS declare -a REGISTERED_TESTS + # shellcheck disable=2034 dismiss_count=0 - dismiss_test=0 + skip_tests=0 } # Generates a formated test name @@ -84,7 +85,7 @@ make_usecase_name() { # Plays the registered test suite play_registered_tests() { - if [ "$dismiss_test" -eq 1 ]; then + if [ "$skip_tests" -eq 1 ]; then return fi usecase_name=$1 diff --git a/tests/lib.sh b/tests/lib.sh index 179c54a..37d38a6 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -67,9 +67,9 @@ contain() } # Do not run tests at all for the next `run` -dismiss_test() { +skip_tests() { # shellcheck disable=2034 - dismiss_test=1 + skip_tests=1 } # test is expected to fail (for instance on blank system)