Skip to content

Remove unreliable test scenarios#14703

Merged
Mab879 merged 1 commit into
ComplianceAsCode:masterfrom
jan-cerny:issue13778
May 11, 2026
Merged

Remove unreliable test scenarios#14703
Mab879 merged 1 commit into
ComplianceAsCode:masterfrom
jan-cerny:issue13778

Conversation

@jan-cerny
Copy link
Copy Markdown
Collaborator

@jan-cerny jan-cerny commented May 11, 2026

This commit removes 3 test scenarios. These scenarios create a violating file in /tmp. However, these rules should skip remote and special file system. That creates a problem that the evaluation result depends on whether /tmp on the target system is a partition on the disk or a tmpfs file system.

If the /tmp is a partition on the disk, OpenSCAP examines the files in the /tmp directory, the violating file in /tmp is detected and the rule fails as expected by the test scenarios.

If the /tmp is a tmpfs file system, OpenSCAP considers it a special file system, it skips it, doesn't examine the /tmp directory, therefore it doesn't detect the violating file in /tmp and rule result is pass, which isn't expected by test scenarios.

In general, we don't want test scenarios with variable behavior. Also, we don't have a way to control the expected test scenario result based on the target system properties. Therefore, we will remove the test scenarios.

Fixes: #13778

Review Hints:

Run /per-rule/oscap/from-env from Contest, add to test_vars this item: "RULE=file_permissions_ungroupowned no_files_unowned_by_user file_permissions_unauthorized_world_writable"

This commit removes 3 test scenarios.  These scenarios create a
violating file in `/tmp`.  However, these rules should skip remote and
special file system.  That creates a problem that the evaluation result
depends on whether `/tmp` on the target system is a partition on the
disk or a `tmpfs` file system.

If the `/tmp` is a partition on the disk, OpenSCAP examines the files in
the `/tmp` directory, the violating file in `/tmp` is detected and the
rule fails as expected by the test scenarios.

If the `/tmp` is a `tmpfs` file system, OpenSCAP considers it a special
file system, it skips it, doesn't examine the `/tmp` directory,
therefore it doesn't detect the violating file in `/tmp` and rule result
is pass, which isn't expected by test scenarios.

In general, we don't want test scenarios with variable behavior.  Also,
we don't have a way to control the expected test scenario result based
on the target system properties. Therefore, we will remove the test
scenarios.

Fixes: ComplianceAsCode#13778
@jan-cerny jan-cerny added this to the 0.1.81 milestone May 11, 2026
@jan-cerny jan-cerny added Test Suite Update in Test Suite. productization-issue Issue found in upstream stabilization process. labels May 11, 2026
@Mab879 Mab879 self-assigned this May 11, 2026
@Mab879 Mab879 merged commit 7a6f7e9 into ComplianceAsCode:master May 11, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

productization-issue Issue found in upstream stabilization process. Test Suite Update in Test Suite.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Various "unowned" rules have broken .fail.sh unit tests

2 participants