-
Notifications
You must be signed in to change notification settings - Fork 685
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
fix loops within ansible template for rsyslog_files #10349
fix loops within ansible template for rsyslog_files #10349
Conversation
- get rid of map functions also previous implementation did not account for the fact that variable created in loops have results stored in ".results" data structure
Code Climate has analyzed commit 48c3b99 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 51.8% (0.0% change). View more on Code Climate. |
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.
I was able to reproduce the issue #10170 in a RHEL 7.9 machine with the 20230228.1 compose - both the host and the guest are the same RHEL 7.9 version.
[root@cisco-c210-01 content]# python3 tests/automatus.py rule --libvirt qemu:///system test_suite_vm --remediate-using ansible rsyslog_files_groupownership
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /root/content/logs/rule-custom-2023-03-24-0400/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_rsyslog_files_groupownership
INFO - Script rainer_include_incorrect_attr.fail.sh using profile (all) OK
ERROR - Rule evaluation resulted in fail, instead of expected pass during final stage
ERROR - The check after remediation failed for rule 'xccdf_org.ssgproject.content_rule_rsyslog_files_groupownership'.
INFO - Script rainer_include_correct_attr.pass.sh using profile (all) OK
INFO - Script legacy_include_incorrect_attr.fail.sh using profile (all) OK
ERROR - Rule evaluation resulted in fail, instead of expected pass during final stage
ERROR - The check after remediation failed for rule 'xccdf_org.ssgproject.content_rule_rsyslog_files_groupownership'.
INFO - Script rainer_include_multiline_incorrect_attr.fail.sh using profile (all) OK
ERROR - Rule evaluation resulted in fail, instead of expected pass during final stage
ERROR - The check after remediation failed for rule 'xccdf_org.ssgproject.content_rule_rsyslog_files_groupownership'.
INFO - Script legacy_correct_attr.pass.sh using profile (all) OK
INFO - Script mixed_incorrect_attr_rainer.fail.sh using profile (all) OK
INFO - Script mixed_correct_attr.pass.sh using profile (all) OK
INFO - Script mixed_incorrect_attr_cloudinit.fail.sh using profile (all) OK
INFO - Script mixed_include_incorrect_attr_legacy.fail.sh using profile (all) OK
ERROR - Rule evaluation resulted in fail, instead of expected pass during final stage
ERROR - The check after remediation failed for rule 'xccdf_org.ssgproject.content_rule_rsyslog_files_groupownership'.
INFO - Script mixed_incorrect_attr_legacy.fail.sh using profile (all) OK
INFO - Script rainer_include_multiline_correct_attr.pass.sh using profile (all) OK
INFO - Script mixed_include_incorrect_attr_rainer.fail.sh using profile (all) OK
ERROR - Rule evaluation resulted in fail, instead of expected pass during final stage
ERROR - The check after remediation failed for rule 'xccdf_org.ssgproject.content_rule_rsyslog_files_groupownership'.
INFO - Script mixed_include_correct_attr.pass.sh using profile (all) OK
INFO - Script legacy_incorrect_attr.fail.sh using profile (all) OK
INFO - Script legacy_include_correct_attr.pass.sh using profile (all) OK
INFO - Script rainer_correct_attr.pass.sh using profile (all) OK
INFO - Script rainer_incorrect_attr.fail.sh using profile (all) OK
I can confirm that with this PR the test fails are fixed and they all pass:
[root@cisco-c210-01 content]# python3 tests/automatus.py rule --libvirt qemu:///system test_suite_vm --remediate-using ansible rsyslog_files_groupownership
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /root/content/logs/rule-custom-2023-03-24-0438/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_rsyslog_files_groupownership
INFO - Script mixed_incorrect_attr_rainer.fail.sh using profile (all) OK
INFO - Script legacy_incorrect_attr.fail.sh using profile (all) OK
INFO - Script rainer_incorrect_attr.fail.sh using profile (all) OK
INFO - Script mixed_include_correct_attr.pass.sh using profile (all) OK
INFO - Script legacy_include_correct_attr.pass.sh using profile (all) OK
INFO - Script legacy_correct_attr.pass.sh using profile (all) OK
INFO - Script mixed_include_incorrect_attr_legacy.fail.sh using profile (all) OK
INFO - Script mixed_include_incorrect_attr_rainer.fail.sh using profile (all) OK
INFO - Script rainer_include_correct_attr.pass.sh using profile (all) OK
INFO - Script rainer_include_multiline_incorrect_attr.fail.sh using profile (all) OK
INFO - Script rainer_include_incorrect_attr.fail.sh using profile (all) OK
INFO - Script mixed_incorrect_attr_legacy.fail.sh using profile (all) OK
INFO - Script rainer_correct_attr.pass.sh using profile (all) OK
INFO - Script legacy_include_incorrect_attr.fail.sh using profile (all) OK
INFO - Script rainer_include_multiline_correct_attr.pass.sh using profile (all) OK
INFO - Script mixed_correct_attr.pass.sh using profile (all) OK
INFO - Script mixed_incorrect_attr_cloudinit.fail.sh using profile (all) OK
Description:
Rationale:
Review Hints:
see the issue fixed by this PR