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: add a simplified version of rlSESatisfyRequires()
Date: Fri, 11 Sep 2026 13:20:18 GMT [thread overview]
Message-ID: <178913281834.1.15264083650335124293.tests-selinux-d1caaec9e27d@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : d1caaec9e27d67cb82ba0810567300509df716e1
Author : Milos Malik <mmalik@redhat.com>
Date : 2022-11-22T14:14:16+01:00
Stats : +31/-1 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/d1caaec9e27d67cb82ba0810567300509df716e1?branch=pr775-checkpolicy-revdeps
Log:
add a simplified version of rlSESatisfyRequires()
If the framework which runs the automated tests does not install
all required packages (listed in Makefile) before the tests are
started, then rlSESatisfyRequires() installs the required packages
during the run of the tests.
---
diff --git a/selinux-policy/Library/common/lib.sh b/selinux-policy/Library/common/lib.sh
index 22a7b31..4bcb8ee 100644
--- a/selinux-policy/Library/common/lib.sh
+++ b/selinux-policy/Library/common/lib.sh
@@ -1524,9 +1524,39 @@ function rlSESetEnforce() {
}
+true <<'=cut'
+=pod
+
+=head2 rlSESatisfyRequires
+
+The function attempts to install all packages required in Makefile and all packa
+ges given as arguments.
+The function will be used to install packages from any repository we want.
+
+=cut
+function rlSESatisfyRequires() {
+ local FILE_NAME="./Makefile"
+ local PACKAGE_LIST
+ local PACKAGE_LIST2
+ if [ "x$COLLECTIONS" != "x" ] ; then
+ # do not install any packages when running in RHSCL environment
+ # because that would most likely break the environment or fail
+ return
+ fi
+ if [ $# -gt 0 ] ; then
+ PACKAGE_LIST2="$*"
+ fi
+ PACKAGE_LIST=`grep '"Requires:' ${FILE_NAME} | cut -d : -f 2 | cut -d '"' -f 1 | tr '\n' ' ' | tr -s ' '`
+ # check if all required packages are really installed
+ if rpm -q ${PACKAGE_LIST} ${PACKAGE_LIST2} >& /dev/null ; then
+ rlPass "all required packages are really installed"
+ return 0
+ fi
+ rlRun "epelyum -y --nobest --nogpgcheck --skip-broken install ${PACKAGE_LIST} ${PACKAGE_LIST2}" 0,1
+}
__INTERNAL_rlSEModuleList() {
local semodule_list
diff --git a/selinux-policy/cups-lpd-and-similar/runtest.sh b/selinux-policy/cups-lpd-and-similar/runtest.sh
index 3d30478..1ada2fc 100755
--- a/selinux-policy/cups-lpd-and-similar/runtest.sh
+++ b/selinux-policy/cups-lpd-and-similar/runtest.sh
@@ -41,7 +41,7 @@ PROCESS_CONTEXT="cupsd_lpd_t"
rlJournalStart
rlPhaseStartSetup
rlRun "rlImport 'selinux-policy/common'"
- # rlSESatisfyRequires
+ rlSESatisfyRequires
rlAssertRpm ${PACKAGE}
rlAssertRpm ${PACKAGE}-targeted
rlAssertRpm ${SERVICE_PACKAGE}
reply other threads:[~2026-09-11 13:20 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=178913281834.1.15264083650335124293.tests-selinux-d1caaec9e27d@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