diff options
author | joerg <joerg@pkgsrc.org> | 2017-02-25 20:53:51 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2017-02-25 20:53:51 +0000 |
commit | c8fcd52665c6781876ed54832bd7f6ea46348688 (patch) | |
tree | b5165a0dff599b0ae48d70b5104febf7f8732828 /archivers/libarchive/files/tar/test/test_symlink_dir.c | |
parent | f67a2b170587775e96627a49fc615267312586d3 (diff) | |
download | pkgsrc-c8fcd52665c6781876ed54832bd7f6ea46348688.tar.gz |
Import libarchive-3.3.1.
Diffstat (limited to 'archivers/libarchive/files/tar/test/test_symlink_dir.c')
-rw-r--r-- | archivers/libarchive/files/tar/test/test_symlink_dir.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/archivers/libarchive/files/tar/test/test_symlink_dir.c b/archivers/libarchive/files/tar/test/test_symlink_dir.c index f6e99662bf1..852e00b37c6 100644 --- a/archivers/libarchive/files/tar/test/test_symlink_dir.c +++ b/archivers/libarchive/files/tar/test/test_symlink_dir.c @@ -47,11 +47,18 @@ DEFINE_TEST(test_symlink_dir) assertMakeDir("source/dir3", 0755); assertMakeDir("source/dir3/d3", 0755); assertMakeFile("source/dir3/f3", 0755, "abcde"); + assertMakeDir("source/dir4", 0755); + assertMakeFile("source/dir4/file3", 0755, "abcdef"); + assertMakeHardlink("source/dir4/file4", "source/dir4/file3"); assertEqualInt(0, systemf("%s -cf test.tar -C source dir dir2 dir3 file file2", testprog)); + /* Second archive with hardlinks */ + assertEqualInt(0, + systemf("%s -cf test2.tar -C source dir4", testprog)); + /* * Extract with -x and without -P. */ @@ -63,7 +70,7 @@ DEFINE_TEST(test_symlink_dir) /* "dir2" is a symlink to a non-existing "real_dir2" */ assertMakeSymlink("dest1/dir2", "real_dir2"); } else { - skipping("some symlink checks"); + skipping("Symlinks are not supported on this platform"); } /* "dir3" is a symlink to an existing "non_dir3" */ assertMakeFile("dest1/non_dir3", 0755, "abcdef"); @@ -118,9 +125,15 @@ DEFINE_TEST(test_symlink_dir) assertMakeSymlink("dest2/file2", "real_file2"); assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog)); - /* dest2/dir symlink should be followed */ + /* "dir4" is a symlink to existing "real_dir" */ + if (canSymlink()) + assertMakeSymlink("dest2/dir4", "real_dir"); + assertEqualInt(0, systemf("%s -xPf test2.tar -C dest2", testprog)); + + /* dest2/dir and dest2/dir4 symlinks should be followed */ if (canSymlink()) { assertIsSymlink("dest2/dir", "real_dir"); + assertIsSymlink("dest2/dir4", "real_dir"); assertIsDir("dest2/real_dir", -1); } @@ -141,4 +154,7 @@ DEFINE_TEST(test_symlink_dir) /* dest2/file2 symlink should be removed */ failure("Symlink to non-existing file should be removed"); assertIsReg("dest2/file2", -1); + + /* dest2/dir4/file3 and dest2/dir4/file4 should be hard links */ + assertIsHardlink("dest2/dir4/file3", "dest2/dir4/file4"); } |