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: do not test virt* services which are not present
Date: Fri, 11 Sep 2026 13:20:43 GMT	[thread overview]
Message-ID: <178913284335.1.4002384675841820713.tests-selinux-b1ff61821115@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : b1ff618211156c65c4360e8a3083dba99a50d15e
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2023-05-31T18:45:01+02:00
            Stats  : +11/-5 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/b1ff618211156c65c4360e8a3083dba99a50d15e?branch=pr775-checkpolicy-revdeps

            Log:
            do not test virt* services which are not present

The automated test fails during its execution because not all virt*
services are always present.

---
diff --git a/selinux-policy/virtualization-daemons/Makefile b/selinux-policy/virtualization-daemons/Makefile
index 48867c8..ffe4846 100644
--- a/selinux-policy/virtualization-daemons/Makefile
+++ b/selinux-policy/virtualization-daemons/Makefile
@@ -55,7 +55,7 @@ $(METADATA): Makefile
 	@echo "TestTime:        15m" >> $(METADATA)
 	@echo "RunFor:          libvirt" >> $(METADATA)
 	@echo "RunFor:          selinux-policy" >> $(METADATA)
-	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console initscripts libvirt-daemon libvirt-client libvirt-daemon-driver-interface libvirt-daemon-driver-libxl libvirt-daemon-driver-lxc libvirt-daemon-driver-network libvirt-daemon-driver-nodedev libvirt-daemon-driver-nwfilter libvirt-daemon-driver-qemu libvirt-daemon-driver-secret libvirt-daemon-driver-storage-core libvirt-daemon-driver-vbox">> $(METADATA)
+	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console /usr/sbin/service libvirt-daemon libvirt-client libvirt-daemon-driver-interface libvirt-daemon-driver-libxl libvirt-daemon-driver-lxc libvirt-daemon-driver-network libvirt-daemon-driver-nodedev libvirt-daemon-driver-nwfilter libvirt-daemon-driver-qemu libvirt-daemon-driver-secret libvirt-daemon-driver-storage-core libvirt-daemon-driver-vbox">> $(METADATA)
 	@echo "RhtsRequires:    library(selinux-policy/common)" >> $(METADATA)
 	@echo "Environment:     AVC_ERROR=+no_avc_check" >> $(METADATA)
 	@echo "Priority:        Normal" >> $(METADATA)

diff --git a/selinux-policy/virtualization-daemons/runtest.sh b/selinux-policy/virtualization-daemons/runtest.sh
index 9df58e5..3ac205f 100755
--- a/selinux-policy/virtualization-daemons/runtest.sh
+++ b/selinux-policy/virtualization-daemons/runtest.sh
@@ -89,22 +89,28 @@ rlJournalStart
             SERVICE_NAME=`echo ${TUPLE} | cut -d : -f 1`
             PROCESS_NAME=`echo ${TUPLE} | cut -d : -f 2`
             PROCESS_CONTEXT=`echo ${TUPLE} | cut -d : -f 3`
-            rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "start status" 1
+            if [ -f /usr/lib/systemd/system/${SERVICE_NAME}.service ] ; then
+                rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "start status" 1
+            fi
         done
-        rlRun "restorecon -Rv /etc /run /var"
+        rlRun "restorecon -Rv /etc /run /var -e /var/ARTIFACTS" 0-255
         # restart all the services
         for TUPLE in ${ALL_TUPLES} ; do
             SERVICE_NAME=`echo ${TUPLE} | cut -d : -f 1`
             PROCESS_NAME=`echo ${TUPLE} | cut -d : -f 2`
             PROCESS_CONTEXT=`echo ${TUPLE} | cut -d : -f 3`
-            rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "restart status" 1
+            if [ -f /usr/lib/systemd/system/${SERVICE_NAME}.service ] ; then
+                rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "restart status" 1
+            fi
         done
         # stop all the services
         for TUPLE in ${ALL_TUPLES} ; do
             SERVICE_NAME=`echo ${TUPLE} | cut -d : -f 1`
             PROCESS_NAME=`echo ${TUPLE} | cut -d : -f 2`
             PROCESS_CONTEXT=`echo ${TUPLE} | cut -d : -f 3`
-            rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "stop status" 1
+            if [ -f /usr/lib/systemd/system/${SERVICE_NAME}.service ] ; then
+                rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "stop status" 1
+            fi
         done
     rlPhaseEnd
 

                 reply	other threads:[~2026-09-11 13:20 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=178913284335.1.4002384675841820713.tests-selinux-b1ff61821115@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