Add btest for get_current_packet_ts()

This commit is contained in:
Jan Grashoefer 2024-08-26 12:43:14 +02:00
parent 08c5a9c66d
commit 6977c07a25
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
network_time_init network time: 1362692526.869344
network_time_init packet ts: 1362692526.869344
conn_state_remove network time: 1362692527.080972
conn_state_remove packet ts: 0.0

View file

@ -0,0 +1,17 @@
# @TEST-DOC: Test get_current_packet_ts() in comparison with network_time().
# @TEST-EXEC: zeek -b -r $TRACES/http/get.trace %INPUT > output
# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff output
event network_time_init()
{
print fmt("network_time_init network time: %s", network_time());
print fmt("network_time_init packet ts: %s", get_current_packet_ts());
}
# Note: Gracefully closed connections will be actually removed after
# tcp_close_delay (default 5 secs).
event connection_state_remove(c: connection)
{
print fmt("conn_state_remove network time: %s", network_time());
print fmt("conn_state_remove packet ts: %s", get_current_packet_ts());
}