From 833156bf27449857a375c9a523ac8d6642c4b08c Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Mon, 29 Jul 2024 13:21:51 -0600 Subject: [PATCH] PR #1909: centos:7 mirror fix --- test/force-auto.py.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/force-auto.py.in b/test/force-auto.py.in index 0184fd2da..173ebbd7d 100644 --- a/test/force-auto.py.in +++ b/test/force-auto.py.in @@ -84,6 +84,10 @@ class Test(abc.ABC): def build2_post_hook(self): return "" + @property + def build_from_hook(self): + return "" + @property def skip(self): if (self.skip_reason is None): @@ -147,6 +151,7 @@ class Test(abc.ABC): build1 = f"""\ run ch-image -v build -t tmpimg -f - . << 'EOF' FROM {self.base} +{self.build_from_hook} RUN {self.prep_run} EOF echo "$output" @@ -186,6 +191,7 @@ scope {scope} # build 2: image we're testing run ch-image -v build {force} -t tmpimg2 -f - . << 'EOF' FROM {build2_base} +{self.build_from_hook} RUN {run} EOF echo "$output" @@ -228,6 +234,13 @@ class T_CentOS_7(RHEL7, EPEL_Mixin): base = "centos:7" prep_run = "yum install -y epel-release" + @property + def build_from_hook(self): + return f"""\ +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo \ + && sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo \ + && sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo""" + class RHEL8(Test): config = "rhel8"