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: add Makefiles to tests executed via STI
Date: Fri, 11 Sep 2026 13:21:12 GMT	[thread overview]
Message-ID: <178913287243.1.1667465896700621799.tests-selinux-fec8a047876d@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : fec8a047876d68cade5edc3b30b18fd4cb45eb6d
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2023-11-16T15:14:09+00:00
            Stats  : +125/-52 in 4 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/fec8a047876d68cade5edc3b30b18fd4cb45eb6d?branch=pr775-checkpolicy-revdeps

            Log:
            add Makefiles to tests executed via STI

Certain automated tests do not have Makefiles, which prevents them
from being executed by STI means. The situation leads to error messages
like this one:

  FAIL test selinux/selinux-policy/... do not know how to run test

In order to successfully execute them, appropriate Makefiles will
be added.

---
diff --git a/selinux-policy/systemd-localed/Makefile b/selinux-policy/systemd-localed/Makefile
new file mode 100644
index 0000000..8727c1e
--- /dev/null
+++ b/selinux-policy/systemd-localed/Makefile
@@ -0,0 +1,71 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   Makefile of /CoreOS/selinux-policy/Regression/systemd-localed
+#   Description: SELinux interferes with systemd-localed and localectl
+#   Author: Milos Malik <mmalik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   Copyright (c) 2023 Red Hat, Inc. All rights reserved.
+#
+#   This copyrighted material is made available to anyone wishing
+#   to use, modify, copy, or redistribute it subject to the terms
+#   and conditions of the GNU General Public License version 2.
+#
+#   This program is distributed in the hope that it will be
+#   useful, but WITHOUT ANY WARRANTY; without even the implied
+#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+#   PURPOSE. See the GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public
+#   License along with this program; if not, write to the Free
+#   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+#   Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+export TEST=/CoreOS/selinux-policy/Regression/systemd-localed
+export TESTVERSION=1.0
+
+BUILT_FILES=
+
+FILES=$(METADATA) runtest.sh Makefile
+
+.PHONY: all install download clean
+
+run: $(FILES) build
+	./runtest.sh
+
+build: $(BUILT_FILES)
+	test -x runtest.sh || chmod a+x runtest.sh
+	test -x runtest.sh || chcon -t bin_t runtest.sh
+
+clean:
+	rm -f *~ $(BUILT_FILES)
+
+include /usr/share/rhts/lib/rhts-make.include
+
+$(METADATA): Makefile
+	@echo "Owner:           Milos Malik <mmalik@redhat.com>" > $(METADATA)
+	@echo "Name:            $(TEST)" >> $(METADATA)
+	@echo "TestVersion:     $(TESTVERSION)" >> $(METADATA)
+	@echo "Path:            $(TEST_DIR)" >> $(METADATA)
+	@echo "Description:     SELinux interferes with systemd-localed and localectl" >> $(METADATA)
+	@echo "Type:            Regression" >> $(METADATA)
+	@echo "TestTime:        10m" >> $(METADATA)
+	@echo "RunFor:          selinux-policy" >> $(METADATA)
+	@echo "RunFor:          systemd" >> $(METADATA)
+	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console /usr/sbin/service systemd" >> $(METADATA)
+	@echo "RhtsRequires:    library(selinux-policy/common)" >> $(METADATA)
+	@echo "Priority:        Normal" >> $(METADATA)
+	@echo "License:         GPLv2" >> $(METADATA)
+	@echo "Confidential:    no" >> $(METADATA)
+	@echo "Destructive:     no" >> $(METADATA)
+	@echo "Environment:     AVC_ERROR=+no_avc_check" >> $(METADATA)
+	@echo "Releases:        -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA)
+	@echo "Bug:             2240159" >> $(METADATA) # Fedora 38
+	@echo "Bug:             RHEL-16715" >> $(METADATA) # RHEL-8
+	@echo "Bug:             RHEL-16716" >> $(METADATA) # RHEL-9
+
+	rhts-lint $(METADATA)
+

diff --git a/selinux-policy/systemd-localed/main.fmf b/selinux-policy/systemd-localed/main.fmf
index 151a009..02d31cc 100644
--- a/selinux-policy/systemd-localed/main.fmf
+++ b/selinux-policy/systemd-localed/main.fmf
@@ -1,5 +1,5 @@
 summary: SELinux interferes with systemd-localed and localectl
-test: ./test.sh
+test: ./runtest.sh
 framework: beakerlib
 contact: Milos Malik <mmalik@redhat.com>
 component:
@@ -28,6 +28,8 @@ tag:
   - targeted
 link:
   - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2240159
