Skip to content

Commit

Permalink
Add bud regression tests
Browse files Browse the repository at this point in the history
We recently made a couple of commits to the imagebuilder
project to address #2345 and #2192.  Tests were created
in that project, but I thought it best to add some
regression tests here in Buildah too.

FYI: @petr-motejlek and @tachoknight

Signed-off-by: TomSweeneyRedHat <[email protected]>
  • Loading branch information
TomSweeneyRedHat committed Jun 30, 2020
1 parent 4fd8811 commit d29655b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/bud.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
8 changes: 8 additions & 0 deletions tests/bud/copy-chown/Containerfile.chown_user
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions tests/bud/dupe-arg-env-name/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM centos:8
ARG FOO=bar
ARG WEBROOT=https://example.org/

ENV WEBROOT="$WEBROOT$FOO"

RUN echo "${WEBROOT}"

0 comments on commit d29655b

Please sign in to comment.