public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: recognize the new virt* policy and adapt checks
@ 2026-09-11 13:21 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 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 : a915243c7dd88afbf10e5204e609b07bfecf2c77
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2024-07-30T16:05:32+02:00
            Stats  : +23/-6 in 3 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/a915243c7dd88afbf10e5204e609b07bfecf2c77?branch=pr775-checkpolicy-revdeps

            Log:
            recognize the new virt* policy and adapt checks

Instead of checking Fedora or CentOS or RHEL version, the decision
to adapt should be made according to the defined SELinux policy types
or attributes.

The TC also covers RHEL-40834.

---
diff --git a/selinux-policy/virtualization-daemons/Makefile b/selinux-policy/virtualization-daemons/Makefile
index 2a0aa27..5aaf556 100644
--- a/selinux-policy/virtualization-daemons/Makefile
+++ b/selinux-policy/virtualization-daemons/Makefile
@@ -64,6 +64,7 @@ $(METADATA): Makefile
 	@echo "Destructive:     no" >> $(METADATA)
 	@echo "Releases:        -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA)
 	@echo "Bug:             2291273" >> $(METADATA) # Fedora 41
+	@echo "Bug:             RHEL-40834" >> $(METADATA) # RHEL-10
 
 	rhts-lint $(METADATA)
 

diff --git a/selinux-policy/virtualization-daemons/main.fmf b/selinux-policy/virtualization-daemons/main.fmf
index 3df3ce2..eb1c349 100644
--- a/selinux-policy/virtualization-daemons/main.fmf
+++ b/selinux-policy/virtualization-daemons/main.fmf
@@ -37,6 +37,7 @@ duration: 15m
 enabled: true
 link:
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2291273
+  - verifies: https://issues.redhat.com/browse/RHEL-40834
 tag:
   - NoRHEL4
   - NoRHEL5
@@ -47,7 +48,11 @@ tag:
   - failinfedora
   - NoRHIVOS
 adjust:
--  enabled: false
-   when: distro < rhel-9
-   because: the virtualization daemons are not available there
-
+  - enabled: false
+    when: distro < centos-stream-9
+    because: the virtualization daemons are not available there
+  - enabled: false
+    when: distro < rhel-9
+    because: the virtualization daemons are not available there
+extra-nitrate: TC#0617680
+id: 1f7a8a37-7977-4ee0-8b8a-979c03aff369

diff --git a/selinux-policy/virtualization-daemons/runtest.sh b/selinux-policy/virtualization-daemons/runtest.sh
index f132fdf..32f85be 100755
--- a/selinux-policy/virtualization-daemons/runtest.sh
+++ b/selinux-policy/virtualization-daemons/runtest.sh
@@ -63,6 +63,16 @@ ALL_TUPLES="libvirtd:libvirtd:virtd_t \
             virtvboxd:virtvboxd:virtd_t"
 #            virtxend:virtxend:virtd_t
 fi
+INSTALL_OPTION=""
+if yum --help | grep -q use-host-config ; then
+    INSTALL_OPTION="${INSTALL_OPTION} --use-host-config"
+fi
+if yum install --help | grep -q skip-broken ; then
+    INSTALL_OPTION="${INSTALL_OPTION} --skip-broken"
+fi
+if yum install --help | grep -q skip-unavailable ; then
+    INSTALL_OPTION="${INSTALL_OPTION} --skip-unavailable"
+fi
 
 rlJournalStart
     rlPhaseStartSetup
@@ -74,6 +84,7 @@ rlJournalStart
 
         rlServiceStop ${SERVICE_NAMES}
         rlFileBackup /etc/shadow
+        rlRun "yum -y install libvirt\* -x \*devel ${INSTALL_OPTION}" 0-255
 
         rlSESetEnforce
         rlSEStatus
@@ -82,7 +93,7 @@ rlJournalStart
     rlPhaseEnd
 
     rlPhaseStartTest "SELinux contexts and rules"
-      if rlIsFedora ">39"; then
+      if seinfo -a | grep -q virt_driver_domain ; then
         rlSEMatchPathCon "/usr/sbin/virtinterfaced" "virtinterfaced_exec_t"
         rlSEMatchPathCon "/usr/sbin/virtlxcd" "virtd_lxc_exec_t"
         rlSEMatchPathCon "/usr/sbin/virtnetworkd" "virtnetworkd_exec_t"
@@ -143,7 +154,7 @@ rlJournalStart
     rlPhaseEnd
 
     if seinfo -a | grep -q virt_driver_domain ; then
-    rlPhaseStartTest "bz#2291273"
+    rlPhaseStartTest "bz#2291273 + RHEL-40834"
         rlSESearchRule "allow virtnetworkd_t unconfined_t : dir { search } [ ]"
         rlSESearchRule "allow virtnetworkd_t unconfined_t : file { open read } [ ]"
         rlSESearchRule "allow virtnodedevd_t unconfined_t : dir { search } [ ]"

^ 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: recognize the new virt* policy and adapt checks Milos Malik

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