]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add vxlan with non-zero reserved fields test
authorFupeng Zhao <fupeng.zhao@foxmail.com>
Thu, 18 Sep 2025 11:31:26 +0000 (11:31 +0000)
committerVictor Julien <victor@inliniac.net>
Fri, 19 Sep 2025 13:32:21 +0000 (15:32 +0200)
Ticket: #7753

tests/vxlan-non-zero-reserved-fields/README.md [new file with mode: 0644]
tests/vxlan-non-zero-reserved-fields/input.pcap [new file with mode: 0644]
tests/vxlan-non-zero-reserved-fields/suricata.yaml [new file with mode: 0644]
tests/vxlan-non-zero-reserved-fields/test.yaml [new file with mode: 0644]

diff --git a/tests/vxlan-non-zero-reserved-fields/README.md b/tests/vxlan-non-zero-reserved-fields/README.md
new file mode 100644 (file)
index 0000000..15ad925
--- /dev/null
@@ -0,0 +1,11 @@
+# Test Description
+
+Test VXLAN decoding with non-zero reserved fields.
+
+## PCAP
+
+Pcap provided by Fupeng Zhao. Manually crafted to reflect [vxlan: Support user-defined reserved bits](https://lwn.net/Articles/998601/).
+
+## Related issues
+
+https://redmine.openinfosecfoundation.org/issues/7753
diff --git a/tests/vxlan-non-zero-reserved-fields/input.pcap b/tests/vxlan-non-zero-reserved-fields/input.pcap
new file mode 100644 (file)
index 0000000..780f303
Binary files /dev/null and b/tests/vxlan-non-zero-reserved-fields/input.pcap differ
diff --git a/tests/vxlan-non-zero-reserved-fields/suricata.yaml b/tests/vxlan-non-zero-reserved-fields/suricata.yaml
new file mode 100644 (file)
index 0000000..666ed04
--- /dev/null
@@ -0,0 +1,24 @@
+%YAML 1.1
+---
+
+outputs:
+  - stats:
+      enabled: yes
+      filename: stats.log
+      append: yes       # append to file (yes) or overwrite it (no)
+      totals: yes       # stats for all threads merged together
+      threads: no       # per thread stats
+  - eve-log:
+      enabled: yes
+      filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
+      filename: eve.json
+      types:
+        - http
+        - stats
+        - flow
+
+decoder:
+  vxlan:
+    enabled: true
+    ports: "4789"
+    reserved-bits-check: permissive
diff --git a/tests/vxlan-non-zero-reserved-fields/test.yaml b/tests/vxlan-non-zero-reserved-fields/test.yaml
new file mode 100644 (file)
index 0000000..8040ade
--- /dev/null
@@ -0,0 +1,25 @@
+requires:
+  min-version: 9
+
+args:
+  - --set decoder.vxlan.enabled=true
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        src_port: 51252
+        dest_port: 80
+        flow.pkts_toserver: 5
+        flow.pkts_toclient: 5
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        dest_port: 4789
+  - filter:
+      count: 1
+      match:
+        event_type: stats
+        stats.decoder.vxlan: 10