zeek/testing/btest/coverage/bare-load-baseline.test
2011-09-29 15:53:54 -04:00

14 lines
811 B
Text

# This test is meant to cover whether the set of scripts that get loaded by
# default in bare mode matches a baseline of known defaults. The baseline
# should only need updating if something new is @load'd from init-bare.bro
# (or from an @load'd descendent of it).
#
# 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 -b misc/loaded-scripts
# @TEST-EXEC: test -e loaded_scripts.log
# @TEST-EXEC: cat loaded_scripts.log | egrep -v '#' | awk 'NR>0{print $1}' | 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