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: test if restorecond service times out occasionally
Date: Fri, 11 Sep 2026 13:23:40 GMT	[thread overview]
Message-ID: <178913302066.1.9548093684493163207.tests-selinux-337204b76602@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 337204b766028f111f16d89ba8c4649e09bde18a
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2026-04-09T12:56:50+00:00
            Stats  : +64/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/337204b766028f111f16d89ba8c4649e09bde18a?branch=pr775-checkpolicy-revdeps

            Log:
            test if restorecond service times out occasionally

A recently reported customer case revealed that the restorecond
service occasionally fails to start because of a timeout. The
exact reproducer is unknown, but the TC reproduces a similar
situation (mislabeled /run/restorecond.pid file) which also leads
to timeouts.

In order to fix the problem, the restorecond service is no longer
a forking type of service. It is a single type of service. The TC
checks this parameter too.

The TC covers RHEL-142541 and RHEL-165247.

---
diff --git a/policycoreutils/restorecond-service-timeouts/main.fmf b/policycoreutils/restorecond-service-timeouts/main.fmf
new file mode 100644
index 0000000..bd454be
--- /dev/null
+++ b/policycoreutils/restorecond-service-timeouts/main.fmf
@@ -0,0 +1,30 @@
+summary: the restorecond service fails to start because of timeout
+description: the restorecond service fails to start because of timeout
+contact: Milos Malik <mmalik@redhat.com>
+component:
+  - policycoreutils
+recommend:
+  - policycoreutils
+  - policycoreutils-restorecond
+duration: 5m
+enabled: true
+tag:
+  - CI-Tier-1
+  - NoRHEL4
+  - NoRHEL5
+  - NoRHEL6
+  - NoRHEL7
+  - NoRHEL8
+  - targeted
+tier: 1
+link:
+  - verifies: https://issues.redhat.com/browse/RHEL-142541
+  - verifies: https://issues.redhat.com/browse/RHEL-165247
+adjust:
+  - enabled: false
+    when: distro == rhel-4, rhel-5, rhel-6, rhel-7
+    because: the test is not relevant there
+  - enabled: false
+    when: distro == rhel-8, centos-stream-8
+    because: the bug is not yet fixed there
+

diff --git a/policycoreutils/restorecond-service-timeouts/runtest.sh b/policycoreutils/restorecond-service-timeouts/runtest.sh
new file mode 100755
index 0000000..0857ea2
--- /dev/null
+++ b/policycoreutils/restorecond-service-timeouts/runtest.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+. /usr/share/beakerlib/beakerlib.sh
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlRun "rpm -qa | grep policycoreutils | sort"
+        rlServiceStop restorecond
+        rlRun "rm -f /run/restorecond.pid"
+    rlPhaseEnd
+
+    rlPhaseStartTest "RHEL-142541 + RHEL-165247"
+        rlRun "grep ^Type=simple /usr/lib/systemd/system/restorecond.service"
+        rlRun "touch /run/restorecond.pid"
+        rlRun "ls -lZ /run/restorecond.pid"
+        rlRun "ls -lZ /run/restorecond.pid | grep :var_run_t"
+        rlRun "systemctl start restorecond.service"
+        sleep 2
+        rlRun -s "systemctl status restorecond.service -l"
+        rlRun "grep -i -e '/run/restorecond.pid' -e 'failed.*timeout' $rlRun_LOG" 1
+        rm -f $rlRun_LOG
+        rlRun "systemctl restart restorecond.service"
+        sleep 2
+        rlRun -s "systemctl status restorecond.service -l"
+        rlRun "grep -i -e '/run/restorecond.pid' -e 'failed.*timeout' $rlRun_LOG" 1
+        rm -f $rlRun_LOG
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        rlRun "rm -f /run/restorecond.pid"
+        rlServiceRestore restorecond
+    rlPhaseEnd
+rlJournalEnd
+

                 reply	other threads:[~2026-09-11 13:23 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=178913302066.1.9548093684493163207.tests-selinux-337204b76602@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