From bb20026267d00585b42a0ef24e6bdec5defdb032 Mon Sep 17 00:00:00 2001 From: Johanna Amann Date: Tue, 8 May 2018 11:23:28 -0700 Subject: [PATCH] Add test for dump_current_packet bif. --- CHANGES | 7 +++++++ VERSION | 2 +- .../Baseline/bifs.dump_current_packet/1.pcap | Bin 0 -> 127 bytes .../Baseline/bifs.dump_current_packet/2.pcap | Bin 0 -> 253 bytes testing/btest/bifs/dump_current_packet.bro | 13 +++++++++++++ 5 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 testing/btest/Baseline/bifs.dump_current_packet/1.pcap create mode 100644 testing/btest/Baseline/bifs.dump_current_packet/2.pcap create mode 100644 testing/btest/bifs/dump_current_packet.bro diff --git a/CHANGES b/CHANGES index ee07898969..56288489a6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,11 @@ +2.5-559 | 2018-05-08 11:23:28 -0700 + + * Add test for dump_current_packet bif. (Johanna Amann) + + * Fix dump_packet & dump_current_packet to work with several filenames. + (Assaf Morami) + 2.5-553 | 2018-05-03 14:59:53 -0500 * Make BinPAC exception handling more consistent (Vlad Grigorescu) diff --git a/VERSION b/VERSION index feba24af84..a04526640f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5-553 +2.5-559 diff --git a/testing/btest/Baseline/bifs.dump_current_packet/1.pcap b/testing/btest/Baseline/bifs.dump_current_packet/1.pcap new file mode 100644 index 0000000000000000000000000000000000000000..786971a6cfa117324d4be621dfb4e16fd51c7d6e GIT binary patch literal 127 zcmca|c+)~A1{MZ5P+(wS1ajopHv5WKGBSh%*&xiw5XZpqo58?iuiX(223H0KPX-1D zhW~;F{=I#7PCWq1iM$kf$zWQa1XK($0!Xo?r{-qnWpc(Br literal 0 HcmV?d00001 diff --git a/testing/btest/bifs/dump_current_packet.bro b/testing/btest/bifs/dump_current_packet.bro new file mode 100644 index 0000000000..61c96384e4 --- /dev/null +++ b/testing/btest/bifs/dump_current_packet.bro @@ -0,0 +1,13 @@ +# @TEST-EXEC: bro -b -r $TRACES/wikipedia.trace %INPUT +# @TEST-EXEC: btest-diff 1.pcap +# @TEST-EXEC: btest-diff 2.pcap + +global i: count = 0; + +event new_packet(c: connection, p: pkt_hdr) + { + ++i; + dump_current_packet(cat(i, ".pcap")); + if ( i >= 3 ) + terminate(); + }