Skip to content

Commit

Permalink
datasets: test with multi-buffer and occurences in different packets
Browse files Browse the repository at this point in the history
Ticket: 5576
  • Loading branch information
catenacyber committed Oct 15, 2024
1 parent e8aedda commit c004733
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/datasets-delayed-multi-postmatch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Test
====

Test datasets only sets when there is a full signature match.
Test is with a signature using different keywords matching at different stages,
and pcap having different packets making the transaction progress step by step.
And test is using a multi-buffer to test that we only save the right occurences.

https://redmine.openinfosecfoundation.org/issues/5576

PCAP
====

Pcap crafted with some http server and some python client that delays or not the writing of the headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
WC1maXJzdDogc2VjcmV0
SGVhZGVyMTogZmlyc3Q=
1 change: 1 addition & 0 deletions tests/datasets-delayed-multi-postmatch/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert http any any -> any any ( sid: 1; http.stat_code; content: "200"; fast_pattern; http.response_header; content: "first"; dataset:set,http_match,type string,save http_match.csv; file.data; content: "later";)
15 changes: 15 additions & 0 deletions tests/datasets-delayed-multi-postmatch/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
requires:
min-version: 8

args:
- -k none --data-dir=${OUTPUT_DIR}

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
- file-compare:
filename: http_match.csv
expected: expected/http_match.csv

0 comments on commit c004733

Please sign in to comment.