public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: Add a test phase for "/run equivalency status" check
@ 2026-09-11 13:21 Zdenek Pytela
  0 siblings, 0 replies; only message in thread
From: Zdenek Pytela @ 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 : 5994b16d675642ede640ca0a6b8839dcb1a0be52
            Author : Zdenek Pytela <zpytela@redhat.com>
            Date   : 2024-01-19T14:29:52+00:00
            Stats  : +19/-0 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/5994b16d675642ede640ca0a6b8839dcb1a0be52?branch=pr775-checkpolicy-revdeps

            Log:
            Add a test phase for "/run equivalency status" check

Check which equivalency is in place and if there are incompatible
entries.

---
diff --git a/selinux-policy/install-uninstall-dsp-packages/runtest.sh b/selinux-policy/install-uninstall-dsp-packages/runtest.sh
index 0ebf0d9..b251ff3 100755
--- a/selinux-policy/install-uninstall-dsp-packages/runtest.sh
+++ b/selinux-policy/install-uninstall-dsp-packages/runtest.sh
@@ -34,6 +34,8 @@ PACKAGE="selinux-policy"
 SKIP_REMOVAL=${SKIP_REMOVAL:-""}
 SKIP_INSTALL=${SKIP_INSTALL:-""}
 INSTALL_ONLY=${INSTALL_ONLY:-""}
+FCONTEXT_LIST="/tmp/semanage-fcontext"
+FCONTEXT_LIST_VARRUN="/tmp/semanage-fcontext-varrun"
 
 # Function to create a report template for install test
 function install_report() {
@@ -127,6 +129,23 @@ rlJournalStart
         echo "" >> pkglist.report
     rlPhaseEnd
 
+    ### Checks performed with all dsp packages installed
+    ### Status of /run and /var/run equivalency
+    rlPhaseStartTest "Check /run equivalency status"
+	rlRun "semanage fcontext -l > ${FCONTEXT_LIST}"
+	if grep -q "/run = /var/run" ${FCONTEXT_LIST}; then
+	    echo "Warning: Legacy equivalency settings \"/run = /var/run\" are in place."
+	elif grep -q "/var/run = /run" ${FCONTEXT_LIST}; then
+	    echo "New equivalency settings /\"var/run = /run\" are in place."
+	    if grep -q "^/var/run" ${FCONTEXT_LIST}; then
+		rlLog "Warning: /var/run entries found in the file context database"
+		rlRun "sed '/^\/var\/run/!d; s|[ \t].*$||' ${FCONTEXT_LIST} | uniq > ${FCONTEXT_LIST_VARRUN}"
+	    fi
+	else echo "Unknown or none /run equivalency settings."
+	fi
+	rm -f ${FCONTEXT_LIST} ${FCONTEXT_LIST_VARRUN}
+    rlPhaseEnd
+
     rlPhaseStartTest "Uninstall test for dsp packages"
         rlRun "uninstall_report"
         # Following loop will read each package from file install-pkgs

^ 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: Add a test phase for "/run equivalency status" check Zdenek Pytela

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