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

Include test scenario scripts in timer_enabled template #10947

Merged

Conversation

marcusburghardt
Copy link
Member

Description:

This template is currently used by only two rules but didn't have test scenario scripts.
This PR introduces test scenarios scripts and removes similar tests from timer_dnf-automatic_enabled rule.

Rationale:

Easier to test changes in existing rules using this template.
Also easier to test eventual new rules which adopts this template.

Review Hints:

The CI tests for CS8 will probably fail with timer_logrotate_enabled rule and this is expected since rhel8 is not defined in prodtype.

@marcusburghardt marcusburghardt added the Test Suite Update in Test Suite. label Aug 3, 2023
@marcusburghardt marcusburghardt added this to the 0.1.70 milestone Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@codeclimate
Copy link

codeclimate bot commented Aug 3, 2023

Code Climate has analyzed commit 3d830ea 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 53.2% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Aug 7, 2023
Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[jcerny@fedora scap-security-guide{pr/10947}]$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9  --dontclean  timer_dnf-automatic_enabled
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2023-08-07-1152/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_timer_dnf-automatic_enabled
INFO - Script timer_enabled.pass.sh using profile (all) OK
INFO - Script timer_disabled.fail.sh using profile (all) OK
[jcerny@fedora scap-security-guide{pr/10947}]$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 --remediate-using ansible  --dontclean  timer_dnf-automatic_enabled
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2023-08-07-1333/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_timer_dnf-automatic_enabled
INFO - Script timer_disabled.fail.sh using profile (all) OK
INFO - Script timer_enabled.pass.sh using profile (all) OK

@jan-cerny jan-cerny merged commit c0e12f1 into ComplianceAsCode:master Aug 7, 2023
33 of 34 checks passed
@marcusburghardt marcusburghardt deleted the timer_enabled_tests branch August 7, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Suite Update in Test Suite.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants