FIX(test/10.2): backup and restore /etc/passwd after test

This commit is contained in:
Charles Herlin 2019-08-28 12:30:13 +02:00
parent a4969e6ba6
commit 5a1a70bbd3

View File

@ -1,5 +1,7 @@
# run-shellcheck # run-shellcheck
test_audit() { test_audit() {
cp -a /etc/passwd /tmp/passwd.bak
describe Running on blank host describe Running on blank host
register_test retvalshouldbe 1 register_test retvalshouldbe 1
# shellcheck disable=2154 # shellcheck disable=2154
@ -12,4 +14,6 @@ test_audit() {
describe Checking resolved state describe Checking resolved state
register_test retvalshouldbe 0 register_test retvalshouldbe 0
run resolved /opt/debian-cis/bin/hardening/"${script}".sh --audit-all run resolved /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
mv /tmp/passwd.bak /etc/passwd
} }