From 2cf6f52517a2e654f95688bb36ca1988a870f513 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 19 Nov 2018 15:03:31 -0500 Subject: [PATCH] Fix hardlink unit test Now that hardlink destinations take into account the directory that they are being extracted to, the unit test had to be updated to make sure that two hardlinks were extracted to /tmp/hardlink correctly. --- pkg/util/fs_util_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/util/fs_util_test.go b/pkg/util/fs_util_test.go index 20f80820e..3ca29aeb8 100644 --- a/pkg/util/fs_util_test.go +++ b/pkg/util/fs_util_test.go @@ -367,7 +367,7 @@ func filesAreHardlinks(first, second string) checker { if err != nil { t.Fatalf("error getting file %s", first) } - fi2, err := os.Stat(filepath.Join(second)) + fi2, err := os.Stat(filepath.Join(root, second)) if err != nil { t.Fatalf("error getting file %s", second) } @@ -499,11 +499,11 @@ func TestExtractFile(t *testing.T) { tmpdir: "/tmp/hardlink", hdrs: []*tar.Header{ fileHeader("/bin/gzip", "gzip-binary", 0751), - hardlinkHeader("/bin/uncompress", "/tmp/hardlink/bin/gzip"), + hardlinkHeader("/bin/uncompress", "/bin/gzip"), }, checkers: []checker{ fileExists("/bin/gzip"), - filesAreHardlinks("/bin/uncompress", "/tmp/hardlink/bin/gzip"), + filesAreHardlinks("/bin/uncompress", "/bin/gzip"), }, }, }