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: skip the real scenario if the service is missing
Date: Fri, 11 Sep 2026 13:19:14 GMT	[thread overview]
Message-ID: <178913275451.1.9576008224372824858.tests-selinux-d33212fe8861@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : d33212fe88616f2b58d7525f871366d2e4687405
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2021-06-24T13:36:18+02:00
            Stats  : +2/-0 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/d33212fe88616f2b58d7525f871366d2e4687405?branch=pr775-checkpolicy-revdeps

            Log:
            skip the real scenario if the service is missing

The systemd-timesyncd service is present on both RHEL-8 and Fedora,
but may not be present on other RHELs, even though the policy which
confines the systemd-timesyncd program is present there.
If the systemd-timesyncd service is not present then the TC checks
policy definitions only (types, rules, file context patterns etc.)
If the systemd-timesyncd service is present then the TC will also
test basic actions of the service (start, restart, status etc.)

---
diff --git a/selinux-policy/systemd-timesyncd-and-similar/runtest.sh b/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
index 9fc18cf..f9b1b7f 100755
--- a/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
+++ b/selinux-policy/systemd-timesyncd-and-similar/runtest.sh
@@ -109,6 +109,7 @@ rlJournalStart
         rlSESearchRule "allow systemd_timedated_t var_run_t : dir { watch } [ ]"
     rlPhaseEnd
 
+    if systemctl list-units | grep -q ${SERVICE_NAME} ; then
     rlPhaseStartTest "real scenario -- standalone service"
         rlRun "echo ${ROOT_PASSWORD} | passwd --stdin root"
         if ! rlSEDefined ${PROCESS_CONTEXT} ; then
@@ -118,6 +119,7 @@ rlJournalStart
         rlRun "restorecon -Rv /run /var" 0-255
         rlSEService ${ROOT_PASSWORD} ${SERVICE_NAME} ${PROCESS_NAME} ${PROCESS_CONTEXT} "restart status stop status" 1
     rlPhaseEnd
+    fi
 
     rlPhaseStartCleanup
         sleep 2

                 reply	other threads:[~2026-09-11 13:19 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=178913275451.1.9576008224372824858.tests-selinux-d33212fe8861@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