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: update the cups-lpd test to the latest version
Date: Fri, 11 Sep 2026 13:19:29 GMT [thread overview]
Message-ID: <178913276973.1.2922266036624560194.tests-selinux-0dab3f0467d6@fedoraproject.org> (raw)
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"
reply other threads:[~2026-09-11 13:19 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=178913276973.1.2922266036624560194.tests-selinux-0dab3f0467d6@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