From 804932f2ad43940cc50bc444f2c4ab5b519e4cae Mon Sep 17 00:00:00 2001 From: Tom Koscielniak Date: Wed, 2 Jul 2025 15:10:22 +0200 Subject: [PATCH] tests/CI: Fix RHEL 10 mock config creation and repo URLs Fix RHEL 10 mock confings not being created if the machine was subscribed and fix RHEL 9 being used in the RHEL 10 mock confings for a repo path. These issues caused the rpm jobs for RHEL 10 GA to fail. --- schutzbot/mockbuild.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index 27e575a3f..eb4eb2321 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -9,10 +9,6 @@ function greenprint { # function to override template respositores with system repositories which contain rpmrepos snapshots function template_override { sudo dnf -y install jq - if sudo subscription-manager status; then - greenprint "📋 Running on subscribed RHEL machine, no mock template override done." - return 0 - fi # TODO: remove this, once mock-core-configs ships a template for RHEL-10 # Use RHEL-9 template as the baseline for now. @@ -23,11 +19,18 @@ function template_override { sudo sed -i "s/config_opts\['releasever'\] = '9'/config_opts\['releasever'\] = '10'/" /etc/mock/templates/"$TEMPLATE" # disable bootstrap image for el10, as there is none yet sudo sed -i "s/config_opts\['bootstrap_image_ready'\] = True/config_opts\['bootstrap_image_ready'\] = False/" /etc/mock/templates/"$TEMPLATE" + # update hardcoded rhel9 paths to rhel10 in repository URLs + sudo sed -i "s/rhel9/rhel10/g" /etc/mock/templates/"$TEMPLATE" sudo cp /etc/mock/rhel-{9,10}-"$(uname -m)".cfg sudo sed -i "s/rhel-9/rhel-10/" "/etc/mock/rhel-10-$(uname -m).cfg" fi + if sudo subscription-manager status; then + greenprint "📋 Running on subscribed RHEL machine, no mock template override done." + return 0 + fi + if [[ "$ID" == rhel ]]; then TEMPLATE=${ID}-${VERSION_ID%.*}.tpl # disable subscription for nightlies