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

Commit

Permalink
PR #1909: centos:7 mirror fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaudill authored Jul 29, 2024
1 parent be42e3e commit 833156b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/force-auto.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 833156b

Please sign in to comment.