8000 package_sudo_installed: limit test scenarios by vojtapolasek · Pull Request #13380 · ComplianceAsCode/content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

package_sudo_installed: limit test scenarios #13380

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

Conversation

vojtapolasek
Copy link
Collaborator

Description:

  • add one custom scenario which fakes package removel
  • allow only package_insallted.pass.sh templated scenario
  • skip other test scenarios because they will render the test environment unusable

Rationale:

  • do not execute test scenarios which render the test environment unusable

Review Hints:

  • use Automatus.

@vojtapolasek vojtapolasek added the Test Suite Update in Test Suite. label Apr 23, 2025
@vojtapolasek vojtapolasek added this to the 0.1.77 milestone Apr 23, 2025
Copy link
codeclimate bot commented Apr 23, 2025

Code Climate has analyzed commit 877ab9d 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 61.9% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Apr 23, 2025
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.

With these changes the tests pass locally on RHEL 9

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-2025-04-23-1357-1/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_package_sudo_installed
INFO - Script package-installed.pass.sh using profile (all) OK
INFO - Script custom-package-removed.fail.sh using profile (all) OK
jcerny@fedora:~/work/git/scap-security-guide (pr/13380)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 --remediate-using ansible package_sudo_installed
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-2025-04-23-1358/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_package_sudo_installed
INFO - Script package-installed.pass.sh using profile (all) OK
INFO - Script custom-
A2C0
package-removed.fail.sh using profile (all) OK

@jan-cerny jan-cerny merged commit 6309eb2 into ComplianceAsCode:master Apr 23, 2025
106 of 110 checks passed
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.

2 participants
0