-
Notifications
You must be signed in to change notification settings - Fork 90
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 missing runmode v2 #1442
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Suricata Missing Runmode Issue | ||
|
||
This directory contains test files and documentation for addressing the "Missing runmode" issue 5711 in Suricata. | ||
|
||
## Issue Description | ||
|
||
The issue relates to Suricata not providing adequate feedback when the runmode is missing, leading to confusion for users. | ||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: unneeded whitespace |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%YAML 1.1 | ||
--- | ||
|
||
runmodes: | ||
- workers: | ||
enabled: yes | ||
|
||
|
||
|
||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: unneeded whitespace |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
requires: | ||
min-version: 7 | ||
pcap: false | ||
|
||
exit-code: 1 | ||
args: | ||
- --dump-config | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed for the test, it was an example given by Juliana. The args should be just like mentioned in the redmine ticket. |
||
|
||
checks: | ||
- shell: | ||
args: suricata -S /dev/null | ||
expect: 1 | ||
Comment on lines
+9
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this test. Could you please explain what were you trying to do here?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Okay, I actually included this test to check whether Suricata behaves correctly when a specific run mode is missing. To do that, I ran Suricata with the '-S /dev/null' argument, which simulates the absence of the 'capture' run mode. I expected Suricata to return an error code (1) in this scenario, indicating that the run mode is missing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for going through your thought process :) So, as I mentioned on the previous review, you don't have to invoke shell to run suricata in Suricata-verify tests. So, whatever arguments you want to pass for this test to run suricata with, those would passed in that For the expected exit code, and how to check for an error message from the output - in case you don't want to check log outputs, you can check this test: https://github.com/OISF/suricata-verify/blob/master/tests/detect-strip_whitespace-01/test.yaml#L5C1-L5C1 Not that right above the first I hope this helps you move forward with this contribution! :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, thanks. It helps |
||
|
||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: unneeded whitespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please add redmine ticket link here