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: improve the test to clean-up after itself
Date: Fri, 11 Sep 2026 13:20:43 GMT	[thread overview]
Message-ID: <178913284382.1.731531494537470220.tests-selinux-f5c43be61e7d@fedoraproject.org> (raw)

            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

                 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=178913284382.1.731531494537470220.tests-selinux-f5c43be61e7d@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