summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-05-20 16:09:40 -0400
committerMatthew Heon <mheon@redhat.com>2021-05-25 15:25:02 -0400
commitba884865c58d83d7a020bfb7fe90a182ebbe1405 (patch)
tree9e7ca87227bdedd1d440767442fb0d2cb62deba9 /test
parentc53638e9f61e61b1344cbf090c9766a1891c8a44 (diff)
downloadpodman-ba884865c58d83d7a020bfb7fe90a182ebbe1405.tar.gz
podman-ba884865c58d83d7a020bfb7fe90a182ebbe1405.tar.bz2
podman-ba884865c58d83d7a020bfb7fe90a182ebbe1405.zip
Handle hard links in remote builds
Fixes: https://github.com/containers/podman/issues/9893 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/system/070-build.bats20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index d2d56c051..9e1559013 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -766,6 +766,26 @@ EOF
is "$output" ".*/tmp/bogus: no such file or directory"
}
+@test "podman build COPY hardlinks " {
+ tmpdir=$PODMAN_TMPDIR/build-test
+ mkdir -p $tmpdir
+
+ dockerfile=$tmpdir/Dockerfile
+ cat >$dockerfile <<EOF
+FROM $IMAGE
+COPY . /test
+EOF
+ ln $dockerfile $tmpdir/hardlink
+
+ run_podman build -t build_test $tmpdir
+ run_podman run --rm build_test stat -c '%i' /test/Dockerfile
+ dinode=$output
+ run_podman run --rm build_test stat -c '%i' /test/hardlink
+ is "$output" "$dinode" "COPY hardlinks work"
+
+ run_podman rmi -f build_test
+}
+
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