From 4e17a6f8d59354580614d94f21b1e3c6cf5daa1a Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Mon, 8 Jul 2024 19:28:37 +0000 Subject: [PATCH] initial commit --- test/force-auto.py.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/force-auto.py.in b/test/force-auto.py.in index 0184fd2da..48fa0a519 100644 --- a/test/force-auto.py.in +++ b/test/force-auto.py.in @@ -116,6 +116,14 @@ class Test(abc.ABC): return "\n".join("RUN %s" % run for run in runs) def test(self): + # kludge up a way to fix centos mirror issue + if (self.base == "centos:7"): + kludge = 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\n""" + else: + kludge = "" # skip? if (self.preprep and not (self.force and self.run == Run.NEEDED)): print(f"\n# skip: {self}: not needed") @@ -186,7 +194,7 @@ scope {scope} # build 2: image we're testing run ch-image -v build {force} -t tmpimg2 -f - . << 'EOF' FROM {build2_base} -RUN {run} +{kludge}RUN {run} EOF echo "$output" [[ $status -eq {status} ]] @@ -226,7 +234,11 @@ class RHEL7(Test): class T_CentOS_7(RHEL7, EPEL_Mixin): scope = Scope.STANDARD base = "centos:7" - prep_run = "yum install -y epel-release" + prep_run = f"""\ +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 \ +&& yum install -y epel-release""" class RHEL8(Test):