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}
|