public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: Rebuild and install checkpolicy
@ 2026-09-11 13:23 Jan Onderka
0 siblings, 0 replies; only message in thread
From: Jan Onderka @ 2026-09-11 13:23 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : feec2238742e804c5039cef94e0834a6f0df8140
Author : Jan Onderka <jonderka@redhat.com>
Date : 2026-09-11T14:42:24+02:00
Stats : +91/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/feec2238742e804c5039cef94e0834a6f0df8140?branch=pr775-checkpolicy-revdeps
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/libsepol/rebuild-and-install-checkpolicy/main.fmf b/libsepol/rebuild-and-install-checkpolicy/main.fmf
new file mode 100644
index 0000000..3a4371e
--- /dev/null
+++ b/libsepol/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/libsepol/rebuild-and-install-checkpolicy/runtest.sh b/libsepol/rebuild-and-install-checkpolicy/runtest.sh
new file mode 100755
index 0000000..c4fbc6e
--- /dev/null
+++ b/libsepol/rebuild-and-install-checkpolicy/runtest.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /CoreOS/checkpolicy/Sanity/rebuild-and-install
+# Description: runs package rebuild and install if needed by reverse dependency
+# Author: Jan Onderka <jonderka@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2009 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.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# 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}/"
+ # rlRun "cp ${TMT_TEST_DATA}/${PACKAGE}-rpmbuild.tar.gz -C ${RPMBUILDDIR}/ ."
+ 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
+
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 13:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:23 [tests/selinux] pr775-checkpolicy-revdeps: Rebuild and install checkpolicy Jan Onderka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox