]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests: add a test for a bug 6278 1452/head
authorLukas Sismis <lsismis@oisf.net>
Wed, 23 Aug 2023 11:32:26 +0000 (13:32 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 2 Nov 2023 19:49:28 +0000 (20:49 +0100)
tests include:
  - non-existent user
  - NULL user (empty user string)

tests/bug-6278-1/README.md [new file with mode: 0644]
tests/bug-6278-1/suricata.yaml [new file with mode: 0644]
tests/bug-6278-1/test.yaml [new file with mode: 0644]
tests/bug-6278-2/README.md [new file with mode: 0644]
tests/bug-6278-2/suricata.yaml [new file with mode: 0644]
tests/bug-6278-2/test.yaml [new file with mode: 0644]

diff --git a/tests/bug-6278-1/README.md b/tests/bug-6278-1/README.md
new file mode 100644 (file)
index 0000000..a562446
--- /dev/null
@@ -0,0 +1,8 @@
+# Test Description
+
+Test to make sure Suricata handles well non-existent user as an input 
+in the user field.
+
+## Related Issue
+
+https://redmine.openinfosecfoundation.org/issues/6278
diff --git a/tests/bug-6278-1/suricata.yaml b/tests/bug-6278-1/suricata.yaml
new file mode 100644 (file)
index 0000000..0ec8a4c
--- /dev/null
@@ -0,0 +1,5 @@
+%YAML 1.1
+---
+
+run-as:
+  user: totally-not-existing-user
diff --git a/tests/bug-6278-1/test.yaml b/tests/bug-6278-1/test.yaml
new file mode 100644 (file)
index 0000000..f65dc94
--- /dev/null
@@ -0,0 +1,12 @@
+requires:
+  min-version: 6
+
+pcap: false
+exit-code: 1
+args:
+  - --engine-analysis
+
+checks:
+  - shell:
+      args: grep -c 'unable to get the user ID, check if user exist!!' stderr
+      expect: 1
diff --git a/tests/bug-6278-2/README.md b/tests/bug-6278-2/README.md
new file mode 100644 (file)
index 0000000..5c2d1f1
--- /dev/null
@@ -0,0 +1,7 @@
+# Test Description
+
+Test to make sure Suricata handles well null input in the user field.
+
+## Related Issue
+
+https://redmine.openinfosecfoundation.org/issues/6278
diff --git a/tests/bug-6278-2/suricata.yaml b/tests/bug-6278-2/suricata.yaml
new file mode 100644 (file)
index 0000000..9581e25
--- /dev/null
@@ -0,0 +1,6 @@
+%YAML 1.1
+---
+
+run-as:
+  user: # null user
+  group: 
diff --git a/tests/bug-6278-2/test.yaml b/tests/bug-6278-2/test.yaml
new file mode 100644 (file)
index 0000000..67dc833
--- /dev/null
@@ -0,0 +1,17 @@
+requires:
+  min-version: 6
+
+pcap: false
+exit-code: 1
+args:
+  - --engine-analysis
+
+checks:
+  - shell:
+      args: grep -c 'no user name was provided - ensure it is specified either in the configuration file (run-as.user) or in command-line arguments (--user)' stderr
+      expect: 1
+      min-version: 7
+  - shell:
+      args: grep -c 'unable to get the user ID, check if user exist!!' stderr
+      expect: 1
+      version: 6