public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Zdenek Pytela <zpytela@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: Update systemd-generators test
Date: Fri, 11 Sep 2026 13:22:37 GMT	[thread overview]
Message-ID: <178913295707.1.369695216436636861.tests-selinux-094cc6f8c0c4@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 094cc6f8c0c49b97f6504e677c18a4887a21b7ac
            Author : Zdenek Pytela <zpytela@redhat.com>
            Date   : 2025-04-17T18:15:10+00:00
            Stats  : +13/-9 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/094cc6f8c0c49b97f6504e677c18a4887a21b7ac?branch=pr775-checkpolicy-revdeps

            Log:
            Update systemd-generators test

The loop42 device file is used by other tests, so the name was changed
to loop17 not to clash.

Minor improvements.

---
diff --git a/selinux-policy/systemd-generators/mnt-loop.mount b/selinux-policy/systemd-generators/mnt-loop.mount
index 3f0b925..840dd8c 100644
--- a/selinux-policy/systemd-generators/mnt-loop.mount
+++ b/selinux-policy/systemd-generators/mnt-loop.mount
@@ -4,9 +4,9 @@
 Documentation=man:fstab(5) man:systemd-fstab-generator(8)
 SourcePath=/tmp/fstab
 Before=local-fs.target
-After=blockdev@dev-loop42.target
+After=blockdev@dev-loop17.target
 
 [Mount]
-What=/dev/loop42
+What=/dev/loop17
 Where=/mnt/loop
 Type=ext4

diff --git a/selinux-policy/systemd-generators/runtest.sh b/selinux-policy/systemd-generators/runtest.sh
index bc8be92..1cd2a13 100755
--- a/selinux-policy/systemd-generators/runtest.sh
+++ b/selinux-policy/systemd-generators/runtest.sh
@@ -70,7 +70,7 @@ rlJournalStart
         [ -x "$FILEPATH" ] || continue
 	CONTEXT=$(stat -c"%C" "${FILEPATH}")
         [ "$?" = 0 ] || continue
-	if [[ ${CONTEXT} =~ ":init_exec_t:" ]] || [[ ${CONTEXT} =~ ":lib_t:" ]] || [[ ${CONTEXT} =~ ":usr_t:" ]]
+	if [[ ${CONTEXT} =~ ":init_exec_t:" ]] || [[ ${CONTEXT} =~ ":lib_t:" ]] || [[ ${CONTEXT} =~ ":usr_t:" ]] || [[ ${CONTEXT} =~ ":systemd_generic_generator_exec_t:" ]]
 	then
 	  SD_SYSTEM_GENERATORS_NOTCONFINED="${SD_SYSTEM_GENERATORS_NOTCONFINED} $FILEPATH"
 	else
@@ -120,7 +120,7 @@ rlJournalStart
     rlPhaseStartTest "systemd-fstab-generator /etc"
 	rlFileBackup "/etc/fstab"
 	rlRun "mkdir -p /newproc"
-	echo "/proc /newproc none bind 0 0" >> /etc/fstab
+	rlRun "echo \"/proc /newproc none bind 0 0\" >> /etc/fstab"
 	rlRun "SYSTEMD_LOG_LEVEL=debug systemd-run -u sdfg-manual.service /usr/lib/systemd/system-generators/systemd-fstab-generator /run/systemd/generator"
 	rlRun "journalctl -u sdfg-manual.service"
 	rlRun "systemctl daemon-reload"
@@ -132,14 +132,15 @@ rlJournalStart
 
     # fstab-generator 2 - use a local fstab-like file
     rlPhaseStartTest "systemd-fstab-generator /tmp"
-	echo "/dev/loop42 /mnt/loop ext4 defaults 0 0" >> /tmp/fstab
+	rlRun "> /tmp/fstab"
+	rlRun "echo \"/dev/loop17 /mnt/loop ext4 defaults 0 0\" >> /tmp/fstab"
 	rlRun "mkdir -p /mnt/loop"
 	rlRun "chcon --reference /etc/fstab /tmp/fstab"
 	rlRun "dd if=/dev/zero of=/tmp/loopfile bs=16M count=1"
 	rlRun "chcon -t user_tmp_t /tmp/loopfile"
-	rlRun "losetup /dev/loop42 /tmp/loopfile"
+	rlRun "losetup /dev/loop17 /tmp/loopfile"
 	rlRun "losetup -j /tmp/loopfile"
-	rlRun "mkfs.ext4 /dev/loop42"
+	rlRun "mkfs.ext4 /dev/loop17"
 	rlRun "systemd-run -E SYSTEMD_FSTAB=/tmp/fstab -u sdfg-tmpfstab.service /usr/lib/systemd/system-generators/systemd-fstab-generator /run/systemd/generator"
 	rlRun "diff /run/systemd/generator/mnt-loop.mount mnt-loop.mount"
 	rlRun "ls -lZa /mnt/loop"
@@ -161,6 +162,8 @@ rlJournalStart
     # exists and is executable, and if it is, pulls the rc-local.service unit into the
     # boot process.
     # the service unit file already exists: /usr/lib/systemd/system/rc-local.service
+    # the generator just creates
+    # /run/systemd/generator/multi-user.target.wants/rc-local.service symlink
     rlPhaseStartTest "systemd-rc-local-generator"
 	cat > /etc/rc.d/rc.local << EOF
 #!/bin/bash
@@ -237,8 +240,9 @@ EOF
     rlPhaseStartCleanup
         sleep 2
 	rlRun "rmdir /mnt/loop"
-	rlRun "losetup -d /dev/loop42"
-	rlRun "/bin/rm /tmp/loopfile"
+	rlRun "losetup -d /dev/loop17"
+	rlRun "rm -f /dev/loop17"
+	rlRun "rm /tmp/loopfile"
         rlFileRestore
 	# fixme: remove non-natural generators
 	rlRun "systemctl daemon-reload"

                 reply	other threads:[~2026-09-11 13:22 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=178913295707.1.369695216436636861.tests-selinux-094cc6f8c0c4@fedoraproject.org \
    --to=zpytela@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