]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: check that datajson fails on dataset
authorEric Leblond <el@stamus-networks.com>
Sun, 1 Dec 2024 22:04:04 +0000 (23:04 +0100)
committerEric Leblond <el@stamus-networks.com>
Wed, 11 Jun 2025 12:01:45 +0000 (14:01 +0200)
Normal dataset are not supposed to load with datajson so we
should exit with code 1.

tests/datajson/datajson-07-dataset/host.lst [new file with mode: 0644]
tests/datajson/datajson-07-dataset/input.pcap [new file with mode: 0644]
tests/datajson/datajson-07-dataset/ip.lst [new file with mode: 0644]
tests/datajson/datajson-07-dataset/test.rules [new file with mode: 0644]
tests/datajson/datajson-07-dataset/test.yaml [new file with mode: 0644]

diff --git a/tests/datajson/datajson-07-dataset/host.lst b/tests/datajson/datajson-07-dataset/host.lst
new file mode 100644 (file)
index 0000000..21cda85
--- /dev/null
@@ -0,0 +1 @@
+d3d3LnRlc3RteWlkcy5jb20=
diff --git a/tests/datajson/datajson-07-dataset/input.pcap b/tests/datajson/datajson-07-dataset/input.pcap
new file mode 100644 (file)
index 0000000..8fb6832
Binary files /dev/null and b/tests/datajson/datajson-07-dataset/input.pcap differ
diff --git a/tests/datajson/datajson-07-dataset/ip.lst b/tests/datajson/datajson-07-dataset/ip.lst
new file mode 100644 (file)
index 0000000..81c6e5f
--- /dev/null
@@ -0,0 +1 @@
+10.16.1.11
diff --git a/tests/datajson/datajson-07-dataset/test.rules b/tests/datajson/datajson-07-dataset/test.rules
new file mode 100644 (file)
index 0000000..5513f03
--- /dev/null
@@ -0,0 +1,2 @@
+alert http any any -> any any (flow:established,to_server; ip.src; datajson:isset,bip,type ipv6,load ip.lst,key ip; sid:1;)
+alert http any any -> any any (flow:established,to_server; http.host; datajson:isset,badhost,type string,load host.lst,key bad_host; sid:2;)
diff --git a/tests/datajson/datajson-07-dataset/test.yaml b/tests/datajson/datajson-07-dataset/test.yaml
new file mode 100644 (file)
index 0000000..ea46efd
--- /dev/null
@@ -0,0 +1,10 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  files:
+    - src/datasets.c
+
+args:
+ - -k none --set datasets.enabled=yes
+
+exit-code: 1