From fe568561bfb272897965dad44af7cd60c22e25b5 Mon Sep 17 00:00:00 2001 From: Thibault Ayanides Date: Thu, 5 Nov 2020 10:13:14 +0100 Subject: [PATCH] IMP: Better cleanup after tests --- tests/hardening/6.2.8_check_user_dir_perm.sh | 2 +- tests/hardening/6.2.9_users_valid_homedir.sh | 3 ++- tests/hardening/99.5.4_ssh_keys_from.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/hardening/6.2.8_check_user_dir_perm.sh b/tests/hardening/6.2.8_check_user_dir_perm.sh index 2d031bd..5e22d1d 100644 --- a/tests/hardening/6.2.8_check_user_dir_perm.sh +++ b/tests/hardening/6.2.8_check_user_dir_perm.sh @@ -6,7 +6,7 @@ test_audit() { # shellcheck disable=2154 run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all - local test_user="testhomeuser" + local test_user="testhomepermuser" describe Tests purposely failing useradd --create-home $test_user diff --git a/tests/hardening/6.2.9_users_valid_homedir.sh b/tests/hardening/6.2.9_users_valid_homedir.sh index 4ff8de4..aa9cc9f 100644 --- a/tests/hardening/6.2.9_users_valid_homedir.sh +++ b/tests/hardening/6.2.9_users_valid_homedir.sh @@ -20,5 +20,6 @@ test_audit() { run exceptions /opt/debian-cis/bin/hardening/"${script}".sh --audit-all # Cleanup - userdel testhomeuser + rm -rf /home/testhomeuser + userdel -r testhomeuser } diff --git a/tests/hardening/99.5.4_ssh_keys_from.sh b/tests/hardening/99.5.4_ssh_keys_from.sh index ac57440..8bdbd8a 100644 --- a/tests/hardening/99.5.4_ssh_keys_from.sh +++ b/tests/hardening/99.5.4_ssh_keys_from.sh @@ -71,7 +71,7 @@ test_audit() { # Cleanup userdel jeantestuser - userdel jeantest2 + userdel -r jeantest2 rm -f /tmp/key1 /tmp/key1.pub }