+  - verifies: https://issues.redhat.com/browse/RHEL-16715
+  - verifies: https://issues.redhat.com/browse/RHEL-16716
 adjust:
   - enabled: false
     when: distro == rhel-4, rhel-5, rhel-6, rhel-7

diff --git a/selinux-policy/systemd-localed/runtest.sh b/selinux-policy/systemd-localed/runtest.sh
new file mode 100755
index 0000000..e104b55
--- /dev/null
+++ b/selinux-policy/systemd-localed/runtest.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+PACKAGE="selinux-policy"
+SERVICE_PACKAGE="systemd"
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlRun "rlImport 'selinux-policy/common'"
+        rlAssertRpm ${PACKAGE}
+        rlAssertRpm ${PACKAGE}-targeted
+        rlAssertRpm ${SERVICE_PACKAGE}
+
+        rlServiceStop systemd-localed
+        rlFileBackup --clean --missing-ok /etc/X11/xorg.conf.d
+
+        rlSESetEnforce
+        rlSEStatus
+        rlSESetTimestamp
+        sleep 2
+    rlPhaseEnd
+
+    rlPhaseStartTest "bz#2240159 + RHEL-16715 + RHEL-16716"
+        rlSEMatchPathCon "/usr/lib/systemd/systemd-localed" "systemd_localed_exec_t"
+        rlSEMatchPathCon "/etc/X11/xorg.conf.d" "xserver_etc_t"
+        rlSESearchRule "allow systemd_localed_t xserver_etc_t : dir { create } [ ]"
+    rlPhaseEnd
+
+    rlPhaseStartTest "real scenario -- bz#2240159"
+        if [ -d /etc/X11/xorg.conf.d ] ; then
+            rlRun "rpm -qf /etc/X11/xorg.conf.d" 0,1
+            rlRun "rm -rf /etc/X11/xorg.conf.d"
+        fi
+        rlRun "service systemd-localed start"
+        rlRun "service systemd-localed status"
+        rlRun "localectl set-x11-keymap us"
+        rlRun "ls -lZ /etc/X11/xorg.conf.d"
+        rlRun "service systemd-localed stop"
+        rlRun "service systemd-localed status" 3
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        sleep 2
+        rlSECheckAVC
+
+        rlFileRestore
+        rlServiceRestore systemd-localed
+    rlPhaseEnd
+rlJournalEnd
+

diff --git a/selinux-policy/systemd-localed/test.sh b/selinux-policy/systemd-localed/test.sh
deleted file mode 100755
index 84ba7d2..0000000
--- a/selinux-policy/systemd-localed/test.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-. /usr/share/beakerlib/beakerlib.sh || exit 1
-
-PACKAGE="selinux-policy"
-SERVICE_PACKAGE="systemd"
-
-rlJournalStart
-    rlPhaseStartSetup
-        rlRun "rlImport 'selinux-policy/common'"
-        rlAssertRpm ${PACKAGE}
-        rlAssertRpm ${PACKAGE}-targeted
-        rlAssertRpm ${SERVICE_PACKAGE}
-
-        rlServiceStop systemd-localed
-        rlFileBackup --clean --missing-ok /etc/X11/xorg.conf.d
-
-        rlSESetEnforce
-        rlSEStatus
-        rlSESetTimestamp
-        sleep 2
-    rlPhaseEnd
-
-    rlPhaseStartTest "bz#2240159"
-        rlSEMatchPathCon "/usr/lib/systemd/systemd-localed" "systemd_localed_exec_t"
-        rlSEMatchPathCon "/etc/X11/xorg.conf.d" "xserver_etc_t"
-        rlSESearchRule "allow systemd_localed_t xserver_etc_t : dir { create } [ ]"
-    rlPhaseEnd
-
-    rlPhaseStartTest "real scenario -- bz#2240159"
-        if [ -d /etc/X11/xorg.conf.d ] ; then
-            rlRun "rpm -qf /etc/X11/xorg.conf.d" 0,1
-            rlRun "rm -rf /etc/X11/xorg.conf.d"
-        fi
-        rlRun "service systemd-localed start"
-        rlRun "service systemd-localed status"
-        rlRun "localectl set-x11-keymap us"
-        rlRun "ls -lZ /etc/X11/xorg.conf.d"
-        rlRun "service systemd-localed stop"
-        rlRun "service systemd-localed status" 3
-    rlPhaseEnd
-
-    rlPhaseStartCleanup
-        sleep 2
-        rlSECheckAVC
-
-        rlFileRestore
-        rlServiceRestore systemd-localed
-    rlPhaseEnd
-rlJournalEnd
-

                 reply	other threads:[~2026-09-11 13:21 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=178913287243.1.1667465896700621799.tests-selinux-fec8a047876d@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