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

This also installs symlinks from "zeek" and "bro-config" to a wrapper script that prints a deprecation warning. The btests pass, but this is still WIP. broctl renaming is still missing. #239
37 lines
718 B
Text
37 lines
718 B
Text
# @TEST-EXEC: zeek -b %INPUT >output
|
|
# @TEST-EXEC: btest-diff output
|
|
|
|
redef exit_only_after_terminate = T;
|
|
|
|
const exp_val = -1sec &redef;
|
|
|
|
global expired: function(tbl: table[int] of string, idx: int): interval;
|
|
global data: table[int] of string &write_expire=exp_val &expire_func=expired;
|
|
|
|
redef table_expire_interval = 1sec;
|
|
redef exp_val = 6sec;
|
|
|
|
global runs = 0;
|
|
event do_it()
|
|
{
|
|
++runs;
|
|
print fmt("Run %s", runs);
|
|
|
|
if ( runs < 2 )
|
|
schedule 4sec { do_it() };
|
|
else
|
|
terminate();
|
|
}
|
|
|
|
|
|
function expired(tbl: table[int] of string, idx: int): interval
|
|
{
|
|
print fmt("Expired: %s --> %s", idx, tbl[idx]);
|
|
return 0sec;
|
|
}
|
|
|
|
event zeek_init() &priority=-10
|
|
{
|
|
data[0] = "some data";
|
|
schedule 4sec { do_it() };
|
|
}
|