public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jan Onderka <jonderka@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] main: Rebuild and install checkpolicy
Date: Mon, 14 Sep 2026 14:49:44 GMT [thread overview]
Message-ID: <178939738485.1.6265887961228276013.tests-selinux-0a752328f653@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : main
Commit : 0a752328f653e951184fded5c90852bfb23c1a7b
Author : Jan Onderka <jonderka@redhat.com>
Date : 2026-09-14T14:57:38+02:00
Stats : +89/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/0a752328f653e951184fded5c90852bfb23c1a7b?branch=main
Log:
Rebuild and install checkpolicy
The goal is to rebuild checkpolicy every time libsepol is updated and
install new checkpolicy build.
The test is intentionally notier without component so that it's not
picked up by existing selinux plans.
It's expected that this test will be run first in checkpolicy revdeps
plan which will invoke tests for checkpolicy component on the system
with updated checkpolicy.
Originated-by: Jan Onderka <jonderka@redhat.com>
---
diff --git a/other/rebuild-and-install-checkpolicy/main.fmf b/other/rebuild-and-install-checkpolicy/main.fmf
new file mode 100644
index 0000000..3a4371e
--- /dev/null
+++ b/other/rebuild-and-install-checkpolicy/main.fmf
@@ -0,0 +1,22 @@
+summary: Rebuild and install checkpolicy
+description: |+
+ Rebuilds checkpolicy package from its source RPM and installs it to the system.
+ This is necessary for checkpolicy reverse dependecy testing - checkpolicy statically links
+ libsepol-static and so we need to rebuild checkpolicy and run its tests every time libsepol is updated.
+
+contact:
+ - Jan Onderka <jonderka@redhat.com>
+ - Petr Lautrbach <lautrbach@redhat.com>
+test: ./runtest.sh
+framework: beakerlib
+require:
+ - libsepol-static
+ - checkpolicy
+recommend:
+ - dnf-utils
+ - rpm-build
+duration: 10m
+enabled: true
+tag:
+ - avoidImageMode
+id: 9cbc42ad-95a9-4c15-b33d-e515d683360a
diff --git a/other/rebuild-and-install-checkpolicy/runtest.sh b/other/rebuild-and-install-checkpolicy/runtest.sh
new file mode 100755
index 0000000..d2da740
--- /dev/null
+++ b/other/rebuild-and-install-checkpolicy/runtest.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of rebuild-and-install-checkpolicy
+# Description: runs package rebuild and install if needed by reverse dependency
+# Author: Jan Onderka <jonderka@redhat.com>
+# Author: Petr Lautrbach <lautrbach@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2026 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, see
+# <https://www.gnu.org/licenses/>.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Include rhts environment
+. /usr/share/beakerlib/beakerlib.sh
+
+PACKAGE="checkpolicy"
+RPMBUILDDIR="$(rpm -E '%{_topdir}')"
+ARCH_VERSION="$(uname -m)"
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlAssertRpm ${PACKAGE}
+ rlRun "rm -rf ${RPMBUILDDIR} ${PACKAGE}*"
+ rlRun "mkdir -p ${RPMBUILDDIR}"
+ rlRun "pushd ${RPMBUILDDIR}"
+ rlFetchSrcForInstalled ${PACKAGE}
+ rlRun "popd"
+ rlPhaseEnd
+
+ rlPhaseStartTest "Source code tests"
+ PACKAGE_VERSION="$(rpm -qp --qf '%{version}\n' ${RPMBUILDDIR}/checkpolicy-*.src.rpm)"
+ rlLogInfo "PACKAGE_VERSION=${PACKAGE_VERSION}"
+ rlRun "dnf builddep -y ${RPMBUILDDIR}/checkpolicy-*.src.rpm"
+ rlRun "DIST=$(rpm --eval '%{dist}')"
+ rlRun -t "rpmbuild --rebuild --define '%dist $DIST.rebuild' ${RPMBUILDDIR}/checkpolicy-*.src.rpm"
+
+ if [[ -n "${SAVE_RPMBUILD_DATA:-}" ]]; then
+ rlRun "ls ${PACKAGE}*.src.rpm > ${TMT_TEST_DATA}/src.version"
+ rlRun "cp ${RPMBUILD}/checkpolicy-*.src.rpm ${TMT_TEST_DATA}/"
+ fi
+
+ rlRun "dnf install -y ${RPMBUILDDIR}/RPMS/${ARCH_VERSION}/${PACKAGE}-${PACKAGE_VERSION}*.rpm"
+
+ rlLog "$(rpm -qa | grep checkpolicy)"
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ rlRun "rm -rf ${RPMBUILDDIR}"
+ rlPhaseEnd
+rlJournalPrintText
+rlJournalEnd
reply other threads:[~2026-09-14 14:49 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=178939738485.1.6265887961228276013.tests-selinux-0a752328f653@fedoraproject.org \
--to=jonderka@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