1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
# Test that the check command can check a standalone configuration, and
# that it does not look at installed policy files, but rather those in
# the SitePolicyPath. Test that it returns zero exit status on success,
# and nonzero otherwise.
#
# @TEST-EXEC: bash %INPUT
# @TEST-EXEC: btest-diff check1.out
# @TEST-EXEC: btest-diff check2.out
# @TEST-EXEC: btest-diff check3.out
. broctl-test-setup
ret=0
broctl install
# verify that initial config is ok
broctl check > check1.out 2>&1
test $? -eq 0 || ret=1
# verify that broctl check does not look at installed site policy
echo "this is an error" >> $BROCTL_INSTALL_PREFIX/spool/installed-scripts-do-not-touch/site/local.bro
broctl check > check2.out 2>&1
# verify that broctl check looks at policy files in SitePolicyPath
echo "this is an error" >> $BROCTL_INSTALL_PREFIX/share/bro/site/local.bro
broctl check > tmp.out 2>&1
test $? -ne 0 || ret=1
head -n 1 tmp.out > check3.out
exit $ret
|