mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-24 11:34:35 +02:00
Replace CIS_ROOT_DIR by a more flexible system (#204)
* Replace CIS_ROOT_DIR by a more flexible system * Try to adapt the logic change to the functional tests
This commit is contained in:
@ -5,7 +5,7 @@ test_audit() {
|
||||
describe Running on blank host
|
||||
register_test retvalshouldbe 1
|
||||
# shellcheck disable=2154
|
||||
run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
||||
run blank "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
||||
|
||||
cp -a /etc/syslog-ng/syslog-ng.conf /tmp/syslog-ng.conf.bak
|
||||
|
||||
@ -14,7 +14,7 @@ test_audit() {
|
||||
|
||||
describe Checking one line conf
|
||||
register_test retvalshouldbe 0
|
||||
run oneline /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
||||
run oneline "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
||||
|
||||
cp -a /tmp/syslog-ng.conf.bak /etc/syslog-ng/syslog-ng.conf
|
||||
cat >>/etc/syslog-ng/syslog-ng.conf <<EOF
|
||||
@ -25,7 +25,7 @@ EOF
|
||||
|
||||
describe Checking mutliline conf
|
||||
register_test retvalshouldbe 0
|
||||
run multiline /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
||||
run multiline "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
||||
|
||||
mv /tmp/syslog-ng.conf.bak /etc/syslog-ng/syslog-ng.conf
|
||||
|
||||
@ -35,7 +35,7 @@ EOF
|
||||
|
||||
describe Checking file in subdirectory
|
||||
register_test retvalshouldbe 0
|
||||
run subfile /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
||||
run subfile "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
||||
|
||||
# Cleanup
|
||||
rm /etc/syslog-ng/conf.d/1_tcp_destination
|
||||
|
Reference in New Issue
Block a user