File: load.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-- 1,052 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 plugins are loaded by default.
#
# @TEST-EXEC: bash %INPUT

. zeekctl-test-setup

# Create a subdirectory to verify that zeekctl searches for plugins in subdirs
mkdir $ZEEKCTL_INSTALL_PREFIX/lib/zeek/plugins/more

# Install some test plugins in directories where zeekctl searches by default
while read line; do installfile $line; done << EOF
etc/zeekctl.cfg__debug
plugins/optionstest.py      lib/zeekctl/plugins --new
plugins/commandtest.py      lib/zeekctl/plugins --new
plugins/nodekeystest.py     lib/zeek/plugins --new
plugins/zeekctlconfigtest.py lib/zeek/plugins/more --new
EOF

# Rename a valid plugin file so that it won't be loaded
cd $ZEEKCTL_INSTALL_PREFIX/lib/zeekctl/plugins
mv commandtest.py commandtest
cd -

debuglog=$ZEEKCTL_INSTALL_PREFIX/spool/debug.log

zeekctl exit

# Verify that the expected plugins were found
grep "Found plugin optionstest from" ${debuglog}
grep "Found plugin nodekeystest from" ${debuglog}
grep "Found plugin zeekctlconfigtest from" ${debuglog}
! grep "Found plugin commandtest from" ${debuglog}