zeek/auxil/zeekctl/testing/plugin/sitepluginpath.test
Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

33 lines
1.1 KiB
Plaintext

# 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