File: cron-enable-disable.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 (32 lines) | stat: -rw-r--r-- 843 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
# Test that the initial default cron state is correct, and that the state
# can be set to either disabled or enabled, and that cron doesn't do
# anything when it is disabled.
#
# @TEST-EXEC: bash %INPUT
# @TEST-EXEC: btest-diff disable.out
# @TEST-EXEC: btest-diff enable.out
# @TEST-EXEC: btest-diff out

. zeekctl-test-setup

while read line; do installfile $line; done << EOF
etc/zeekctl.cfg__debug
EOF

zeekctl install

# check the initial default state
zeekctl cron ? > out

# test that the state can be set to disabled
zeekctl cron disable > disable.out
zeekctl cron ? >> out

# test that cron doesn't do anything
rm $ZEEKCTL_INSTALL_PREFIX/spool/debug.log
zeekctl cron
grep -q "cron is disabled" $ZEEKCTL_INSTALL_PREFIX/spool/debug.log

# test that the state can be set to enabled
zeekctl cron enable > enable.out
zeekctl cron ? >> out