test: automation for 5 selinux testcases#460
Conversation
shreyataware
commented
May 15, 2026
- Check Getenforce
- Toggle between Enforcing & Permissive using setenforce cmd
- Check sestatus
- Collect AVC Denials
- Capture systemctl failed services
smuppand
left a comment
There was a problem hiding this comment.
Thanks for adding SELinux validation coverage. The scope is useful and fits under Kernel/Security: getenforce, sestatus, setenforce toggling, AVC denial collection, and failed-service comparison.
please address a few architecture-level concerns below along with fixing the failed workflows.
-
For tests that call setenforce, capture the original SELinux mode before changing it and restore it on every exit path using trap cleanup. The DUT must not be left in a different SELinux mode after the test.
-
Please ensure all scripts reuse existing Runner/utils helpers for logging, dependency checks, result handling, and common setup instead of duplicating logic across the five new run.sh files.
-
Please define clear PASS/FAIL/SKIP semantics for unsupported environments, especially when getenforce, setenforce, sestatus, audit logs, or systemctl are not available.
-
For SystemctlFailedPerVsEnf, please log the failed-service snapshot before and after each SELinux mode transition, and restore the original mode at the end.
-
Please share runtime evidence from target/LAVA execution for all five suites.
-
Please add Readme files for each test
Commit-wise, this can remain one PR because all tests are SELinux/security related, but I recommend splitting into logical commits:
- SELinux status checks
- SELinux mode transition test
- SELinux diagnostics / AVC / failed-service comparison
Current commit message is understandable but generic. Suggested message:
test(security): add SELinux validation suites