Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

43 lines
1.2 KiB
Plaintext

# Test that the check command can check a standalone and cluster 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
# @TEST-EXEC: btest-diff all.out
# @TEST-EXEC: btest-diff onenode.out
. zeekctl-test-setup
zeekctl install
# Verify that standalone config is ok
zeekctl check > check1.out
# Verify that zeekctl check does not look at installed site policy
echo "this is an error" >> $ZEEKCTL_INSTALL_PREFIX/spool/installed-scripts-do-not-touch/site/local.zeek
zeekctl check > check2.out
# Verify that zeekctl check looks at policy files in SitePolicyPath
cp $ZEEKCTL_INSTALL_PREFIX/share/zeek/site/local.zeek .
echo "this is an error" >> $ZEEKCTL_INSTALL_PREFIX/share/zeek/site/local.zeek
! zeekctl check > check3.out
mv local.zeek $ZEEKCTL_INSTALL_PREFIX/share/zeek/site/
# Check a cluster config.
while read line; do installfile $line; done << EOF
etc/node.cfg__cluster
EOF
zeekctl install
# Check all nodes
zeekctl check > all.out
# Check one node
zeekctl check worker-1 > onenode.out