zeek/testing/btest/broker/enable-and-exit.bro
Daniel Thayer d91dd8d9a8 Fix Bro and unit tests when broker is not enabled
When Bro was compiled with broker disabled, then some Bro scripts
were referencing functions and types that were not defined.  Fixed
by adding @ifdefs to several scripts.  Removed one @ifdef because
it was causing several unit tests to fail.

Also fixed the @TEST-REQUIRES check in tests that rely on broker so
that such tests are skipped when broker is disabled.
2016-05-10 06:24:35 -05:00

19 lines
384 B
Text

# @TEST-REQUIRES: grep -q ENABLE_BROKER:BOOL=true $BUILD/CMakeCache.txt
# @TEST-EXEC: bro -b %INPUT >output
# @TEST-EXEC: btest-diff output
redef exit_only_after_terminate = T;
event terminate_me() {
print "terminating";
terminate();
}
event bro_init() {
Broker::enable();
print "1";
schedule 1sec { terminate_me() };
print "2";
}