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: recognize the new virt* policy and adapt checks
Date: Fri, 11 Sep 2026 13:21:52 GMT	[thread overview]
Message-ID: <178913291203.1.2680825665722474219.tests-selinux-a915243c7dd8@fedoraproject.org> (raw)

            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 } [ ]"

                 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=178913291203.1.2680825665722474219.tests-selinux-a915243c7dd8@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