]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
http: adds test with whole body as gap
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 13 Jul 2020 07:55:47 +0000 (09:55 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 31 Aug 2020 10:56:47 +0000 (12:56 +0200)
tests/http-gap-whole-body/README.md [new file with mode: 0644]
tests/http-gap-whole-body/input.pcap [new file with mode: 0644]
tests/http-gap-whole-body/test.yaml [new file with mode: 0644]

diff --git a/tests/http-gap-whole-body/README.md b/tests/http-gap-whole-body/README.md
new file mode 100644 (file)
index 0000000..c75e186
--- /dev/null
@@ -0,0 +1,13 @@
+# Description
+
+Test http gap handling
+
+This test case contains a single simple gap in response body with defined content-length
+
+# PCAP
+
+The pcap comes from running
+`python test/htptopcap.py toaddgap.txt`
+With the attached toaddgap.txt from test http-gap-simple
+
+Then removing packet 9
diff --git a/tests/http-gap-whole-body/input.pcap b/tests/http-gap-whole-body/input.pcap
new file mode 100644 (file)
index 0000000..ba9d3fe
Binary files /dev/null and b/tests/http-gap-whole-body/input.pcap differ
diff --git a/tests/http-gap-whole-body/test.yaml b/tests/http-gap-whole-body/test.yaml
new file mode 100644 (file)
index 0000000..cdfbf47
--- /dev/null
@@ -0,0 +1,51 @@
+requires:
+  features:
+    - HAVE_LIBJANSSON
+  min-version: 6.0.0
+
+# disables checksum verification
+args:
+  - -k none
+
+checks:
+
+  # Check that there is one file event with content range.
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.url: "/1"
+        http.status: 200
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.url: "/2"
+        http.status: 200
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.url: "/3"
+        http.status: 200
+  - filter:
+      count: 1
+      match:
+        event_type: fileinfo
+        fileinfo.size: 14
+        fileinfo.state: "CLOSED"
+        fileinfo.gaps: false
+  - filter:
+      count: 1
+      match:
+        event_type: fileinfo
+        fileinfo.size: 0
+        fileinfo.state: "TRUNCATED"
+        fileinfo.gaps: true
+  - filter:
+      count: 1
+      match:
+        event_type: fileinfo
+        fileinfo.size: 70
+        fileinfo.state: "CLOSED"
+        fileinfo.gaps: false