public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Milos Malik <mmalik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: modify tests to cope with a missing selinux-policy-* packages
Date: Fri, 11 Sep 2026 13:22:54 GMT	[thread overview]
Message-ID: <178913297465.1.5312187441617851078.tests-selinux-7b73a19fe551@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 7b73a19fe551b2e028153c32f95c14839e015a01
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2025-06-09T16:24:18+02:00
            Stats  : +23/-8 in 8 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/7b73a19fe551b2e028153c32f95c14839e015a01?branch=pr775-checkpolicy-revdeps

            Log:
            modify tests to cope with a missing selinux-policy-* packages

Even though the tests require various selinux-policy-* packages,
some of packages may not be available on all platforms and
architectures. It can also happen that SELinux policy store is
installed in an unusual location. The tests should cope with both
situations.

---
diff --git a/checkpolicy/checkpolicy/runtest.sh b/checkpolicy/checkpolicy/runtest.sh
index 6f5a9ef..059454f 100755
--- a/checkpolicy/checkpolicy/runtest.sh
+++ b/checkpolicy/checkpolicy/runtest.sh
@@ -37,8 +37,7 @@ rlJournalStart
         if rlIsRHEL "<9" ; then
             rlAssertRpm selinux-policy-minimum
         fi
-        rlAssertRpm selinux-policy-mls
-        rlAssertRpm selinux-policy-targeted
+        rlRun "rpm -qa | grep selinux-policy"
         rlRun "rpm -qa | grep kernel"
         rlRun "uname -a"
         TEST_FILE=`mktemp`
@@ -120,7 +119,7 @@ rlJournalStart
             LIST="mls targeted"
         fi
         for POLICY_TYPE in $LIST ; do
-            if [ ! -e /etc/selinux/${POLICY_TYPE}/policy/policy.* ] ; then
+            if ! stat /etc/selinux/${POLICY_TYPE}/policy/policy.* >& /dev/null ; then
                 continue
             fi
             rlRun "echo -e 'q\n' | checkpolicy -Mdb /etc/selinux/${POLICY_TYPE}/policy/policy.* | tee ${OUTPUT_FILE}"
@@ -142,6 +141,10 @@ rlJournalStart
             LIST="mls targeted"
         fi
         for POLICY_TYPE in $LIST ; do
+            if ! stat /etc/selinux/${POLICY_TYPE}/policy/policy.* >& /dev/null ; then
+                rlLog "${POLICY_TYPE} policy file is not available, skipping"
+                continue
+            fi
             if rlIsRHEL 5 6 ; then
                 VERSIONS=`seq ${MIN_VERSION} 1 ${MAX_VERSION}`
             else

diff --git a/libselinux/container-selinux_crond/runtest.sh b/libselinux/container-selinux_crond/runtest.sh
index 74dde71..0963796 100755
--- a/libselinux/container-selinux_crond/runtest.sh
+++ b/libselinux/container-selinux_crond/runtest.sh
@@ -35,7 +35,7 @@ rlJournalStart
     rlPhaseStartSetup
         rlAssertRpm ${PACKAGE}
         rlAssertRpm cronie
-        rlAssertRpm container-selinux
+        rlRun "rpm -qa | grep -e container-selinux -e selinux-policy"
         rlRun "setenforce 1"
         rlRun "sestatus"
         OUTPUT_FILE=`mktemp`

diff --git a/policycoreutils/semanage-interface/runtest.sh b/policycoreutils/semanage-interface/runtest.sh
index 70dbbc7..ed99caf 100755
--- a/policycoreutils/semanage-interface/runtest.sh
+++ b/policycoreutils/semanage-interface/runtest.sh
@@ -34,6 +34,7 @@ PACKAGE="policycoreutils"
 rlJournalStart
     rlPhaseStartSetup
         rlAssertRpm ${PACKAGE}
+        rlRun "rpm -qa | grep selinux-policy"
     rlPhaseEnd
 
     rlPhaseStartTest
@@ -42,6 +43,9 @@ rlJournalStart
             if [ ! -d /etc/selinux/${POLICY_TYPE} ] ; then
                 continue
             fi
+            if ! stat /etc/selinux/${POLICY_TYPE}/policy/policy.* >& /dev/null ; then
+                continue
+            fi
             rlRun "semanage interface -l -S ${POLICY_TYPE}"
         done
         if ! rlIsRHEL 5; then

diff --git a/policycoreutils/semanage-login/runtest.sh b/policycoreutils/semanage-login/runtest.sh
index 97111d8..0986fc5 100755
--- a/policycoreutils/semanage-login/runtest.sh
+++ b/policycoreutils/semanage-login/runtest.sh
@@ -34,6 +34,7 @@ PACKAGE="policycoreutils"
 rlJournalStart
     rlPhaseStartSetup
         rlAssertRpm ${PACKAGE}
