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: skip irrelevant phases and install required packages
Date: Fri, 11 Sep 2026 13:21:51 GMT [thread overview]
Message-ID: <178913291112.1.9998806650368738003.tests-selinux-1d726848e63a@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 1d726848e63a140653b38141c7da082c44d3a0b6
Author : Milos Malik <mmalik@redhat.com>
Date : 2024-07-26T18:12:20+02:00
Stats : +30/-5 in 9 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/1d726848e63a140653b38141c7da082c44d3a0b6?branch=pr775-checkpolicy-revdeps
Log:
skip irrelevant phases and install required packages
If required packages are not installed, the tests will try to install
them (only 1 attempt per test will be done).
Certain test phases may not be relevant if:
* required SELinux types/attributes are not defined
* required programs/files are not installed
* required packages are not available
---
diff --git a/selinux-policy/abrt-services/runtest.sh b/selinux-policy/abrt-services/runtest.sh
index 220c1c6..abc6c85 100755
--- a/selinux-policy/abrt-services/runtest.sh
+++ b/selinux-policy/abrt-services/runtest.sh
@@ -57,6 +57,7 @@ rlJournalStart
rlPhaseEnd
fi
+ if rpm -qa | grep -q abrt ; then
rlPhaseStartTest "real scenario -- bz#2274709"
for SERVICE_NAME in abrtd abrt-journal-core abrt-oops abrt-pstoreoops abrt-upload-watch abrt-vmcore abrt-xorg ; do
rlRun "service ${SERVICE_NAME} start"
@@ -69,6 +70,7 @@ rlJournalStart
rlRun "service ${SERVICE_NAME} stop"
done
rlPhaseEnd
+ fi
rlPhaseStartCleanup
sleep 2
diff --git a/selinux-policy/deny-rules/runtest.sh b/selinux-policy/deny-rules/runtest.sh
index 73f96af..65f947e 100755
--- a/selinux-policy/deny-rules/runtest.sh
+++ b/selinux-policy/deny-rules/runtest.sh
@@ -24,6 +24,9 @@ rlJournalStart
rlAssertRpm libselinux
rlAssertRpm policycoreutils
rlAssertRpm selinux-policy
+ if ! rpm -q strace ; then
+ rlRun "yum -y install strace" 0-255
+ fi
rlRun "setenforce 1"
rlRun "sestatus"
diff --git a/selinux-policy/dhclient-and-similar/runtest.sh b/selinux-policy/dhclient-and-similar/runtest.sh
index b6b920c..1c681c1 100755
--- a/selinux-policy/dhclient-and-similar/runtest.sh
+++ b/selinux-policy/dhclient-and-similar/runtest.sh
@@ -71,6 +71,7 @@ rlJournalStart
rlPhaseEnd
fi
+ if which dhclient >& /dev/null ; then
rlPhaseStartTest "real scenario"
rlRun "rm -rf /run/chrony-dhcp"
rlRun "restorecon -Rv /run /var -e /var/ARTIFACTS" 0-255
@@ -82,6 +83,7 @@ rlJournalStart
rlRun "ls -alZ /run/chrony-dhcp"
fi
rlPhaseEnd
+ fi
rlPhaseStartCleanup
sleep 2
diff --git a/selinux-policy/logwatch-and-similar/runtest.sh b/selinux-policy/logwatch-and-similar/runtest.sh
index 4632ee2..c712baf 100755
--- a/selinux-policy/logwatch-and-similar/runtest.sh
+++ b/selinux-policy/logwatch-and-similar/runtest.sh
@@ -66,7 +66,9 @@ rlJournalStart
rlSEMatchPathCon "/run/systemd/sessions/" "systemd_logind_sessions_t"
rlSESearchRule "allow logwatch_t systemd_logind_sessions_t : dir { read } [ ]"
rlSESearchRule "type_transition logwatch_t sendmail_exec_t : process logwatch_mail_t"
- rlSESearchRule "allow logwatch_mail_t init_t : unix_stream_socket { getattr } [ ]"
+ if rlIsFedora ; then
+ rlSESearchRule "allow logwatch_mail_t init_t : unix_stream_socket { getattr } [ ]"
+ fi
rlPhaseEnd
fi
diff --git a/selinux-policy/pam_console-and-related/runtest.sh b/selinux-policy/pam_console-and-related/runtest.sh
index 20941d0..068581b 100755
--- a/selinux-policy/pam_console-and-related/runtest.sh
+++ b/selinux-policy/pam_console-and-related/runtest.sh
@@ -98,9 +98,11 @@ rlJournalStart
rlRun "setsebool ssh_sysadm_login off"
rlPhaseEnd
+ if [ -f /usr/sbin/pam_console_apply ] ; then
rlPhaseStartTest "real scenario -- runcon under root"
rlRun "runcon system_u:system_r:initrc_t:s0 /bin/bash -c '/usr/sbin/pam_console_apply -r'"
rlPhaseEnd
+ fi
rlPhaseStartCleanup
sleep 2
diff --git a/selinux-policy/systemd-nsresourced-and-similar/runtest.sh b/selinux-policy/systemd-nsresourced-and-similar/runtest.sh
index 383afad..2124748 100755
--- a/selinux-policy/systemd-nsresourced-and-similar/runtest.sh
+++ b/selinux-policy/systemd-nsresourced-and-similar/runtest.sh
@@ -31,11 +31,11 @@
PACKAGE="selinux-policy"
FILE_PATH="/usr/lib/systemd/systemd-nsresourced"
-FILE_CONTEXT="systemd_nsresourced_exec_t"
SERVICE_PACKAGE="systemd"
SERVICE_NAME="systemd-nsresourced"
PROCESS_NAME="systemd-nsresourced"
PROCESS_CONTEXT="systemd_nsresourced_t"
+FILE_CONTEXT="systemd_nsresourced_exec_t"
rlJournalStart
rlPhaseStartSetup
@@ -54,6 +54,7 @@ rlJournalStart
sleep 2
rlPhaseEnd
+ if seinfo -t | grep -q systemd_nsresourced ; then
rlPhaseStartTest "bz#2290477"
rlSEMatchPathCon "${FILE_PATH}" "${FILE_CONTEXT}"
SOURCE_TYPE="init_t" # systemd runs the process
@@ -71,7 +72,9 @@ rlJournalStart
rlSESearchRule "allow staff_t systemd_nsresourced_t : unix_stream_socket { connectto } [ ]"
rlSESearchRule "allow xdm_t systemd_nsresourced_t : unix_stream_socket { connectto } [ ]"
rlPhaseEnd
+ fi
+ if [ -f /usr/lib/systemd/system/${SERVICE_NAME}.service ] ; then
rlPhaseStartTest "real scenario -- standalone service"
if ! rlSEDefined ${PROCESS_CONTEXT} ; then
# for OSes where the SELinux domain does not exist yet
@@ -81,7 +84,9 @@ rlJournalStart
rlRun "restorecon -Rv /var /run -e /var/ARTIFACTS" 0-255
rlSEService - ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "restart status stop status" 1
rlPhaseEnd
+ fi
+ if [ -f /usr/lib/systemd/system/${SERVICE_NAME}.socket ] ; then
rlPhaseStartTest "real scenario -- socket activation"
rlRun "systemctl enable ${SERVICE_NAME}.socket"
rlRun "systemctl start ${SERVICE_NAME}.socket"
@@ -98,6 +103,7 @@ rlJournalStart
rlRun "systemctl stop ${SERVICE_NAME}.socket"
rlRun "systemctl disable ${SERVICE_NAME}.socket"
rlPhaseEnd
+ fi
rlPhaseStartCleanup
sleep 2
diff --git a/selinux-policy/systemd-timesyncd-and-similar/runtest.sh b/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
index 42fa246..2367349 100755
--- a/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
+++ b/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
@@ -41,10 +41,14 @@ rlJournalStart
rlPhaseStartSetup
rlRun "rlImport 'selinux-policy/common'" 0,1
rlSESatisfyRequires
- SERVICE_PACKAGE=`rpm -qf ${FILE_PATH} | head -n 1`
rlAssertRpm ${PACKAGE}
rlAssertRpm ${PACKAGE}-targeted
- rlAssertRpm ${SERVICE_PACKAGE}
+ if [ -f ${FILE_PATH} ] ; then
+ SERVICE_PACKAGE=`rpm -qf ${FILE_PATH} | head -n 1`
+ rlAssertRpm ${SERVICE_PACKAGE}
+ else
+ rlRun "yum -y install ${FILE_PATH}" 0-255
+ fi
rlServiceStop ${SERVICE_NAME}
rlFileBackup /etc/shadow
diff --git a/selinux-policy/virtualization-daemons/runtest.sh b/selinux-policy/virtualization-daemons/runtest.sh
index 2cae433..f132fdf 100755
--- a/selinux-policy/virtualization-daemons/runtest.sh
+++ b/selinux-policy/virtualization-daemons/runtest.sh
@@ -32,7 +32,7 @@
PACKAGE="selinux-policy"
ROOT_PASSWORD="redhat"
SERVICE_NAMES="libvirtd virtinterfaced virtlockd virtlogd virtlxcd virtnetworkd virtnodedevd virtnwfilterd virtproxyd virtqemud virtsecretd virtstoraged virtvboxd virtxend"
-if rlIsFedora ">39"; then
+if seinfo -a | grep -q virt_driver_domain ; then
ALL_TUPLES="libvirtd:libvirtd:virtd_t \
virtinterfaced:virtinterfaced:virtinterfaced_t \
virtlockd:virtlockd:virtlogd_t \
diff --git a/setools/rebuild-from-srpm/runtest.sh b/setools/rebuild-from-srpm/runtest.sh
index 698c4ef..cf031ab 100755
--- a/setools/rebuild-from-srpm/runtest.sh
+++ b/setools/rebuild-from-srpm/runtest.sh
@@ -8,6 +8,10 @@ rlJournalStart
rlAssertRpm libsemanage
rlAssertRpm libselinux
rlAssertRpm policycoreutils
+ if ! rpm -q rpm-build ; then
+ rlRun "yum -y install rpm-build" 0-255
+ fi
+
rlRun "rm -f setools*.src.rpm"
rlRun "yumdownloader --source setools"
rlRun "ls -l setools*src.rpm"
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=178913291112.1.9998806650368738003.tests-selinux-1d726848e63a@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