From: Eric Leblond Date: Mon, 31 Mar 2025 09:14:10 +0000 (+0200) Subject: tests: add tx_cnt tests X-Git-Tag: suricata-7.0.11~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2452%2Fhead;p=thirdparty%2Fsuricata-verify.git tests: add tx_cnt tests --- diff --git a/tests/flow-tx-cnt/README.md b/tests/flow-tx-cnt/README.md new file mode 100644 index 000000000..d3fae0c08 --- /dev/null +++ b/tests/flow-tx-cnt/README.md @@ -0,0 +1,7 @@ +# Description + +Check presence and value of tx_id and tx_cnt in events. + +# PCAP + +The pcap contains smb traffic with a smb share to match on diff --git a/tests/flow-tx-cnt/test.rules b/tests/flow-tx-cnt/test.rules new file mode 100644 index 000000000..de762d478 --- /dev/null +++ b/tests/flow-tx-cnt/test.rules @@ -0,0 +1,2 @@ +alert ssh $HOME_NET any -> any any (msg:"pcre without content and no match"; pcre:"/rabbit/"; sid:1; rev:1;) +alert smb $HOME_NET any -> any any (msg:"smb share content with match"; smb.share; content:"C"; sid:2; rev:1;) diff --git a/tests/flow-tx-cnt/test.yaml b/tests/flow-tx-cnt/test.yaml new file mode 100644 index 000000000..d89aacce4 --- /dev/null +++ b/tests/flow-tx-cnt/test.yaml @@ -0,0 +1,22 @@ +requires: + min-version: 8 + +pcap: ../smb-filename/input.pcap + +checks: + - filter: + count: 29 + match: + event_type: flow + - filter: + count: 1 + match: + event_type: flow + src_port: 49455 + flow.tx_cnt: 22 + - filter: + count: 1 + match: + event_type: flow + src_port: 49452 + flow.tx_cnt: 43