Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bud regression tests #2422

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"