aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-10 15:39:31 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-10 15:39:31 +0100
commita39c5c7060cec7e7f35599e6156f35bff628a0f8 (patch)
tree726190945923dd83681b510243f8f3211cfa687d
parent6dd2997de345ffbff46248f8036f1b22b02c0b09 (diff)
downloadpaludis-a39c5c7060cec7e7f35599e6156f35bff628a0f8.tar.gz
paludis-a39c5c7060cec7e7f35599e6156f35bff628a0f8.tar.xz
Test symlink rewriting
-rw-r--r--paludis/tar_merger_TEST.cc10
-rwxr-xr-xpaludis/tar_merger_TEST_setup.sh2
2 files changed, 9 insertions, 3 deletions
diff --git a/paludis/tar_merger_TEST.cc b/paludis/tar_merger_TEST.cc
index 9d4725e..6fed784 100644
--- a/paludis/tar_merger_TEST.cc
+++ b/paludis/tar_merger_TEST.cc
@@ -97,13 +97,14 @@ TEST(TarMerger, Works)
n::maybe_output_manager() = make_null_shared_ptr(),
n::merged_entries() = std::make_shared<FSPathSet>(),
n::no_chown() = true,
- n::options() = MergerOptions(),
+ n::options() = MergerOptions() + mo_rewrite_symlinks,
n::root() = FSPath("/"),
n::tar_file() = output
));
ASSERT_TRUE(! output.stat().is_regular_file());
+ ASSERT_TRUE(merger.check());
merger.merge();
output = FSPath(stringify(output));
@@ -124,10 +125,13 @@ TEST(TarMerger, Works)
EXPECT_TRUE(0 != ((FSPath("tar_merger_TEST_dir") / "simple_extract" / "subdir" / "subsubdir" / "script").stat().permissions() & S_IXUSR));
EXPECT_TRUE((FSPath("tar_merger_TEST_dir") / "simple_extract" / "goodsym").stat().is_symlink());
- EXPECT_TRUE((FSPath("tar_merger_TEST_dir") / "simple_extract" / "goodsym").readlink() == "file");
+ EXPECT_EQ("file", (FSPath("tar_merger_TEST_dir") / "simple_extract" / "goodsym").readlink());
EXPECT_TRUE((FSPath("tar_merger_TEST_dir") / "simple_extract" / "badsym").stat().is_symlink());
- EXPECT_TRUE((FSPath("tar_merger_TEST_dir") / "simple_extract" / "badsym").readlink() == "nothing");
+ EXPECT_EQ("nothing", (FSPath("tar_merger_TEST_dir") / "simple_extract" / "badsym").readlink());
+
+ EXPECT_TRUE((FSPath("tar_merger_TEST_dir") / "simple_extract" / "rewritesym").stat().is_symlink());
+ EXPECT_EQ("/bin/cat", (FSPath("tar_merger_TEST_dir") / "simple_extract" / "rewritesym").readlink());
}
#else
diff --git a/paludis/tar_merger_TEST_setup.sh b/paludis/tar_merger_TEST_setup.sh
index 48f34e9..a37f9b2 100755
--- a/paludis/tar_merger_TEST_setup.sh
+++ b/paludis/tar_merger_TEST_setup.sh
@@ -20,3 +20,5 @@ chmod +x simple/subdir/subsubdir/script
ln -s file simple/goodsym
ln -s nothing simple/badsym
+
+ln -s ${PWD}/simple/bin/cat simple/rewritesym