zeek/testing/btest/core/pcap/suspend-processing.zeek
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

34 lines
668 B
Text

# @TEST-EXEC: zeek -b -C -r $TRACES/wikipedia.trace %INPUT >output
# @TEST-EXEC: btest-diff output
# @TEST-EXEC: btest-diff .stderr
redef exit_only_after_terminate = T;
event go_on()
{
continue_processing();
print fmt("network_time: %f", network_time());
}
event pcap_init()
{
print fmt("network_time: %f", network_time());
suspend_processing();
# Some asynchronous work
schedule 5sec { go_on() };
}
event zeek_init()
{
schedule 0sec { pcap_init() };
}
global pkt_cnt: count = 0;
event new_packet(c: connection, p: pkt_hdr)
{
pkt_cnt += 1;
print fmt("Processing packet %s at %f", pkt_cnt, network_time());
if ( pkt_cnt >= 20 )
terminate();
}