+        rlRun "rpm -qa | grep selinux-policy"
     rlPhaseEnd
 
     rlPhaseStartTest
@@ -42,6 +43,9 @@ rlJournalStart
             if [ ! -d /etc/selinux/${POLICY_TYPE} ] ; then
                 continue
             fi
+            if ! stat /etc/selinux/${POLICY_TYPE}/policy/policy.* >& /dev/null ; then
+                continue
+            fi
             rlRun "semanage login -l -S ${POLICY_TYPE}"
         done
         if ! rlIsRHEL 5; then

diff --git a/policycoreutils/semanage-user/runtest.sh b/policycoreutils/semanage-user/runtest.sh
index eb4035d..6326db6 100755
--- a/policycoreutils/semanage-user/runtest.sh
+++ b/policycoreutils/semanage-user/runtest.sh
@@ -34,6 +34,7 @@ PACKAGE="policycoreutils"
 rlJournalStart
     rlPhaseStartSetup
         rlAssertRpm ${PACKAGE}
+        rlRun "rpm -qa | grep selinux-policy"
         rlRun "make -f /usr/share/selinux/devel/Makefile"
         rlRun "ls -l testpolicy.pp"
     rlPhaseEnd
@@ -50,6 +51,9 @@ rlJournalStart
             if [ ! -d /etc/selinux/${POLICY_TYPE} ] ; then
                 continue
             fi
+            if ! stat /etc/selinux/${POLICY_TYPE}/policy/policy.* >& /dev/null ; then
+                continue
+            fi
             rlRun "semanage user -l -S ${POLICY_TYPE}"
         done
         if ! rlIsRHEL 5; then

diff --git a/selinux-policy/libvirt-dbus-and-similar/runtest.sh b/selinux-policy/libvirt-dbus-and-similar/runtest.sh
index 7a87688..d6907cb 100755
--- a/selinux-policy/libvirt-dbus-and-similar/runtest.sh
+++ b/selinux-policy/libvirt-dbus-and-similar/runtest.sh
@@ -52,7 +52,7 @@ rlJournalStart
         rlAssertRpm ${SERVICE_PACKAGE}
 
         rlServiceStop ${SERVICE_NAME}
-        rlRun "yum -y install libvirt\* --skip-broken"
+        rlRun "yum -y install libvirt\* --skip-broken -x \*i686\* -x glibc32"
 
         rlSESetEnforce
         rlSEStatus

diff --git a/selinux-policy/rngd-and-similar/main.fmf b/selinux-policy/rngd-and-similar/main.fmf
index f2a2dd0..acda722 100644
--- a/selinux-policy/rngd-and-similar/main.fmf
+++ b/selinux-policy/rngd-and-similar/main.fmf
@@ -69,7 +69,7 @@ adjust:
     when: distro == rhel-4, rhel-5, rhel-6
     continue: false
   - enabled: false
-    when: arch == s390x
+    when: arch == aarch64, s390x
     continue: false
 extra-nitrate: TC#0300433
 extra-summary: /CoreOS/selinux-policy/Regression/rngd-and-similar

diff --git a/selinux-policy/stalld-and-similar/runtest.sh b/selinux-policy/stalld-and-similar/runtest.sh
index 95e02ce..4f712cb 100755
--- a/selinux-policy/stalld-and-similar/runtest.sh
+++ b/selinux-policy/stalld-and-similar/runtest.sh
@@ -111,7 +111,7 @@ rlJournalStart
         rlRun "grep ^AGGR= /etc/sysconfig/stalld"
         rlRun "sed -i 's/^AGGR=.*$/AGGR=\"--backend queue_track\"/' /etc/sysconfig/stalld"
         rlRun "grep ^AGGR= /etc/sysconfig/stalld"
-        rlSEService - ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "start status stop status" 5
+        rlSEService - ${SERVICE_NAME} - ${PROCESS_CONTEXT} "start status stop status" 5
         rlRun "sed -i 's/^AGGR=.*$/AGGR=/' /etc/sysconfig/stalld"
         rlRun "grep ^AGGR= /etc/sysconfig/stalld"
     rlPhaseEnd
@@ -129,7 +129,7 @@ rlJournalStart
         rlRun "journalctl -u ${SERVICE_NAME} > after.txt"
         rlRun "setsebool domain_can_write_kmsg on"
         rlSEService - ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "restart status" 1
-        rlRun "restorecon -Rv /run /var -e /var/ARTIFACTS" 0-255
+        rlRun "restorecon -Rv /etc /run /var -e /var/ARTIFACTS" 0-255
         rlSEService - ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "stop status" 1
         rlRun "setsebool domain_can_write_kmsg off"
         rlRun "diff before.txt after.txt | grep -i -e 'operation not permitted' -e 'permission denied'" 1

                 reply	other threads:[~2026-09-11 13:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178913297465.1.5312187441617851078.tests-selinux-7b73a19fe551@fedoraproject.org \
    --to=mmalik@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox