]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
test/memcap: Validate memcap pressure values 1763/head
authorJeff Lucovsky <jlucovsky@oisf.net>
Sun, 24 Mar 2024 12:17:31 +0000 (08:17 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 13 Apr 2024 06:50:20 +0000 (08:50 +0200)
Issue: 6398

This test validates that the memcap pressure stats are no longer in the
global namespace.

Old:
- memcap_pressure
- memcap_pressure_max

New:
- memcap.pressure
- memcap.pressure_max

tests/memcap-pressure/README.md [new file with mode: 0644]
tests/memcap-pressure/test.rules [new file with mode: 0644]
tests/memcap-pressure/test.yaml [new file with mode: 0644]

diff --git a/tests/memcap-pressure/README.md b/tests/memcap-pressure/README.md
new file mode 100644 (file)
index 0000000..72c1389
--- /dev/null
@@ -0,0 +1,8 @@
+# Test
+
+Validate that `memcap.pressure` and `memcap.pressure_max` exist.
+
+# Pcap
+
+Pcap is the result of a curl to www.testmyids.com, later extracted with
+Wireshark to keep the ``http`` packets only.
diff --git a/tests/memcap-pressure/test.rules b/tests/memcap-pressure/test.rules
new file mode 100644 (file)
index 0000000..3b7d124
--- /dev/null
@@ -0,0 +1 @@
+alert http any any -> any any (msg:"HTTP traffic"; sid:001; rev:1;)
diff --git a/tests/memcap-pressure/test.yaml b/tests/memcap-pressure/test.yaml
new file mode 100644 (file)
index 0000000..6db1213
--- /dev/null
@@ -0,0 +1,16 @@
+requires:
+  min-version: 8
+pcap: ../alert-testmyids-midstream5/input.pcap
+
+args:
+- --set stream.midstream=true
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: stats
+        has-key: stats.memcap.pressure_max
+        has-key: stats.memcap.pressure
+        not-has-key: stats.memcap_pressure_max
+        not-has-key: stats.memcap_pressure