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
Make test suite tests more accessible #6675
Conversation
Changes identified: Show detailsOthers: Recommended tests to execute: |
/test e2e-aws-rhcos4-moderate |
tests/test_rule_in_container.sh
Outdated
printf '\t%s\n' "<rule>: The short rule ID. Wildcards are supported." | ||
printf '\t%s\n' "-n, --name: Name of the test image (default: 'ssg_test_suite')" | ||
printf '\t%s\n' "-s, --scenarios: Regex to reduce selection of tested scenarios (default: '.*')" | ||
printf '\t%s\n' "-d, --datastream: Path to the datastream to use in tests. Autodetected by default. (no default)" | ||
printf '\t%s\n' "-r, --remediate-using: What to remediate with. Can be one of: 'oscap', 'bash' and 'ansible' (default: 'oscap')" | ||
printf '\t%s\n' "--dontclean, --no-dontclean: Dont remove HTML reports from the log directory. (off by default)" |
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.
🤪
Totally unsure what "off by default" means here. What is "no dontclean"?
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.
Off refers to the option, i.e. it means that --dontclean
is not considered by default. I agree that this double negative (don't + no) is unfortunate.
tests/test_rule_in_container.sh
Outdated
printf '\t%s\n' "<rule>: The short rule ID. Wildcards are supported." | ||
printf '\t%s\n' "-n, --name: Name of the test image (default: 'ssg_test_suite')" | ||
printf '\t%s\n' "-s, --scenarios: Regex to reduce selection of tested scenarios (default: '.*')" | ||
printf '\t%s\n' "-d, --datastream: Path to the datastream to use in tests. Autodetected by default. (no default)" | ||
printf '\t%s\n' "-r, --remediate-using: What to remediate with. Can be one of: 'oscap', 'bash' and 'ansible' (default: 'oscap')" | ||
printf '\t%s\n' "--dontclean, --no-dontclean: Dont remove HTML reports from the log directory. (off by default)" | ||
printf '\t%s\n' "--dry-run, --no-dry-run: Just print the test suite command-line. (off by default)" |
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.
This is similar but not so terrible. However, I really don't understand the purpose of --no-dry-run
. If I don't want to run a dry run I simply don't type --dry-run
.
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.
There is a theoretical possibility that you have command options stored in an array, but you want to override any prior --dry-run
that may or may not be there, and you would do that by adding --no-dry-run
to the array. But again, I agree that it is unfortunate.
@matejak I have a new problem: the command generated by the dry run option doesn't work for me.
|
I think it's because the |
- Fixed query for Bash fixes. - Support for empty remediations.
- Added support for --dontclean - Simplified the end-result command-line composition. - Enabled the --dry-run option
- Cleaned up an ancient merge conflict. - Added documentation about the package metadata.
- Removed -no-... command-line options - they don't make sense in this context. - Fixed the --scenario option - make the default value to the string, and make sure that the value is quoted in the dry run mode.
3cce56c
to
393f935
Compare
The PR introduces fixes to the test suite as well as to the container testing wrapper:
Fixed machine-only handling in the test suite.
Refreshed the container test wrapper.
--dontclean
--dry-run
option that prints the full test suite command-line.