zeek/testing/btest/language/when.zeek
Robin Sommer 789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
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
2019-05-01 21:43:45 +00:00

31 lines
591 B
Text

# @TEST-EXEC: btest-bg-run test1 zeek %INPUT
# @TEST-EXEC: btest-bg-wait 10
# @TEST-EXEC: mv test1/.stdout out
# @TEST-EXEC: btest-diff out
redef exit_only_after_terminate = T;
event zeek_init()
{
local h: addr = 127.0.0.1;
when ( local hname = lookup_addr(h) )
{
print "lookup successful";
terminate();
}
timeout 10sec
{
print "timeout (1)";
}
local to = 5sec;
# Just checking that timeouts can use arbitrary expressions...
when ( local hname2 = lookup_addr(h) ) {}
timeout to {}
when ( local hname3 = lookup_addr(h) ) {}
timeout to + 2sec {}
print "done";
}