]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
test: simple test for unknown requirements
authorJason Ish <jason.ish@oisf.net>
Wed, 4 Dec 2024 17:45:38 +0000 (11:45 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 7 Dec 2024 06:18:15 +0000 (07:18 +0100)
tests/requires-unknown/README.md [new file with mode: 0644]
tests/requires-unknown/test.rules [new file with mode: 0644]
tests/requires-unknown/test.yaml [new file with mode: 0644]

diff --git a/tests/requires-unknown/README.md b/tests/requires-unknown/README.md
new file mode 100644 (file)
index 0000000..8da7368
--- /dev/null
@@ -0,0 +1,4 @@
+Test that unknown requirements are treated as unsatisfied leading to the rule
+being skipped.
+
+Simple standalone test.
diff --git a/tests/requires-unknown/test.rules b/tests/requires-unknown/test.rules
new file mode 100644 (file)
index 0000000..136269b
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (content:"uid=0"; requires: foo bar; sid:9; rev:1;)
diff --git a/tests/requires-unknown/test.yaml b/tests/requires-unknown/test.yaml
new file mode 100644 (file)
index 0000000..4ac126a
--- /dev/null
@@ -0,0 +1,14 @@
+requires:
+  min-version: 7.0.8
+
+pcap: ../eve-metadata/testmyids.pcap
+
+checks:
+
+  - filter:
+      count: 1
+      match:
+        event_type: stats
+        stats.detect.engines[0].rules_skipped: 1
+        stats.detect.engines[0].rules_loaded: 0
+        stats.detect.engines[0].rules_failed: 0