]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
test/entropy: Test with raw content
authorJeff Lucovsky <jlucovsky@oisf.net>
Tue, 2 Sep 2025 14:06:05 +0000 (10:06 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 18 Oct 2025 16:36:50 +0000 (18:36 +0200)
Test entropy w/out a sticky buffer.

Without the suricata fixes, the test will SEGV and thus fail.

With the suricata fixes, the calculated entropy value will be
matched with the value in the test specification.

tests/entropy/entropy-03/input.pcap [new file with mode: 0644]
tests/entropy/entropy-03/test.rules [new file with mode: 0644]
tests/entropy/entropy-03/test.yaml [new file with mode: 0644]

diff --git a/tests/entropy/entropy-03/input.pcap b/tests/entropy/entropy-03/input.pcap
new file mode 100644 (file)
index 0000000..e0f1fbe
Binary files /dev/null and b/tests/entropy/entropy-03/input.pcap differ
diff --git a/tests/entropy/entropy-03/test.rules b/tests/entropy/entropy-03/test.rules
new file mode 100644 (file)
index 0000000..9193dec
--- /dev/null
@@ -0,0 +1 @@
+alert tcp-pkt any any -> any any (msg:"Entropy segfault test"; entropy: value >= 6; sid:1;)
diff --git a/tests/entropy/entropy-03/test.yaml b/tests/entropy/entropy-03/test.yaml
new file mode 100644 (file)
index 0000000..6d86905
--- /dev/null
@@ -0,0 +1,11 @@
+requires:
+    min-version: 8.0.1
+
+pcap: ../entropy-01/input.pcap
+
+checks:
+    - filter:
+        count: 1
+        match:
+          event_type: http
+          metadata.entropy.content: 4.137370175000773