]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
http1: adds test with invalid status 2085/head 2161/head
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 8 Oct 2024 14:10:04 +0000 (16:10 +0200)
committerPhilippe Antoine <pantoine@oisf.net>
Tue, 3 Dec 2024 20:57:05 +0000 (21:57 +0100)
Ticket: 7311

tests/http1-noint-status/README.md [new file with mode: 0644]
tests/http1-noint-status/input.pcap [new file with mode: 0644]
tests/http1-noint-status/server.py [new file with mode: 0644]
tests/http1-noint-status/test.yaml [new file with mode: 0644]

diff --git a/tests/http1-noint-status/README.md b/tests/http1-noint-status/README.md
new file mode 100644 (file)
index 0000000..42f8da1
--- /dev/null
@@ -0,0 +1,11 @@
+# Description
+
+Test HTTP1 log of invalid status
+
+https://redmine.openinfosecfoundation.org/issues/7311
+
+# PCAP
+
+The pcap is crafted with
+`curl http://127.0.0.1:8001/test` as client
+and custom server.py as server
diff --git a/tests/http1-noint-status/input.pcap b/tests/http1-noint-status/input.pcap
new file mode 100644 (file)
index 0000000..fdd5f5f
Binary files /dev/null and b/tests/http1-noint-status/input.pcap differ
diff --git a/tests/http1-noint-status/server.py b/tests/http1-noint-status/server.py
new file mode 100644 (file)
index 0000000..32e12cd
--- /dev/null
@@ -0,0 +1,18 @@
+#! /usr/bin/env python
+
+# @author: Philippe Antoine
+
+import sys
+import binascii
+from threading import Thread
+import time
+import socket
+
+s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+s.bind(("127.0.0.1", 8001))
+s.listen(1)
+conn, addr = s.accept()
+data = conn.recv(1024)
+conn.send(b"HTTP/1.0 2XX OK\nServer: POC\nContent-Length:4\n\ntoto")
+conn.close()
+s.close()
diff --git a/tests/http1-noint-status/test.yaml b/tests/http1-noint-status/test.yaml
new file mode 100644 (file)
index 0000000..b60dea5
--- /dev/null
@@ -0,0 +1,13 @@
+requires:
+  min-version: 8
+
+# disables checksum verification
+args:
+  - -k none
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        http.status_string: 2XX