Add selinux-policy-epel test plan

- should be triggered only in CI by commit
- should check current selinux-policy version and latest
  selinux-policy-epel version and fail if they're different to notify
  maintainer about needed action

Related: RHEL-74424
This commit is contained in:
Petr Lautrbach 2025-04-09 18:03:00 +02:00
parent 61db7c0bba
commit 94ea41534e
2 changed files with 33 additions and 0 deletions

View File

@ -13,3 +13,11 @@ execute:
url: https://src.fedoraproject.org/tests/selinux.git
filter: "component:selinux-policy & tag:-failinfedora & tag:-epel"
/selinux-policy-epel:
discover:
name: tests related to selinux-policy-epel
how: shell
tests:
- name: check selinux-policy-epel version
require: [git,rpm-build]
test: ./tests/check-selinux-policy-epel-version.sh

View File

@ -0,0 +1,25 @@
#!/usr/bin/bash
SELINUX_POLICY_VERSION=$(rpm -q --qf '%{version}' selinux-policy)
TMP_DIR=`mktemp -d --tmpdir selinux-policy-epel.XXXXXX`
pushd ${TMP_DIR} > /dev/null
git clone --depth=1 -q https://src.fedoraproject.org/rpms/selinux-policy-epel -b epel10
pushd selinux-policy-epel > /dev/null
SELINUX_POLICY_EPEL_VERSION=$(rpmspec -q --queryformat='%{version}' --srpm selinux-policy-epel.spec)
popd > /dev/null
rm -rf ${TMP_DIR}
if [ "${SELINUX_POLICY_VERSION}" != "${SELINUX_POLICY_EPEL_VERSION}" ]; then
echo "selinux-policy version ${SELINUX_POLICY_VERSION} does not match selinux-policy-epel version ${SELINUX_POLICY_EPEL_VERSION}"
echo "Please update selinux-policy-epel, see" \
"https://src.fedoraproject.org/rpms/selinux-policy-epel/raw/epel10/f/README.md"
exit 1
fi
echo "selinux-policy version ${SELINUX_POLICY_VERSION} matches selinux-policy-epel version ${SELINUX_POLICY_EPEL_VERSION}"
exit 0