mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Add test for network_time behavior.
This commit is contained in:
parent
4a76229209
commit
c99f825e22
1 changed files with 38 additions and 0 deletions
38
testing/btest/core/network-time.zeek
Normal file
38
testing/btest/core/network-time.zeek
Normal file
|
@ -0,0 +1,38 @@
|
|||
# @TEST-EXEC: zeek -b -C -r $TRACES/wikipedia.trace %INPUT > output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
event scheduled_delayed_event()
|
||||
{
|
||||
print fmt("scheduled_delayed_event: %T", network_time());
|
||||
}
|
||||
|
||||
event scheduled_event()
|
||||
{
|
||||
print fmt("scheduled_event: %T", network_time());
|
||||
schedule 1sec { scheduled_delayed_event() };
|
||||
}
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
print fmt("zeek_init: %T", network_time());
|
||||
schedule 0sec { scheduled_event() };
|
||||
}
|
||||
|
||||
event network_time_init()
|
||||
{
|
||||
print fmt("network_time_init: %T", network_time());
|
||||
}
|
||||
|
||||
global pkt_count: count = 0;
|
||||
|
||||
event new_packet(c: connection, p: pkt_hdr) &priority=10
|
||||
{
|
||||
pkt_count += 1;
|
||||
if ( pkt_count % 25 == 0 )
|
||||
print fmt("Processing packet %s at %T", pkt_count, network_time());
|
||||
|
||||
if ( pkt_count == 100)
|
||||
terminate();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue