aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Wouter van Kesteren <woutershep@gmail.com> 2015-12-10 16:43:49 +0100
committerAvatar Wouter van Kesteren <woutershep@gmail.com> 2016-01-08 18:59:34 +0100
commit5cd1f72f94ddc2858ce5612db967ec62db3bed76 (patch)
treebf98cba4d91772fe10f6d32695f515798aa16fde
parentd08eaf3c81ade57e59af1d32e3135dfd31510077 (diff)
downloadpaludis-5cd1f72f94ddc2858ce5612db967ec62db3bed76.tar.gz
paludis-5cd1f72f94ddc2858ce5612db967ec62db3bed76.tar.xz
Test permitted_directories
Change-Id: I3017ac9e1d5d4527c5993d25e3beac5f94b50110 Reviewed-on: https://galileo.mailstation.de/gerrit/4659 Reviewed-by: Bo ├śrsted Andresen <zlin@exherbo.org>
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc32
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_exheres_0_setup.sh74
2 files changed, 106 insertions, 0 deletions
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
index 0ccc21e..4116784 100644
--- a/paludis/repositories/e/e_repository_TEST_exheres_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
@@ -669,6 +669,38 @@ TEST(ERepository, ReallyInstallExheres0)
{
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/permitted-directories-1",
+ &env, { })), nullptr, { }))]->last());
+ ASSERT_TRUE(bool(id));
+ EXPECT_THROW(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/permitted-directories-2",
+ &env, { })), nullptr, { }))]->last());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(action);
+ }
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/permitted-directories-3",
+ &env, { })), nullptr, { }))]->last());
+ ASSERT_TRUE(bool(id));
+ EXPECT_THROW(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/permitted-directories-4",
+ &env, { })), nullptr, { }))]->last());
+ ASSERT_TRUE(bool(id));
+ id->perform_action(action);
+ }
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/exvolatile-1",
&env, { })), nullptr, { }))]->last());
ASSERT_TRUE(bool(id));
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0_setup.sh b/paludis/repositories/e/e_repository_TEST_exheres_0_setup.sh
index b61892c..69215f6 100755
--- a/paludis/repositories/e/e_repository_TEST_exheres_0_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0_setup.sh
@@ -1205,6 +1205,80 @@ src_install() {
EOT
}
END
+mkdir -p "packages/cat/permitted-directories"
+cat <<'END' > packages/cat/permitted-directories/permitted-directories-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ insinto /
+ hereins it <<EOT
+EOT
+}
+END
+cat <<'END' > packages/cat/permitted-directories/permitted-directories-2.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ insinto /var
+ hereins it <<EOT
+EOT
+}
+END
+cat <<'END' > packages/cat/permitted-directories/permitted-directories-3.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ insinto /var/run
+ hereins it <<EOT
+EOT
+}
+END
+cat <<'END' > packages/cat/permitted-directories/permitted-directories-4.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+pkg_setup() {
+ exdirectory --forbid /foo
+ exdirectory --allow /foo/bar/baz
+}
+
+src_install() {
+ insinto /foo/bar/baz
+ hereins it <<EOT
+EOT
+}
+END
mkdir -p "packages/cat/exvolatile"
cat <<'END' > packages/cat/exvolatile/exvolatile-1.ebuild || exit 1
DESCRIPTION="The Long Description"