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
|
# Test that the start command fails immediately when zeekctl lacks the needed
# permissions to the zeek working directory, and gives a useful error message.
#
# Skip this test if running as the superuser.
# @TEST-REQUIRES: test `id -u` -ne 0
#
# @TEST-EXEC: bash %INPUT
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff start.out
# @TEST-EXEC: btest-diff status.out
. zeekctl-test-setup
while read line; do installfile $line; done << EOF
etc/zeekctl.cfg__no_email
bin/zeek__test
EOF
zeekctl install
# need to create the working dir
zeekctl start
zeekctl stop
# Remove write access to working dir.
chmod ugo-w $ZEEKCTL_INSTALL_PREFIX/spool/zeek
# Verify that the start command returns non-zero.
! zeekctl start > start.out 2>&1
# Verify that the status is "stopped".
! zeekctl status > status.out
|