]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add ipv4 datajson test 2564/head 2565/head
authorEric Leblond <el@stamus-networks.com>
Mon, 9 Jun 2025 14:32:11 +0000 (16:32 +0200)
committerEric Leblond <el@stamus-networks.com>
Wed, 11 Jun 2025 12:01:45 +0000 (14:01 +0200)
tests/datajson/datajson-11-ipv4/input.pcap [new file with mode: 0644]
tests/datajson/datajson-11-ipv4/src.lst [new file with mode: 0644]
tests/datajson/datajson-11-ipv4/test.rules [new file with mode: 0644]
tests/datajson/datajson-11-ipv4/test.yaml [new file with mode: 0644]

diff --git a/tests/datajson/datajson-11-ipv4/input.pcap b/tests/datajson/datajson-11-ipv4/input.pcap
new file mode 100644 (file)
index 0000000..8fb6832
Binary files /dev/null and b/tests/datajson/datajson-11-ipv4/input.pcap differ
diff --git a/tests/datajson/datajson-11-ipv4/src.lst b/tests/datajson/datajson-11-ipv4/src.lst
new file mode 100644 (file)
index 0000000..7553335
--- /dev/null
@@ -0,0 +1 @@
+[{"ip": "10.16.1.11", "test": "success", "context":3}]
diff --git a/tests/datajson/datajson-11-ipv4/test.rules b/tests/datajson/datajson-11-ipv4/test.rules
new file mode 100644 (file)
index 0000000..e2e5f21
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (flow:established,to_server; http.host; content:"testmyids.com"; ip.src; dataset:isset,src_ip,type ipv4,load src.lst,format json, context_key src_ip, value_key ip; sid:1;)
diff --git a/tests/datajson/datajson-11-ipv4/test.yaml b/tests/datajson/datajson-11-ipv4/test.yaml
new file mode 100644 (file)
index 0000000..d0c3ba5
--- /dev/null
@@ -0,0 +1,17 @@
+requires:
+  min-version: 8
+
+args:
+ - -k none --set datasets.enabled=yes
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 1
+        alert.context.src_ip.test: success