Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaudill committed Jul 8, 2024
1 parent be42e3e commit 4e17a6f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/force-auto.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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} ]]
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 4e17a6f

Please sign in to comment.