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.
This commit is contained in:
parent
d19d933fe8
commit
804932f2ad
1 changed files with 7 additions and 4 deletions
|
|
@ -9,10 +9,6 @@ function greenprint {
|
||||||
# function to override template respositores with system repositories which contain rpmrepos snapshots
|
# function to override template respositores with system repositories which contain rpmrepos snapshots
|
||||||
function template_override {
|
function template_override {
|
||||||
sudo dnf -y install jq
|
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
|
# TODO: remove this, once mock-core-configs ships a template for RHEL-10
|
||||||
# Use RHEL-9 template as the baseline for now.
|
# 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"
|
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
|
# 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"
|
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 cp /etc/mock/rhel-{9,10}-"$(uname -m)".cfg
|
||||||
sudo sed -i "s/rhel-9/rhel-10/" "/etc/mock/rhel-10-$(uname -m).cfg"
|
sudo sed -i "s/rhel-9/rhel-10/" "/etc/mock/rhel-10-$(uname -m).cfg"
|
||||||
fi
|
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
|
if [[ "$ID" == rhel ]]; then
|
||||||
TEMPLATE=${ID}-${VERSION_ID%.*}.tpl
|
TEMPLATE=${ID}-${VERSION_ID%.*}.tpl
|
||||||
# disable subscription for nightlies
|
# disable subscription for nightlies
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue