summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-15 08:15:11 -0400
committerGitHub <noreply@github.com>2021-07-15 08:15:11 -0400
commit47f351769bbf9e06ec47d340943e5a494d586e79 (patch)
tree29a7918e71c800ef3571635ee05e9a4cda901bb2 /test
parent61245884abb181ee4dd46280a56dec5f25d2432d (diff)
parentc9970647ba6338aeb29c1bd82d8f22f33b1880b9 (diff)
downloadpodman-47f351769bbf9e06ec47d340943e5a494d586e79.tar.gz
podman-47f351769bbf9e06ec47d340943e5a494d586e79.tar.bz2
podman-47f351769bbf9e06ec47d340943e5a494d586e79.zip
Merge pull request #10913 from rhatdan/build
podman-remote build use .containerignore over .dockerignore
Diffstat (limited to 'test')
-rw-r--r--test/system/070-build.bats40
1 files changed, 39 insertions, 1 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index 7046625c6..06ff0c9e2 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -851,7 +851,7 @@ EOF
run_podman rmi -f build_test
}
-@test "podman build -f test " {
+@test "podman build -f test" {
tmpdir=$PODMAN_TMPDIR/build-test
subdir=$tmpdir/subdir
mkdir -p $subdir
@@ -877,6 +877,44 @@ EOF
run_podman rmi -f build_test
}
+@test "podman build .dockerignore failure test" {
+ tmpdir=$PODMAN_TMPDIR/build-test
+ subdir=$tmpdir/subdir
+ mkdir -p $subdir
+
+ cat >$tmpdir/.dockerignore <<EOF
+*
+subdir
+!*/sub1*
+EOF
+ cat >$tmpdir/Containerfile <<EOF
+FROM $IMAGE
+COPY ./ ./
+COPY subdir ./
+EOF
+ run_podman 125 build -t build_test $tmpdir
+ is "$output" ".*Error: error building at STEP \"COPY subdir ./\"" ".dockerignore was ignored"
+}
+
+@test "podman build .containerignore and .dockerignore test" {
+ tmpdir=$PODMAN_TMPDIR/build-test
+ mkdir -p $tmpdir
+ touch $tmpdir/test1 $tmpdir/test2
+ cat >$tmpdir/.containerignore <<EOF
+test2*
+EOF
+ cat >$tmpdir/.dockerignore <<EOF
+test1*
+EOF
+ cat >$tmpdir/Containerfile <<EOF
+FROM $IMAGE
+COPY ./ /tmp/test/
+RUN ls /tmp/test/
+EOF
+ run_podman build -t build_test $tmpdir
+ is "$output" ".*test1" "test1 should exists in the final image"
+}
+
function teardown() {
# A timeout or other error in 'build' can leave behind stale images
# that podman can't even see and which will cascade into subsequent