2020-11-27 09:22:47 +01:00
|
|
|
# shellcheck shell=bash
|
2020-10-30 16:01:18 +01:00
|
|
|
# run-shellcheck
|
|
|
|
test_audit() {
|
|
|
|
describe Running on blank host
|
|
|
|
register_test retvalshouldbe 0
|
|
|
|
# shellcheck disable=2154
|
|
|
|
run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
|
|
|
|
local test_user="userwithouthome"
|
2020-11-30 13:05:41 +01:00
|
|
|
useradd "$test_user"
|
2020-10-30 16:01:18 +01:00
|
|
|
describe Tests purposely failing
|
|
|
|
register_test retvalshouldbe 1
|
|
|
|
register_test contain "does not exist."
|
|
|
|
run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
|
|
|
|
# cleanup
|
2020-11-30 13:05:41 +01:00
|
|
|
userdel "$test_user"
|
2020-12-04 14:08:01 +01:00
|
|
|
}
|