Skip to content

Commit

Permalink
tests: add a test for a bug 6278
Browse files Browse the repository at this point in the history
tests include:
  - non-existent user
  - NULL user (empty user string)
  • Loading branch information
Lukas Sismis authored and victorjulien committed Nov 2, 2023
1 parent ca20b9f commit b592bfc
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/bug-6278-1/README.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions tests/bug-6278-1/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
%YAML 1.1
---

run-as:
user: totally-not-existing-user
12 changes: 12 additions & 0 deletions tests/bug-6278-1/test.yaml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions tests/bug-6278-2/README.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions tests/bug-6278-2/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
%YAML 1.1
---

run-as:
user: # null user
group:
17 changes: 17 additions & 0 deletions tests/bug-6278-2/test.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b592bfc

Please sign in to comment.