zeek/testing/btest/plugins/file.bro
Robin Sommer b6bbf90643 Updating plugin tests.
The init-plugin scripts now expects a destination directory. Normally
that would be a new subdirectory, but for the tests to keep working we
can also put it right into the current directory.
2015-02-16 20:26:26 -08:00

18 lines
593 B
Text

# @TEST-EXEC: ${DIST}/aux/bro-aux/plugin-support/init-plugin -u . Demo Foo
# @TEST-EXEC: cp -r %DIR/file-plugin/* .
# @TEST-EXEC: ./configure --bro-dist=${DIST} && make
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` bro -NN Demo::Foo >>output
# @TEST-EXEC: echo === >>output
# @TEST-EXEC: BRO_PLUGIN_PATH=`pwd` bro -r $TRACES/ftp/retr.trace %INPUT >>output
# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff output
event file_new(f: fa_file)
{
Files::add_analyzer(f, Files::ANALYZER_FOO);
}
event foo_piece(f: fa_file, data: string)
{
print "foo_piece", f$id, sub_bytes(data, 0, 20);
}