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: modify daemons_use_tty in tests which use systemd-run
Date: Fri, 11 Sep 2026 13:20:33 GMT	[thread overview]
Message-ID: <178913283345.1.9248638836476202697.tests-selinux-92d69db177b8@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 92d69db177b8e058cf7bbb3437864c48b6181d4a
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2023-03-21T11:38:38+01:00
            Stats  : +4/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/92d69db177b8e058cf7bbb3437864c48b6181d4a?branch=pr775-checkpolicy-revdeps

            Log:
            modify daemons_use_tty in tests which use systemd-run

In order to allow a running systemd service to print an output onto
console, the daemons_use_tty boolean needs to be enabled. Otherwise
the following error message appears:

  Failed to start transient service unit: Connection reset by peer

The daemons_use_tty boolean is disabled by default.

---
diff --git a/selinux-policy/systemd-creds/runtest.sh b/selinux-policy/systemd-creds/runtest.sh
index 212b1a5..227e890 100755
--- a/selinux-policy/systemd-creds/runtest.sh
+++ b/selinux-policy/systemd-creds/runtest.sh
@@ -56,6 +56,7 @@ rlJournalStart
     rlPhaseEnd
 
     rlPhaseStartTest "a systemd service loading credentials"
+        rlRun "setsebool daemons_use_tty on"
         rlRun "echo hello > /foo"
         rlRun "ls -alZ /foo"
         rlRun "systemd-creds encrypt /foo /bar"
@@ -66,6 +67,7 @@ rlJournalStart
         rlRun "systemctl status dmesg.service" 0-255
         rlRun "rm -f /foo /bar"
         rlRun "systemd-run -P --wait -p LoadCredential=abc:/etc/hosts systemd-creds cat abc"
+        rlRun "setsebool daemons_use_tty off"
     rlPhaseEnd
 
     rlPhaseStartCleanup

diff --git a/selinux-policy/systemd-run-and-similar/runtest.sh b/selinux-policy/systemd-run-and-similar/runtest.sh
index 82990ab..0b0fbd2 100755
--- a/selinux-policy/systemd-run-and-similar/runtest.sh
+++ b/selinux-policy/systemd-run-and-similar/runtest.sh
@@ -37,6 +37,7 @@ rlJournalStart
         rlAssertRpm ${PACKAGE}
         rlAssertRpm ${PACKAGE}-targeted
         rlAssertRpm systemd
+        rlRun "setsebool daemons_use_tty on"
 
         rlSESetEnforce
         rlSEStatus
@@ -76,6 +77,7 @@ rlJournalStart
     rlPhaseStartCleanup
         sleep 2
         rlSECheckAVC
+        rlRun "setsebool daemons_use_tty off"
     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=178913283345.1.9248638836476202697.tests-selinux-92d69db177b8@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