diff --git a/tests/bud.bats b/tests/bud.bats index d17ba83268a..a8ad48e4f0f 100644 --- a/tests/bud.bats +++ b/tests/bud.bats @@ -2104,3 +2104,15 @@ EOM run_buildah --log-level "warn" bud --signature-policy ${TESTSDIR}/policy.json -t test ${TESTSDIR}/bud/build-arg expect_output --substring 'missing .+ build argument' } + +@test "bud arg and env var with same name" { + # Regresion test for https://github.com/containers/buildah/issues/2345 + run_buildah bud --signature-policy ${TESTSDIR}/policy.json -t testctr ${TESTSDIR}/bud/dupe-arg-env-name + expect_output --substring "https://example.org/bar" +} + +@test "bud copy chown with newuser" { + # Regression test for https://github.com/containers/buildah/issues/2192 + run_buildah bud --signature-policy ${TESTSDIR}/policy.json -t testctr -f ${TESTSDIR}/bud/copy-chown/Containerfile.chown_user ${TESTSDIR}/bud/copy-chown + expect_output --substring "myuser myuser" +} diff --git a/tests/bud/copy-chown/Containerfile.chown_user b/tests/bud/copy-chown/Containerfile.chown_user new file mode 100644 index 00000000000..08a2e58c9f9 --- /dev/null +++ b/tests/bud/copy-chown/Containerfile.chown_user @@ -0,0 +1,8 @@ +FROM ubuntu:latest + +ENV MYUSER=myuser + +RUN useradd --create-home --home /"${MYUSER}" "${MYUSER}" +COPY --chown="${MYUSER}" ./copychown.txt /somewhere + +RUN ls -alF /somewhere diff --git a/tests/bud/dupe-arg-env-name/Containerfile b/tests/bud/dupe-arg-env-name/Containerfile new file mode 100644 index 00000000000..62bbf1249f7 --- /dev/null +++ b/tests/bud/dupe-arg-env-name/Containerfile @@ -0,0 +1,7 @@ +FROM centos:8 +ARG FOO=bar +ARG WEBROOT=https://example.org/ + +ENV WEBROOT="$WEBROOT$FOO" + +RUN echo "${WEBROOT}"