public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: pcp-daemons: Fix upstream failures
@ 2026-09-11 13:18 Amith Kumar
  0 siblings, 0 replies; only message in thread
From: Amith Kumar @ 2026-09-11 13:18 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 7b3df8350d1fb6a423b7dc84fb63354724491fa2
            Author : Amith Kumar <apeetham@redhat.com>
            Date   : 2021-02-12T09:26:18+01:00
            Stats  : +25/-9 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/7b3df8350d1fb6a423b7dc84fb63354724491fa2?branch=pr775-checkpolicy-revdeps

            Log:
            pcp-daemons: Fix upstream failures

One of the testcase failed due to absence of chkconfig and initrc
related files. Make existing code compatible with higher versions of
Fedora and fix the failures.

Signed-off-by: Amith Kumar <apeetham@redhat.com>

---
diff --git a/selinux-policy/pcp-daemons-and-similar/runtest.sh b/selinux-policy/pcp-daemons-and-similar/runtest.sh
index 0b8321c..9103fda 100755
--- a/selinux-policy/pcp-daemons-and-similar/runtest.sh
+++ b/selinux-policy/pcp-daemons-and-similar/runtest.sh
@@ -394,12 +394,20 @@ rlJournalStart
         rlRun "semodule -l | grep pcp"
         rlRun "echo ${ROOT_PASSWORD} | passwd --stdin root"
         for SERVICE_NAME in pmcd pmie pmlogger pmproxy ; do
-            rlRun "chkconfig ${SERVICE_NAME} on"
+            if rlIsFedora '>=33' || rlIsRHEL ">=8.1" ; then
+                rlRun "systemctl enable ${SERVICE_NAME}"
+            else
+                rlRun "chkconfig ${SERVICE_NAME} on"
+            fi
         done
         for TRIPLET in ${TRIPLETSLIST} ; do
-            if ! rlSEDefined "${SEDEFINED}" ; then
-                # for RHELs where the SELinux domain does not exist yet
-                PROCESS_CONTEXT="initrc_t"
+            if rlIsFedora '<33' || rlIsRHEL "<8" ; then
+                if ! rlSEDefined "${SEDEFINED}" ; then
+                    # for RHELs where the SELinux domain does not exist yet
+                    PROCESS_CONTEXT="initrc_t"
+                else
+                   PROCESS_CONTEXT=`echo ${TRIPLET} | cut -d : -f 3`
+                fi
             else
                 PROCESS_CONTEXT=`echo ${TRIPLET} | cut -d : -f 3`
             fi
@@ -411,11 +419,15 @@ rlJournalStart
             rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "start status restart status" 1
         done
         for TRIPLET in ${TRIPLETSLIST} ; do
-            if ! rlSEDefined "${SEDEFINED}" ; then
-                # for RHELs where the SELinux domain does not exist yet
-                PROCESS_CONTEXT="initrc_t"
+            if rlIsFedora '<33' || rlIsRHEL "<8" ; then
+                if ! rlSEDefined "${SEDEFINED}" ; then
+                    # for RHELs where the SELinux domain does not exist yet
+                    PROCESS_CONTEXT="initrc_t"             
+                else
+                    PROCESS_CONTEXT=`echo ${TRIPLET} | cut -d : -f 3`
+                fi
             else
-                PROCESS_CONTEXT=`echo ${TRIPLET} | cut -d : -f 3`
+		PROCESS_CONTEXT=`echo ${TRIPLET} | cut -d : -f 3`
             fi
             PROCESS_NAME=`echo ${TRIPLET} | cut -d : -f 4`
             SERVICE_NAME=${PROCESS_NAME}
@@ -425,7 +437,11 @@ rlJournalStart
             rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "stop" 1
         done
         for SERVICE_NAME in pmcd pmie pmlogger pmproxy ; do
-            rlRun "chkconfig ${SERVICE_NAME} off"
+            if rlIsFedora '>=33' || rlIsRHEL ">=8.1" ; then
+                rlRun "systemctl disable ${SERVICE_NAME}"
+            else
+                rlRun "chkconfig ${SERVICE_NAME} off"
+            fi
         done
     rlPhaseEnd
 

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

only message in thread, other threads:[~2026-09-11 13:18 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:18 [tests/selinux] pr775-checkpolicy-revdeps: pcp-daemons: Fix upstream failures Amith Kumar

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