From 9a28fd843a377025e8510e21bdb60b6ab0304b44 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 | 5 ++++- 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(+), 7 deletions(-) diff --git a/tests/bud.bats b/tests/bud.bats index b6982bbc0ee..09e76c1f4ed 100644 --- a/tests/bud.bats +++ b/tests/bud.bats @@ -329,6 +329,7 @@ _EOF } @test "bud build with heredoc content" { + _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" @@ -4453,15 +4454,17 @@ EOM } @test "bud arg and env var with same name" { + _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 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 d25cad9771c..dbd0d0c8e1a 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 08a2e58c9f9..e8f69fadb8b 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 62bbf1249f7..a5723824913 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 878ba091781..7f52eb07c0d 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 <