public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Zdenek Pytela <zpytela@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: Add a test phase for "/run equivalency status" check
Date: Fri, 11 Sep 2026 13:21:19 GMT	[thread overview]
Message-ID: <178913287915.1.8328304023854341571.tests-selinux-5994b16d6756@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-09-11 13:21 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=178913287915.1.8328304023854341571.tests-selinux-5994b16d6756@fedoraproject.org \
    --to=zpytela@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