zeek/testing/btest/policy/misc/default-loaded-scripts.test
Jon Siwek 451b43498f Another fix to the default-loaded-scripts test.
sed on some platforms like OS X (maybe FreeBSD in general) won't recognize
semi-colon delimited commands as multiple commands, instead use the -e
option multiple times to build the command list.
2011-07-27 15:11:05 -05:00

12 lines
650 B
Text

# This test is meant to cover whether the set of scripts that get loaded by
# default matches a baseline of known defaults.
#
# As the output has absolute paths in it, we need to remove the common
# prefix to make the test work everywhere. That's what the sed magic
# below does. Don't ask. :-)
# @TEST-EXEC: bro misc/loaded-scripts
# @TEST-EXEC: test -e loaded_scripts.log
# @TEST-EXEC: cat loaded_scripts.log | awk 'NR>1{print $2}' | sed -e ':a' -e '$!N' -e 's/^\(.*\).*\n\1.*/\1/' -e 'ta' >prefix
# @TEST-EXEC: cat loaded_scripts.log | sed "s#`cat prefix`##g" >canonified_loaded_scripts.log
# @TEST-EXEC: btest-diff canonified_loaded_scripts.log