public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: test the actions recognized by sedismod and sedispol
@ 2026-09-11 13:21 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:21 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : ef67d0deea003d009673bd22fe0b8f7a7999f53a
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2023-11-23T19:25:59+00:00
            Stats  : +24/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/ef67d0deea003d009673bd22fe0b8f7a7999f53a?branch=pr775-checkpolicy-revdeps

            Log:
            test the actions recognized by sedismod and sedispol

Since SELinux user-space 3.6 was introduced, the sedismod and sedispol
programs are able to perform various actions non-interactively when
the following options are supplied: -a, --actions. In previous versions,
these actions were only usable in the interactive mode.
From now on, the automated test also covers these options.

---
diff --git a/checkpolicy/sedismod/runtest.sh b/checkpolicy/sedismod/runtest.sh
index c15b882..8227ccb 100755
--- a/checkpolicy/sedismod/runtest.sh
+++ b/checkpolicy/sedismod/runtest.sh
@@ -74,6 +74,18 @@ rlJournalStart
         done
     rlPhaseEnd
 
+    if sedismod --help | grep -q actions ; then
+    rlPhaseStartTest "test the non-interactive actions"
+        rlLog "introduced in version 3.6"
+        for ACTION in 1 2 3 4 5 6 7 8 9 0 a b c u F v ; do
+            rlRun "sedismod -a ${ACTION} ${POLICY_FILE} > ${ACTION}.txt"
+            rlRun "ls -l ${ACTION}.txt"
+            rlRun "test -s ${ACTION}.txt"
+            rlRun "rm -f ${ACTION}.txt"
+        done
+    rlPhaseEnd
+    fi
+
     rlPhaseStartCleanup
         rlRun "rm -f ${OUTPUT_FILE} ${POLICY_FILE}"
     rlPhaseEnd

diff --git a/checkpolicy/sedispol/runtest.sh b/checkpolicy/sedispol/runtest.sh
index 3a182e1..ac198ff 100755
--- a/checkpolicy/sedispol/runtest.sh
+++ b/checkpolicy/sedispol/runtest.sh
@@ -68,6 +68,18 @@ rlJournalStart
         rlRun "grep permisions ${OUTPUT_FILE}" 1
     rlPhaseEnd
 
+    if sedispol --help | grep -q actions ; then
+    rlPhaseStartTest "test the non-interactive actions"
+        rlLog "introduced in version 3.6"
+        for ACTION in 1 2 3 4 5 6 8 c b C r t a p u F ; do
+            rlRun "sedispol -a ${ACTION} ${POLICY_FILE} > ${ACTION}.txt"
+            rlRun "ls -l ${ACTION}.txt"
+            rlRun "test -s ${ACTION}.txt"
+            rlRun "rm -f ${ACTION}.txt"
+        done
+    rlPhaseEnd
+    fi
+
     rlPhaseStartCleanup
         rlRun "rm -f ${OUTPUT_FILE}"
     rlPhaseEnd

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-11 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:21 [tests/selinux] pr775-checkpolicy-revdeps: test the actions recognized by sedismod and sedispol Milos Malik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox