public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: update relevancy of 3 tests
@ 2026-09-11 13:20 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:20 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 475669fa18b28b7e544d0253f4b6e3e558c92621
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2023-09-01T06:25:25+00:00
            Stats  : +19/-8 in 7 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/475669fa18b28b7e544d0253f4b6e3e558c92621?branch=pr775-checkpolicy-revdeps

            Log:
            update relevancy of 3 tests

The following tests were failing on RHEL-9 because some of their
test phases were executed even if they were not relevant:
 * selinux-policy/bootupd-and-similar
 * selinux-policy/bz562833-chrooted-named-file-contexts
 * selinux-policy/systemd-machined-and-similar

The issues should be fixed now.

---
diff --git a/selinux-policy/bootupd-and-similar/Makefile b/selinux-policy/bootupd-and-similar/Makefile
index d83b326..f23235f 100644
--- a/selinux-policy/bootupd-and-similar/Makefile
+++ b/selinux-policy/bootupd-and-similar/Makefile
@@ -61,7 +61,7 @@ $(METADATA): Makefile
 	@echo "License:         GPLv2" >> $(METADATA)
 	@echo "Confidential:    no" >> $(METADATA)
 	@echo "Destructive:     no" >> $(METADATA)
-	@echo "Releases:        -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA)
+	@echo "Releases:        -RHEL4 -RHEL5 -RHEL6 -RHEL7 -RHEL8" >> $(METADATA)
 	@echo "Bug:             2029478" >> $(METADATA) # RHEL-9
 	@echo "Bug:             2044508" >> $(METADATA) # RHEL-9
 	@echo "Bug:             2218106" >> $(METADATA) # Fedora rawhide

diff --git a/selinux-policy/bootupd-and-similar/main.fmf b/selinux-policy/bootupd-and-similar/main.fmf
index d7b2163..57e85bf 100644
--- a/selinux-policy/bootupd-and-similar/main.fmf
+++ b/selinux-policy/bootupd-and-similar/main.fmf
@@ -26,6 +26,7 @@ tag:
   - NoRHEL5
   - NoRHEL6
   - NoRHEL7
+  - NoRHEL8
   - Tier3
   - Tier3se
   - targeted
@@ -36,7 +37,7 @@ link:
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2218106
 adjust:
   - enabled: false
-    when: distro == rhel-4, rhel-5, rhel-6, rhel-7
+    when: distro == rhel-4, rhel-5, rhel-6, rhel-7, rhel-8
     because: the package is not available there
   - enabled: false
     when: arch == ppc64, ppc64le, s390x

diff --git a/selinux-policy/bootupd-and-similar/runtest.sh b/selinux-policy/bootupd-and-similar/runtest.sh
index 5064abc..8a4bf07 100755
--- a/selinux-policy/bootupd-and-similar/runtest.sh
+++ b/selinux-policy/bootupd-and-similar/runtest.sh
@@ -31,11 +31,16 @@
 
 PACKAGE="selinux-policy"
 FILE_PATH="/usr/libexec/bootupd"
-FILE_CONTEXT="bootupd_exec_t"
 SERVICE_PACKAGE="bootupd"
 SERVICE_NAME="bootupd"
 PROCESS_NAME="bootupd"
-PROCESS_CONTEXT="bootupd_t"
+if rlIsRHEL 9 ; then
+    FILE_CONTEXT="bin_t"
+    PROCESS_CONTEXT="unconfined_service_t"
+else
+    FILE_CONTEXT="bootupd_exec_t"
+    PROCESS_CONTEXT="bootupd_t"
+fi
 
 rlJournalStart
     rlPhaseStartSetup
@@ -54,6 +59,7 @@ rlJournalStart
     rlPhaseEnd
 
     rlPhaseStartTest "bz#2029478 + bz#2044508"
+        # both BZs were closed as WONTFIX, but the test is flexible enough
         rlSEMatchPathCon "${FILE_PATH}" "${FILE_CONTEXT}"
         BOOLEANS="[ ]"
         SOURCE_TYPE="init_t" # systemd runs the process
@@ -63,9 +69,9 @@ rlJournalStart
     rlPhaseEnd
 
     rlPhaseStartTest "bz#2218106"
-        rlSEMatchPathCon "/usr/libexec/bootupd" "bootupd_exec_t"
+        rlSEMatchPathCon "/usr/libexec/bootupd" "${FILE_CONTEXT}"
         rlRun "ls -RlZ /boot/efi"
-        rlSESearchRule "allow bootupd_t dosfs_t : dir { getattr search } [ ]"
+        rlSESearchRule "allow ${PROCESS_CONTEXT} dosfs_t : dir { getattr search } [ ]"
     rlPhaseEnd
 
     rlPhaseStartTest "real scenario -- standalone service"

diff --git a/selinux-policy/bz562833-chrooted-named-file-contexts/Makefile b/selinux-policy/bz562833-chrooted-named-file-contexts/Makefile
index 53e5491..d0987e4 100644
--- a/selinux-policy/bz562833-chrooted-named-file-contexts/Makefile
+++ b/selinux-policy/bz562833-chrooted-named-file-contexts/Makefile
@@ -94,6 +94,7 @@ $(METADATA): Makefile
 	@echo "Bug:             1923929" >> $(METADATA) # RHEL-9
 	@echo "Bug:             2223725" >> $(METADATA) # Fedora 39
 	@echo "Bug:             2224352" >> $(METADATA) # Fedora 38
+	@echo "Bug:             2226703" >> $(METADATA) # Fedora 38
 
 	rhts-lint $(METADATA)
 

diff --git a/selinux-policy/bz562833-chrooted-named-file-contexts/main.fmf b/selinux-policy/bz562833-chrooted-named-file-contexts/main.fmf
index 2b62072..d689936 100644
--- a/selinux-policy/bz562833-chrooted-named-file-contexts/main.fmf
+++ b/selinux-policy/bz562833-chrooted-named-file-contexts/main.fmf
@@ -53,6 +53,7 @@ link:
   - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1923929
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2223725
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2224352
+  - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2226703
 adjust:
   - enabled: false
     when: distro == rhel-4

diff --git a/selinux-policy/bz562833-chrooted-named-file-contexts/runtest.sh b/selinux-policy/bz562833-chrooted-named-file-contexts/runtest.sh
index b60c482..2ecc660 100755
--- a/selinux-policy/bz562833-chrooted-named-file-contexts/runtest.sh
+++ b/selinux-policy/bz562833-chrooted-named-file-contexts/runtest.sh
@@ -208,8 +208,8 @@ rlJournalStart
         rlPhaseEnd
     fi
 
-    if seinfo -c io_uring | grep -q io_uring ; then
-        rlPhaseStartTest "bz#2223725 + bz#2224352"
+    if rlIsFedora '>=38' ; then
+        rlPhaseStartTest "bz#2223725 + bz#2224352 + bz#2226703"
             rlSESearchRule "allow named_t named_t : io_uring { sqpoll } [ ]"
             rlSESearchRule "allow ndc_t ndc_t : io_uring { sqpoll } [ ]"
         rlPhaseEnd

diff --git a/selinux-policy/systemd-machined-and-similar/runtest.sh b/selinux-policy/systemd-machined-and-similar/runtest.sh
index 9063972..42416a7 100755
--- a/selinux-policy/systemd-machined-and-similar/runtest.sh
+++ b/selinux-policy/systemd-machined-and-similar/runtest.sh
@@ -67,6 +67,7 @@ rlJournalStart
         rlSESearchRule "type_transition ${SOURCE_TYPE} ${FILE_CONTEXT} : process ${PROCESS_CONTEXT} $BOOLEANS"
     rlPhaseEnd
 
+    if rlIsFedora ; then
     rlPhaseStartTest "bz#1847545"
         rlSESearchRule "allow systemd_machined_t unconfined_service_t : dir { search } [ ]"
     rlPhaseEnd
@@ -82,6 +83,7 @@ rlJournalStart
         rlSESearchRule "allow systemd_machined_t unconfined_service_t : lnk_file { getattr read } [ ]"
         rlSESearchRule "allow systemd_machined_t unconfined_service_t : unix_stream_socket { connectto } [ ]"
     rlPhaseEnd
+    fi
 
     rlPhaseStartTest "real scenario -- standalone service"
         if ! rlSEDefined ${PROCESS_CONTEXT} ; then

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

only message in thread, other threads:[~2026-09-11 13:20 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:20 [tests/selinux] pr775-checkpolicy-revdeps: update relevancy of 3 tests Milos Malik

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