File: sitepluginpath.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,105 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 found in a directory specified by the SitePluginPath
# option, and that directories that don't contain plugins are ignored.
#
# @TEST-EXEC: bash %INPUT

. zeekctl-test-setup

# Create dirs specified in the SitePluginPath option in zeekctl.cfg
mkdir $ZEEKCTL_INSTALL_PREFIX/testplugins
mkdir $ZEEKCTL_INSTALL_PREFIX/moreplugins
mkdir $ZEEKCTL_INSTALL_PREFIX/emptydir

# Install some test plugins
while read line; do installfile $line; done << EOF
etc/zeekctl.cfg__debug
plugins/optionstest.py testplugins --new
plugins/zeekctlconfigtest.py moreplugins --new
EOF

# Specify directories containing test plugins, and a couple other directories
# that don't.
echo "SitePluginPath=@PREFIX@/doesnotexist:@PREFIX@/testplugins:@PREFIX@/emptydir:@PREFIX@/moreplugins" >> $ZEEKCTL_INSTALL_PREFIX/etc/zeekctl.cfg

replaceprefix etc/zeekctl.cfg

debuglog=$ZEEKCTL_INSTALL_PREFIX/spool/debug.log

zeekctl exit

# Verify that the test plugins were found
grep "Found plugin optionstest from" ${debuglog} | grep testplugins
grep "Found plugin zeekctlconfigtest from" ${debuglog} | grep moreplugins