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 Makefile to enable runs via STI
Date: Fri, 11 Sep 2026 13:20:07 GMT [thread overview]
Message-ID: <178913280733.1.7490620133134467532.tests-selinux-98145eff71b9@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 98145eff71b99bba0d9fe1da88b29a1d3173c91e
Author : Milos Malik <mmalik@redhat.com>
Date : 2022-08-02T10:00:37+02:00
Stats : +102/-23 in 4 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/98145eff71b99bba0d9fe1da88b29a1d3173c91e?branch=pr775-checkpolicy-revdeps
Log:
add Makefile to enable runs via STI
Some CI frameworks still use STI which depends on existence of the
Makefile. In order to run this TC successfully in such frameworks,
the Makefile was added. Test description was also improved.
---
diff --git a/policycoreutils/semanage-imports-port-defs/Makefile b/policycoreutils/semanage-imports-port-defs/Makefile
new file mode 100644
index 0000000..d977007
--- /dev/null
+++ b/policycoreutils/semanage-imports-port-defs/Makefile
@@ -0,0 +1,67 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Makefile of /CoreOS/policycoreutils/Regression/semanage-imports-port-defs
+# Description: Can semanage import SELinux port definitions correctly?
+# Author: Milos Malik <mmalik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2020 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/policycoreutils/Regression/semanage-imports-port-defs
+export TESTVERSION=1.0
+
+BUILT_FILES=
+
+FILES=$(METADATA) runtest.sh Makefile
+
+.PHONY: all install download clean
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ chmod a+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: Can semanage import SELinux port definitions correctly?" >> $(METADATA)
+ @echo "Type: Regression" >> $(METADATA)
+ @echo "TestTime: 10m" >> $(METADATA)
+ @echo "RunFor: policycoreutils" >> $(METADATA)
+ @echo "Requires: policycoreutils /usr/sbin/semanage" >> $(METADATA)
+ @echo "Priority: Normal" >> $(METADATA)
+ @echo "License: GPLv2" >> $(METADATA)
+ @echo "Confidential: no" >> $(METADATA)
+ @echo "Destructive: no" >> $(METADATA)
+ @echo "Releases: -RHEL4 -RHEL5 -RHEL6" >> $(METADATA)
+ @echo "Bug: 2063353" >> $(METADATA) # RHEL-8
+ @echo "Bug: 2108174" >> $(METADATA) # RHEL-9
+
+ rhts-lint $(METADATA)
+
diff --git a/policycoreutils/semanage-imports-port-defs/main.fmf b/policycoreutils/semanage-imports-port-defs/main.fmf
index b06c827..87d7764 100644
--- a/policycoreutils/semanage-imports-port-defs/main.fmf
+++ b/policycoreutils/semanage-imports-port-defs/main.fmf
@@ -1,5 +1,8 @@
summary: Can semanage import SELinux port definitions correctly?
-test: ./test.sh
+description: |+
+ Can semanage import SELinux port definitions correctly?
+
+test: ./runtest.sh
contact: Milos Malik <mmalik@redhat.com>
framework: beakerlib
component:
@@ -17,3 +20,4 @@ adjust:
- enabled: false
when: distro == rhel-4, rhel-5, rhel-6
because: the test is not relevant there
+extra-nitrate: TC#0614161
diff --git a/policycoreutils/semanage-imports-port-defs/runtest.sh b/policycoreutils/semanage-imports-port-defs/runtest.sh
new file mode 100755
index 0000000..bdd7d52
--- /dev/null
+++ b/policycoreutils/semanage-imports-port-defs/runtest.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /CoreOS/policycoreutils/Regression/semanage-imports-port-defs
+# Description: Can semanage import SELinux port definitions correctly?
+# Author: Milos Malik <mmalik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlAssertRpm policycoreutils
+ rlRun "rpm -qf /usr/sbin/semanage"
+ rlRun "semanage port -a -t http_cache_port_t -r s0 -p tcp 3024"
+ rlPhaseEnd
+
+ rlPhaseStartTest "bz#2063353 + bz#2108174"
+ rlRun "semanage port -E"
+ rlRun "echo -e 'port -D\nport -a -t http_cache_port_t -r s0 -p tcp 3024' | semanage import"
+ rlRun "semanage port -E"
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ rlRun "semanage port -d -t http_cache_port_t -r s0 -p tcp 3024"
+ rlPhaseEnd
+rlJournalEnd
+
diff --git a/policycoreutils/semanage-imports-port-defs/test.sh b/policycoreutils/semanage-imports-port-defs/test.sh
deleted file mode 100755
index 29a0ae3..0000000
--- a/policycoreutils/semanage-imports-port-defs/test.sh
+++ /dev/null
@@ -1,22 +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
-
-rlJournalStart
- rlPhaseStartSetup
- rlAssertRpm policycoreutils
- rlRun "rpm -qf /usr/sbin/semanage"
- rlRun "semanage port -a -t http_cache_port_t -r s0 -p tcp 3024"
- rlPhaseEnd
-
- rlPhaseStartTest "bz#2063353 + bz#2108174"
- rlRun "semanage port -E"
- rlRun "echo -e 'port -D\nport -a -t http_cache_port_t -r s0 -p tcp 3024' | semanage import"
- rlRun "semanage port -E"
- rlPhaseEnd
-
- rlPhaseStartCleanup
- rlRun "semanage port -d -t http_cache_port_t -r s0 -p tcp 3024"
- rlPhaseEnd
-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=178913280733.1.7490620133134467532.tests-selinux-98145eff71b9@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