Skip to content

Commit

Permalink
test(deb): add test for multiple dangling hardlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornplusplus authored and zhijie-yang committed Dec 3, 2024
1 parent 87a5717 commit 858524d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/deb/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,23 @@ var extractTests = []extractTest{{
},
},
error: `cannot extract from package "test-package": internal error: hard link target missing: /hardlink -> /non-existing-target`,
}, {
summary: "Multiple dangling hard links",
pkgdata: testutil.MustMakeDeb([]testutil.TarEntry{
testutil.Dir(0755, "./"),
testutil.Hlk(0644, "./hardlink1", "./non-existing-target"),
testutil.Hlk(0644, "./hardlink2", "./non-existing-target"),
}),
options: deb.ExtractOptions{
Extract: map[string][]deb.ExtractInfo{
"/**": []deb.ExtractInfo{{
Path: "/**",
}},
},
},
error: `cannot extract from package "test-package": internal error: hard link targets missing:` +
`\n- /hardlink1 -> /non-existing-target` +
`\n- /hardlink2 -> /non-existing-target`,
}, {
summary: "Hard link is linked to the target file",
pkgdata: testutil.MustMakeDeb([]testutil.TarEntry{
Expand Down

0 comments on commit 858524d

Please sign in to comment.