mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Add btest for expiration of all pending timers.
This commit is contained in:
parent
0e97c29eb8
commit
8cdc3e4374
4 changed files with 49 additions and 0 deletions
12
testing/btest/Baseline/core.expire-all-timers/conn-all.log
Normal file
12
testing/btest/Baseline/core.expire-all-timers/conn-all.log
Normal file
|
@ -0,0 +1,12 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
#separator \x09
|
||||
#set_separator ,
|
||||
#empty_field (empty)
|
||||
#unset_field -
|
||||
#path conn
|
||||
#open XXXX-XX-XX-XX-XX-XX
|
||||
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes resp_bytes conn_state local_orig local_resp missed_bytes history orig_pkts orig_ip_bytes resp_pkts resp_ip_bytes tunnel_parents
|
||||
#types time string addr port addr port enum string interval count count string bool bool count string count count count count set[string]
|
||||
XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 10.0.0.1 51889 192.168.0.1 80 tcp - 0.000010 18 0 OTH - - 0 Da 1 58 1 40 -
|
||||
XXXXXXXXXX.XXXXXX ClEkJM2Vm5giqnMf4h 10.0.0.1 51889 192.168.0.1 80 tcp - - - - OTH - - 0 D 1 58 0 0 -
|
||||
#close XXXX-XX-XX-XX-XX-XX
|
|
@ -0,0 +1,11 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
#separator \x09
|
||||
#set_separator ,
|
||||
#empty_field (empty)
|
||||
#unset_field -
|
||||
#path conn
|
||||
#open XXXX-XX-XX-XX-XX-XX
|
||||
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes resp_bytes conn_state local_orig local_resp missed_bytes history orig_pkts orig_ip_bytes resp_pkts resp_ip_bytes tunnel_parents
|
||||
#types time string addr port addr port enum string interval count count string bool bool count string count count count count set[string]
|
||||
XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 10.0.0.1 51889 192.168.0.1 80 tcp - 300.000010 18 0 OTH - - 0 DaT 2 116 1 40 -
|
||||
#close XXXX-XX-XX-XX-XX-XX
|
BIN
testing/btest/Traces/tcp/retransmit-timeout.pcap
Normal file
BIN
testing/btest/Traces/tcp/retransmit-timeout.pcap
Normal file
Binary file not shown.
26
testing/btest/core/expire-all-timers.zeek
Normal file
26
testing/btest/core/expire-all-timers.zeek
Normal file
|
@ -0,0 +1,26 @@
|
|||
# @TEST-EXEC: zeek -b -C -r $TRACES/tcp/retransmit-timeout.pcap %INPUT
|
||||
# @TEST-EXEC: mv conn.log conn-limited.log
|
||||
|
||||
# @TEST-EXEC: zeek -b -C -r $TRACES/tcp/retransmit-timeout.pcap %INPUT max_timer_expires=0
|
||||
# @TEST-EXEC: mv conn.log conn-all.log
|
||||
|
||||
|
||||
# @TEST-EXEC: btest-diff conn-limited.log
|
||||
# @TEST-EXEC: btest-diff conn-all.log
|
||||
|
||||
@load base/protocols/conn
|
||||
|
||||
const max_timer_expires_default = max_timer_expires;
|
||||
|
||||
event dummy()
|
||||
{
|
||||
}
|
||||
|
||||
event network_time_init()
|
||||
{
|
||||
# Suppress connection timeout by scheduling more timers than
|
||||
# can be handled in the context of a single packet, by default.
|
||||
local i = 0;
|
||||
while ( ++i <= max_timer_expires_default )
|
||||
schedule 4 min { dummy() };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue