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

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 0dab3f0467d6e7cfa5034a99d7a94829bb1b0601
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2021-12-07T19:55:26+00:00
            Stats  : +26/-6 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/0dab3f0467d6e7cfa5034a99d7a94829bb1b0601?branch=pr775-checkpolicy-revdeps

            Log:
            update the cups-lpd test to the latest version

The downstream version of the automated test covers more bugs than
the upstream version. Before the downstream test can be replaced by
a wrapper that calls the upstream one, both versions should be in
sync.

---
diff --git a/selinux-policy/cups-lpd-and-similar/Makefile b/selinux-policy/cups-lpd-and-similar/Makefile
index dcbcdc2..c3a0bdd 100644
--- a/selinux-policy/cups-lpd-and-similar/Makefile
+++ b/selinux-policy/cups-lpd-and-similar/Makefile
@@ -55,7 +55,7 @@ $(METADATA): Makefile
 	@echo "TestTime:        20m" >> $(METADATA)
 	@echo "RunFor:          selinux-policy" >> $(METADATA)
 	@echo "RunFor:          cups" >> $(METADATA)
-	@echo "Requires:        audit expect policycoreutils-python-utils selinux-policy-devel libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools setools-console xinetd nmap-ncat nc net-tools cups-lpd chkconfig initscripts" >> $(METADATA)
+	@echo "Requires:        audit expect policycoreutils-python-utils selinux-policy-devel libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools setools-console xinetd nmap-ncat nc net-tools cups-lpd chkconfig /usr/sbin/service" >> $(METADATA)
 	@echo "RhtsRequires:    library(selinux-policy/common)" >> $(METADATA)
 	@echo "Priority:        Normal" >> $(METADATA)
 	@echo "License:         GPLv2" >> $(METADATA)
@@ -63,9 +63,13 @@ $(METADATA): Makefile
 	@echo "Destructive:     no" >> $(METADATA)
 	@echo "Environment:     AVC_ERROR=+no_avc_check" >> $(METADATA)
 	@echo "Releases:        -RHEL4" >> $(METADATA)
+	@echo "Bug:             192216" >> $(METADATA) # Fedora 5
 	@echo "Bug:             1004198" >> $(METADATA) # RHEL-7
+	@echo "Bug:             1420522" >> $(METADATA) # Fedora 24
 	@echo "Bug:             1554118" >> $(METADATA) # RHEL-8
 	@echo "Bug:             1919399" >> $(METADATA) # RHEL-8
+	@echo "Bug:             1947397" >> $(METADATA) # RHEL-9
+	@echo "Bug:             2020531" >> $(METADATA) # Fedora 35
 
 	rhts-lint $(METADATA)
 

diff --git a/selinux-policy/cups-lpd-and-similar/runtest.sh b/selinux-policy/cups-lpd-and-similar/runtest.sh
index e9e01a5..3d30478 100755
--- a/selinux-policy/cups-lpd-and-similar/runtest.sh
+++ b/selinux-policy/cups-lpd-and-similar/runtest.sh
@@ -27,7 +27,6 @@
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 # Include Beaker environment
-. /usr/bin/rhts-environment.sh || exit 1
 . /usr/share/beakerlib/beakerlib.sh || exit 1
 
 PACKAGE="selinux-policy"
@@ -59,6 +58,13 @@ rlJournalStart
         sleep 2
     rlPhaseEnd
 
+    rlPhaseStartTest "bz#192216"
+        rlSEMatchPathCon "/usr/lib/cups/daemon/cups-lpd" "cupsd_lpd_exec_t"
+        rlSEMatchPathCon "/var/run/cups" "cupsd_var_run_t"
+        rlSESearchRule "allow cupsd_lpd_t cupsd_var_run_t : dir { search } [ ]"
+        rlSESearchRule "allow cupsd_lpd_t cupsd_lpd_t : netlink_route_socket { create } [ ]"
+    rlPhaseEnd
+
     rlPhaseStartTest "bz#1004198"
         if rlIsRHEL 5 ; then
             SOURCE_TYPE="inetd_t" # xinetd runs the process
@@ -78,24 +84,34 @@ rlJournalStart
         fi
     rlPhaseEnd
 
-    rlPhaseStartTest "bz#1554118"
+    rlPhaseStartTest "bz#1420522 + bz#1554118"
         rlSEMatchPathCon "/usr/lib/cups/daemon/cups-lpd" "cupsd_lpd_exec_t"
         rlSESearchRule "allow init_t cupsd_lpd_t : tcp_socket { create setopt bind listen }"
     rlPhaseEnd
 
-    rlPhaseStartTest "bz#1919399"
+    rlPhaseStartTest "bz#1919399 + bz#1947397"
         rlSEMatchPathCon "/usr/lib/cups/daemon/cups-lpd" "cupsd_lpd_exec_t"
         rlSEMatchPathCon "/run/cups/cups.sock" "cupsd_var_run_t"
         rlSESearchRule "allow cupsd_lpd_t cupsd_var_run_t : sock_file { read } [ ]"
     rlPhaseEnd
 
-    rlPhaseStartTest "real scenario -- BZ#1919399"
+    if ! rlIsRHEL 5 6 7 8 ; then
+    rlPhaseStartTest "bz#2020531"
+        rlSEMatchPathCon "/usr/lib/cups/daemon/cups-lpd" "cupsd_lpd_exec_t"
+        rlRun "ls -Z /proc/1/environ | grep :init_t"
+        rlSESearchRule "dontaudit cupsd_lpd_t init_t : dir { search } [ ]"
+    rlPhaseEnd
+    fi
+
+    rlPhaseStartTest "real scenario -- bz#1919399 + bz#1947397"
         rlRun "systemctl start cups.service"
         rlRun "systemctl enable cups-lpd.socket"
         rlRun "systemctl start cups-lpd.socket"
-        rlRun "lpadmin -p test -E"
+        sleep 2
+        rlRun "lpadmin -p test -o printer-is-shared=true -E"
         rlRun "DEVICE_URI=lpd://127.0.0.1/test /usr/lib/cups/backend/lpd 1 user test 1 '' /etc/fstab"
         sleep 5
+        rlRun "lpadmin -x test"
         rlRun "systemctl stop cups-lpd.socket"
         rlRun "systemctl disable cups-lpd.socket"
         rlRun "systemctl stop cups.service"

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

only message in thread, other threads:[~2026-09-11 13:19 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:19 [tests/selinux] pr775-checkpolicy-revdeps: update the cups-lpd test to the latest version Milos Malik

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