From e0077e8c67756f54a16a551cf34d20eba67db2c2 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 25 Apr 2024 15:30:22 -0400 Subject: [PATCH] Integration tests: switch some base images Replace some of the base images we've been using (particularly centos:8, which will EOL soon) with other images hosted on quay.io. We already use registries.conf at test-time to redirect some image references there, so this will slightly reduce the number of registries which we need to be able to reach while running these tests. Signed-off-by: Nalin Dahyabhai --- tests/bud.bats | 8 ++++---- tests/bud/build-with-from/Containerfile | 3 ++- tests/bud/copy-chown/Containerfile.chown_user | 5 ++--- tests/bud/dupe-arg-env-name/Containerfile | 2 +- tests/bud/heredoc/Containerfile | 5 ++++- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/bud.bats b/tests/bud.bats index 72def3ebd4..8fa4e5f4e0 100644 --- a/tests/bud.bats +++ b/tests/bud.bats @@ -333,7 +333,7 @@ _EOF } @test "bud build with heredoc content" { - _prefetch fedora + _prefetch quay.io/fedora/python-311 run_buildah build -t heredoc $WITH_POLICY_JSON -f $BUDFILES/heredoc/Containerfile . expect_output --substring "print first line from heredoc" expect_output --substring "print second line from heredoc" @@ -4486,17 +4486,17 @@ EOM } @test "bud arg and env var with same name" { - _prefetch centos:8 + _prefetch busybox # Regression test for https://github.com/containers/buildah/issues/2345 run_buildah build $WITH_POLICY_JSON -t testctr $BUDFILES/dupe-arg-env-name expect_output --substring "https://example.org/bar" } @test "bud copy chown with newuser" { - _prefetch ubuntu:latest + _prefetch quay.io/fedora/fedora # Regression test for https://github.com/containers/buildah/issues/2192 run_buildah build $WITH_POLICY_JSON -t testctr -f $BUDFILES/copy-chown/Containerfile.chown_user $BUDFILES/copy-chown - expect_output --substring "myuser myuser" + expect_output --substring "myuser:myuser" } @test "bud-builder-identity" { diff --git a/tests/bud/build-with-from/Containerfile b/tests/bud/build-with-from/Containerfile index d25cad9771..dbd0d0c8e1 100644 --- a/tests/bud/build-with-from/Containerfile +++ b/tests/bud/build-with-from/Containerfile @@ -1,4 +1,5 @@ -FROM fedora as builder +# "fedora" is replaced as the base image at test-time using the --from flag +FROM fedora as builder FROM busybox COPY --from=builder /bin/df /tmp/df_tester diff --git a/tests/bud/copy-chown/Containerfile.chown_user b/tests/bud/copy-chown/Containerfile.chown_user index 08a2e58c9f..e8f69fadb8 100644 --- a/tests/bud/copy-chown/Containerfile.chown_user +++ b/tests/bud/copy-chown/Containerfile.chown_user @@ -1,8 +1,7 @@ -FROM ubuntu:latest +FROM quay.io/fedora/fedora ENV MYUSER=myuser - RUN useradd --create-home --home /"${MYUSER}" "${MYUSER}" COPY --chown="${MYUSER}" ./copychown.txt /somewhere -RUN ls -alF /somewhere +RUN stat -c "%U:%G" /somewhere diff --git a/tests/bud/dupe-arg-env-name/Containerfile b/tests/bud/dupe-arg-env-name/Containerfile index 62bbf1249f..a572382491 100644 --- a/tests/bud/dupe-arg-env-name/Containerfile +++ b/tests/bud/dupe-arg-env-name/Containerfile @@ -1,4 +1,4 @@ -FROM centos:8 +FROM busybox ARG FOO=bar ARG WEBROOT=https://example.org/ diff --git a/tests/bud/heredoc/Containerfile b/tests/bud/heredoc/Containerfile index 878ba09178..7f52eb07c0 100644 --- a/tests/bud/heredoc/Containerfile +++ b/tests/bud/heredoc/Containerfile @@ -1,4 +1,7 @@ -FROM fedora +FROM quay.io/fedora/python-311 + +USER root +WORKDIR / RUN <