public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: improve the test to clean-up after itself
@ 2026-09-11 13:20 Milos Malik
0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:20 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : f5c43be61e7dd99f303415e63e3392244331e098
Author : Milos Malik <mmalik@redhat.com>
Date : 2023-06-05T15:36:19+02:00
Stats : +6/-1 in 3 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/f5c43be61e7dd99f303415e63e3392244331e098?branch=pr775-checkpolicy-revdeps
Log:
improve the test to clean-up after itself
Restore the restorecond service to its original state.
The restorecond service should not stay running if it was not
running before execution of the test.
---
diff --git a/policycoreutils/restorecond_pointer_abuse/Makefile b/policycoreutils/restorecond_pointer_abuse/Makefile
index 253e7f3..bb3ac2c 100644
--- a/policycoreutils/restorecond_pointer_abuse/Makefile
+++ b/policycoreutils/restorecond_pointer_abuse/Makefile
@@ -55,6 +55,7 @@ $(METADATA): Makefile
@echo "Requires: /usr/sbin/sestatus" >> $(METADATA)
@echo "Requires: /usr/bin/systemctl" >> $(METADATA)
@echo "Requires: /usr/bin/journalctl" >> $(METADATA)
+ @echo "Requires: /usr/sbin/setenforce" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
diff --git a/policycoreutils/restorecond_pointer_abuse/main.fmf b/policycoreutils/restorecond_pointer_abuse/main.fmf
index 00a4fea..8225183 100644
--- a/policycoreutils/restorecond_pointer_abuse/main.fmf
+++ b/policycoreutils/restorecond_pointer_abuse/main.fmf
@@ -18,6 +18,7 @@ recommend:
- coreutils
- systemd
- policycoreutils
+ - libselinux-utils
adjust:
- enabled: false
when: distro < rhel-7
diff --git a/policycoreutils/restorecond_pointer_abuse/runtest.sh b/policycoreutils/restorecond_pointer_abuse/runtest.sh
index 98671dd..2056c98 100755
--- a/policycoreutils/restorecond_pointer_abuse/runtest.sh
+++ b/policycoreutils/restorecond_pointer_abuse/runtest.sh
@@ -44,6 +44,7 @@ PACKAGE="policycoreutils"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
+ rlServiceStart restorecond
# backup restorecond configuration file
rlRun "rlFileBackup /etc/selinux/restorecond.conf" 0
rlRun "echo '/usr/*' > /etc/selinux/restorecond.conf" 0-255
@@ -58,7 +59,7 @@ rlJournalStart
for i in {1..15}
do
# create misslabeled files
- for folder in share games tmp
+ for folder in share games tmp
do
rlRun "touch /usr/$folder/$i"
rlRun "chcon -t unlabeled_t /usr/$folder/$i"
@@ -79,6 +80,8 @@ rlJournalStart
rlPhaseStartCleanup
rlRun "rlFileRestore" 0
+ rlServiceRestore restorecond
+ rm -f ${OUTPUT_FILE}
rlPhaseEnd
rlJournalPrintText
rlJournalEnd
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 13:20 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:20 [tests/selinux] pr775-checkpolicy-revdeps: improve the test to clean-up after itself Milos Malik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox