File: start-perms.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 (30 lines) | stat: -rw-r--r-- 827 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
# 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