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: introduce a variable which skips systemd-sleep services
Date: Fri, 11 Sep 2026 13:18:31 GMT [thread overview]
Message-ID: <178913271128.1.11545498474731519150.tests-selinux-f0693a3d135d@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : f0693a3d135df164369302fc552ff371c5974b34
Author : Milos Malik <mmalik@redhat.com>
Date : 2020-12-01T18:36:45+00:00
Stats : +5/-4 in 1 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/f0693a3d135df164369302fc552ff371c5974b34?branch=pr775-checkpolicy-revdeps
Log:
introduce a variable which skips systemd-sleep services
The automated TC contains a phase where services systemd-hybrid-sleep
and systemd-hibernate are started for testing purposes. Unfortunately,
running these services had real consequences on machines in certain
environments where the TC was executed (for example: machines became
unresponsive).
To have some control of the situation, a new environment variable was
introduced. It is called REAL_SCENARIOS and it can avoid the situation
when set to false. Default value of the variable is true which means
that above-mentioned services will be executed.
---
diff --git a/selinux-policy/swap-file-and-systemd-access/runtest.sh b/selinux-policy/swap-file-and-systemd-access/runtest.sh
index fbebe5b..d7af11e 100755
--- a/selinux-policy/swap-file-and-systemd-access/runtest.sh
+++ b/selinux-policy/swap-file-and-systemd-access/runtest.sh
@@ -30,12 +30,11 @@
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="selinux-policy"
+REAL_SCENARIOS=${REAL_SCENARIOS:-true}
rlJournalStart
- if rlIsFedora "<34" || rlIsRHEL "<8.4" ; then
- rlLog "Not applicable to this system version."
- rlJournalEnd
- exit 0
+ if ! seinfo -t | grep -q systemd_sleep ; then
+ rlDie "Not applicable to this SELinux policy version."
fi
rlPhaseStartSetup
@@ -74,6 +73,7 @@ rlJournalStart
rlSESearchRule "allow systemd_logind_t swapfile_t : file { getattr open read ioctl } [ ]"
rlPhaseEnd
+ if ${REAL_SCENARIOS} ; then
rlPhaseStartTest "real scenario"
rlRun "rm -f /swapfile"
rlRun "dd if=/dev/zero of=/swapfile bs=1M count=256"
@@ -98,6 +98,7 @@ rlJournalStart
rlRun "free"
rlRun "rm -f /swapfile"
rlPhaseEnd
+ fi
rlPhaseStartCleanup
sleep 2
reply other threads:[~2026-09-11 13:18 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=178913271128.1.11545498474731519150.tests-selinux-f0693a3d135d@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