public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] main: run the internal checkpolicy tests
@ 2026-06-03 14:37 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-06-03 14:37 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : main
            Commit : 50869431bb49cf359a34352fb3ead93bc761ecd7
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2026-06-03T14:37:36+00:00
            Stats  : +86/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/50869431bb49cf359a34352fb3ead93bc761ecd7?branch=main

            Log:
            run the internal checkpolicy tests

The checkpolicy source RPM contains not only checkpolicy sources but
also checkpolicy tests. Purpose of this automated test is to run them
with the current versions of libsepol and checkpolicy components.

---
diff --git a/checkpolicy/internal-tests/main.fmf b/checkpolicy/internal-tests/main.fmf
new file mode 100644
index 0000000..437b964
--- /dev/null
+++ b/checkpolicy/internal-tests/main.fmf
@@ -0,0 +1,28 @@
+summary: Run internal checkpolicy tests
+contact: Milos Malik <mmalik@redhat.com>
+component:
+  - checkpolicy
+require:
+  - bison
+  - checkpolicy
+  - flex
+  - gcc
+  - libsepol-devel
+  - make
+recommend:
+  - libsepol-static
+duration: 5m
+enabled: true
+tag:
+  - NoRHEL4
+  - NoRHEL5
+  - NoRHEL6
+  - NoRHEL7
+  - targeted
+  - avoidImageMode
+adjust+:
+  - enabled: false
+    when: distro == rhel-4, rhel-5, rhel-6, rhel-7
+    because: the test is not relevant there
+extra-nitrate: TC#0620041
+id: 3df4f40d-61a0-4267-b7db-6ff9f5254406

diff --git a/checkpolicy/internal-tests/runtest.sh b/checkpolicy/internal-tests/runtest.sh
new file mode 100755
index 0000000..2977950
--- /dev/null
+++ b/checkpolicy/internal-tests/runtest.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   runtest.sh of /CoreOS/checkpolicy/internal-tests
+#   Description: Run internal checkpolicy tests
+#   Author: Milos Malik <mmalik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#   Copyright (c) 2026 Red Hat, Inc.
+#
+#   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.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Include Beaker environment
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+PACKAGE="checkpolicy"
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlAssertRpm ${PACKAGE}
+        if ! rpm -q libsepol-static >& /dev/null ; then
+            rlRun "dnf install -y libsepol-static --enablerepo '*'"
+        fi
+        rlRun "rpm -qa | grep libsepol | sort"
+    rlPhaseEnd
+
+    rlPhaseStartTest "non-fuzzing tests"
+        rlRun "dnf download --source ${PACKAGE}"
+        rlRun "rpm -ivh ${PACKAGE}-*.src.rpm"
+        rlRun "rm -f ${PACKAGE}-*.src.rpm"
+        rlRun "tar zxf ~/rpmbuild/SOURCES/${PACKAGE}-*.tar.gz"
+        rlRun "pushd ${PACKAGE}-*"
+        rlRun "make test"
+        rlRun "popd"
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        rlRun "rm -rf ~/rpmbuild ${PACKAGE}-*"
+    rlPhaseEnd
+rlJournalPrintText
+rlJournalEnd
+

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-03 14:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-03 14:37 [tests/selinux] main: run the internal checkpolicy tests Milos Malik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox