From abce7eaf4eb16cb412930831d956b8bf98f68b48 Mon Sep 17 00:00:00 2001 From: Martin Zihlmann Date: Sun, 25 May 2025 19:46:04 +0100 Subject: [PATCH] add integration test --- integration/dockerfiles/Dockerfile_test_issue_3429 | 13 +++++++++++++ integration/images.go | 1 + 2 files changed, 14 insertions(+) create mode 100644 integration/dockerfiles/Dockerfile_test_issue_3429 diff --git a/integration/dockerfiles/Dockerfile_test_issue_3429 b/integration/dockerfiles/Dockerfile_test_issue_3429 new file mode 100644 index 000000000..e67987e28 --- /dev/null +++ b/integration/dockerfiles/Dockerfile_test_issue_3429 @@ -0,0 +1,13 @@ +FROM ubuntu + +RUN mkdir /test \ + && ln -s /test /link + +# Fails on main@1d2bff5 before #3429: On the second run, +# when extracting from cache, we first delete the /test directory +# and thereafter fail to replace the link with a directory. +# The link is now broken and 'stat' returns an error. +# On build this works as we first delete the link, +# and only thereafter create the directory. +RUN rm -rf /test /link \ + && mkdir /link diff --git a/integration/images.go b/integration/images.go index ccf675c61..b717fd4f9 100644 --- a/integration/images.go +++ b/integration/images.go @@ -218,6 +218,7 @@ func NewDockerFileBuilder() *DockerFileBuilder { "Dockerfile_test_cache_install": {}, "Dockerfile_test_cache_perm": {}, "Dockerfile_test_cache_copy": {}, + "Dockerfile_test_issue_3429": {}, } d.TestOCICacheDockerfiles = map[string]struct{}{ "Dockerfile_test_cache_oci": {},