mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

* origin/topic/seth/zeek_init: Some more testing fixes. Update docs and tests for bro_(init|done) -> zeek_(init|done) Implement the zeek_init handler.
27 lines
515 B
Text
27 lines
515 B
Text
# @TEST-EXEC: bro -b %INPUT
|
|
# @TEST-EXEC: cp .stderr output
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
|
|
|
|
redef exit_only_after_terminate = T;
|
|
|
|
global x: table[string] of interval;
|
|
global data: table[int] of string &create_expire=x["kaputt"];
|
|
|
|
global runs = 0;
|
|
event do_it()
|
|
{
|
|
print fmt("Run %s", runs);
|
|
|
|
++runs;
|
|
if ( runs < 4 )
|
|
schedule 1sec { do_it() };
|
|
else
|
|
terminate();
|
|
}
|
|
|
|
|
|
event zeek_init() &priority=-10
|
|
{
|
|
data[0] = "some data";
|
|
schedule 1sec { do_it() };
|
|
}
|