mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-24 03:24:34 +02:00
IMP(6.2.18,6.2.19,6.2.20): add purposely failing tests
This commit is contained in:
@ -6,5 +6,18 @@ test_audit() {
|
||||
# shellcheck disable=2154
|
||||
run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
||||
|
||||
# TODO fill comprehensive tests
|
||||
local test_user="testduplicateuser"
|
||||
local dir="/etc/passwd"
|
||||
|
||||
describe Tests purposely failing
|
||||
useradd $test_user
|
||||
temp=$(tail -1 $dir)
|
||||
echo $temp >> $dir
|
||||
register_test retvalshouldbe 1
|
||||
register_test contain "Duplicate username"
|
||||
run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
||||
|
||||
# cleanup
|
||||
sed -i '$ d' $dir
|
||||
userdel $test_user
|
||||
}
|
||||
|
Reference in New Issue
Block a user