File: check.test

package info (click to toggle)
zeekctl 2.2.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,544 kB
  • sloc: python: 5,639; sh: 1,374; makefile: 71; awk: 24
file content (42 lines) | stat: -rw-r--r-- 1,270 bytes parent folder | download
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
32
33
34
35
36
37
38
39
40
41
42
# 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