Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add a test for a bug 6278 v6 #1440

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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