Skip to content

Commit

Permalink
Integration tests: switch some base images
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nalind committed Nov 5, 2024
1 parent 9d1300f commit 048b3e0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion tests/bud.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -4450,15 +4451,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" {
Expand Down
3 changes: 2 additions & 1 deletion tests/bud/build-with-from/Containerfile
Original file line number Diff line number Diff line change
@@ -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

5 changes: 2 additions & 3 deletions tests/bud/copy-chown/Containerfile.chown_user
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests/bud/dupe-arg-env-name/Containerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM centos:8
FROM busybox
ARG FOO=bar
ARG WEBROOT=https://example.org/

Expand Down
5 changes: 4 additions & 1 deletion tests/bud/heredoc/Containerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM fedora
FROM quay.io/fedora/python-311

USER root
WORKDIR /

RUN <<EOF
echo "print first line from heredoc"
Expand Down

0 comments on commit 048b3e0

Please sign in to comment.