From d372a538ce49c22ca3f08ed718e37a68dbd6c7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 24 May 2021 00:11:58 +0300 Subject: [PATCH] add hardlink test --- rootfs/rootfs_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rootfs/rootfs_test.go b/rootfs/rootfs_test.go index 1c6ec61..9590c78 100644 --- a/rootfs/rootfs_test.go +++ b/rootfs/rootfs_test.go @@ -64,6 +64,21 @@ func TestRootFS(t *testing.T) { file{Name: "/file", Uid: 1, Contents: bytes.NewBufferString("from 1")}, }, }, + { + name: "overwrite file with hardlink", + image: tarball{ + file{Name: "layer0/layer.tar", Contents: tarball{ + file{Name: "a"}, + }}, + file{Name: "layer1/layer.tar", Contents: tarball{ + hardlink{Name: "a"}, + }}, + manifest{"layer0/layer.tar", "layer1/layer.tar"}, + }, + want: []extractable{ + hardlink{Name: "a"}, + }, + }, { name: "directory overwrite retains original dir", image: tarball{