zeek/testing/btest/language/on_change_expire.test
Jon Siwek 7967a5b0aa General btest cleanup
- Use `-b` most everywhere, it will save time.

- Start some intel tests upon the input file being fully read instead of
  at an arbitrary time.

- Improve termination condition for some sumstats/cluster tests.

- Filter uninteresting output from some supervisor tests.

- Test for `notice_policy.log` is no longer needed.
2020-08-11 11:26:22 -07:00

25 lines
610 B
Text

# @TEST-EXEC: zeek -b -C -r $TRACES/var-services-std-ports.trace %INPUT >output
# @TEST-EXEC: btest-diff output
function inform_me(s: table[string] of count, idx: string): interval
{
print fmt("expired %s", idx);
return 0secs;
}
function change_function(t: table[string] of count, tpe: TableChange, idx: string, val: count)
{
print "change_function", idx, val, tpe;
}
global s: table[string] of count &create_expire=1secs &expire_func=inform_me &on_change=change_function;
event new_connection(c: connection)
{
s[fmt("%s", c$id)] = 1;
}
event zeek_init()
{
s["a"] = 5;
}