2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# CDDL HEADER START
ffd9a1898a18fadfc5dce399162c25d50548f905Timo Sirainen# The contents of this file are subject to the terms of the
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# Common Development and Distribution License (the "License").
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# You may not use this file except in compliance with the License.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5806683c1c3f5b1997e92a023c0fe39912d4df5dTimo Sirainen# See the License for the specific language governing permissions
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# and limitations under the License.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
8e361d2906b0e44f7175a20981f8d2280645b58bTimo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# CDDL HEADER END
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainenclass TestPkgChangeFacet(pkg5unittest.SingleDepotTestCase):
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen # Only start/stop the depot once (instead of for every test)
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen open pkg_A@1.0,5.11-0
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen add file tmp/facets_0 mode=0555 owner=root group=bin path=0
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen add file tmp/facets_1 mode=0555 owner=root group=bin path=1 facet.locale.fr=True
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen add file tmp/facets_2 mode=0555 owner=root group=bin path=2 facet.locale.fr_FR=True
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen add file tmp/facets_3 mode=0555 owner=root group=bin path=3 facet.locale.fr_CA=True
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen add file tmp/facets_4 mode=0555 owner=root group=bin path=4 facet.locale.fr_CA=True facet.locale.nl_ZA=True
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen add file tmp/facets_5 mode=0555 owner=root group=bin path=5 facet.locale.nl=True
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen add file tmp/facets_6 mode=0555 owner=root group=bin path=6 facet.locale.nl_NA=True
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen add file tmp/facets_7 mode=0555 owner=root group=bin path=7 facet.locale.nl_ZA=True
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen add file tmp/facets_8 mode=0555 owner=root group=bin path=8 facet.has/some/slashes=true
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen add file tmp/facets_9 mode=0555 owner=root group=bin path=debug facet.debug.foo=True
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen add link path=test target=1
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen open pkg_B@1.0,5.11-0
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen open pkg_B@2.0,5.11-0
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainen # All 'all's must be true AND any 'true's true.
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainen open pkg_top_level@1.0,5.11-0
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainen add file tmp/facets_0 mode=0555 owner=root group=bin path=top0 facet.devel=all
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen add file tmp/facets_1 mode=0555 owner=root group=bin path=top1 facet.doc=all
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen add file tmp/facets_2 mode=0555 owner=root group=bin path=top2 facet.devel=all facet.doc=all
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen add file tmp/facets_3 mode=0555 owner=root group=bin path=top3 facet.doc=all facet.locale.fr_CA=true
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen add file tmp/facets_4 mode=0555 owner=root group=bin path=top4 facet.doc=all facet.locale.fr_CA=true facet.locale.nl_ZA=true
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen add file tmp/facets_5 mode=0555 owner=root group=bin path=top5 facet.devel=all facet.doc=all facet.locale.fr_CA=true facet.locale.nl_ZA=true
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen add file tmp/facets_6 mode=0555 owner=root group=bin path=top0.debug facet.devel=all facet.debug.top=all
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen add file tmp/facets_7 mode=0555 owner=root group=bin path=optional.doc facet.optional.doc=all facet.doc=true
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen add file tmp/facets_8 mode=0555 owner=root group=bin path=optional_fr.doc facet.optional.doc=all facet.doc=all facet.locale.fr_CA=true
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen "tmp/facets_0", "tmp/facets_1", "tmp/facets_2", "tmp/facets_3",
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen "tmp/facets_4", "tmp/facets_5", "tmp/facets_6", "tmp/facets_7",
8ababf3e7b15f793370d1dedf85825d38b42633fTimo Sirainen self.plist = self.pkgsend_bulk(self.rurl, (self.pkg_A,
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen file_path = os.path.join(self.get_img_path(), path)
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen def assert_file_is_there(self, path, negate=False):
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen """Verify that the specified path exists. If negate is true,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen then make sure the path doesn't exist"""
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen file_path = os.path.join(self.get_img_path(), str(path))
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen self.assertTrue(False, "File {0} is missing".format(path))
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # file is there
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen self.assertTrue(False, "File {0} should not exist".format(path))
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # create an image w/ locales set
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ic_args += " --facet 'facet.locale.fr*=True' "
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ic_args += " --facet 'facet.locale.fr_CA=False' "
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen self.pkg_image_create(self.rurl, additional_args=ic_args)
8ababf3e7b15f793370d1dedf85825d38b42633fTimo Sirainen self.pkg("facet -H -F tsv 'facet.locale*' | egrep False")
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # install a package and verify
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen self.assertEqualParsable(self.output, add_packages=alist)
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # make sure it delivers its files as appropriate
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen self.assert_file_is_there("debug", negate=True)
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # Verify that effective value is shown for facets that are
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # always implicity false such as debug / optional.
eb958701f57066bce9cc8bbf9df73616bd322d09Timo Sirainen self.pkg("facet -H -F tsv debug.top optional.doc")
eb958701f57066bce9cc8bbf9df73616bd322d09Timo Sirainen "facet.debug.top\tFalse\tsystem\n"
eb958701f57066bce9cc8bbf9df73616bd322d09Timo Sirainen "facet.optional.doc\tFalse\tsystem\n",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # notice that a file should not exist according to its facet
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen open(os.path.join(self.get_img_path(), "3"), "w").close()
4ad29660779873d7955151eb4568d132a32e9d9cTimo Sirainen os.remove(os.path.join(self.get_img_path(), "3"))
4ad29660779873d7955151eb4568d132a32e9d9cTimo Sirainen # verify that a non-existent facet can be set when other facets
4ad29660779873d7955151eb4568d132a32e9d9cTimo Sirainen # are in effect
4ad29660779873d7955151eb4568d132a32e9d9cTimo Sirainen self.pkg("change-facet -n --parsable=0 wombat=false")
a2aa37d224a70b2eccc00691d2893e09f107d7ccTimo Sirainen change_facets=[["facet.wombat", False, None, 'local',
4ad29660779873d7955151eb4568d132a32e9d9cTimo Sirainen # Again, but this time after removing the publisher cache data
4ad29660779873d7955151eb4568d132a32e9d9cTimo Sirainen # and as an unprivileged user to verify that cached manifest
4a01681e0ed9a7b3f7a105dd2fcd2511e7160e99Timo Sirainen # data doesn't affect operation.
4a01681e0ed9a7b3f7a105dd2fcd2511e7160e99Timo Sirainen cache_dir = os.path.join(self.get_img_api_obj().img.imgdir,
4a01681e0ed9a7b3f7a105dd2fcd2511e7160e99Timo Sirainen self.pkg("change-facet --no-refresh -n --parsable=0 "
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen change_facets=[["facet.wombat", False, None, 'local',
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # Again, but this time after removing the cache directory
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen cache_dir = os.path.join(self.get_img_api_obj().img.imgdir,
9573f4283f9118315b0865998d43223fedee0246Timo Sirainen self.pkg("change-facet --no-refresh -n --parsable=0 "
eb958701f57066bce9cc8bbf9df73616bd322d09Timo Sirainen change_facets=[["facet.wombat", False, None, 'local',
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen # change to pick up another file w/ two tags and test the
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen # parsable output
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen self.pkg("change-facet --parsable=0 facet.locale.nl_ZA=True")
eb958701f57066bce9cc8bbf9df73616bd322d09Timo Sirainen change_facets=[["facet.locale.nl_ZA", True, None, 'local',
4a01681e0ed9a7b3f7a105dd2fcd2511e7160e99Timo Sirainen self.assert_file_is_there("debug", negate=True)
eb958701f57066bce9cc8bbf9df73616bd322d09Timo Sirainen # remove all the facets
eb958701f57066bce9cc8bbf9df73616bd322d09Timo Sirainen self.pkg("change-facet --parsable=0 facet.locale*=None "
eb958701f57066bce9cc8bbf9df73616bd322d09Timo Sirainen "'facet.locale.fr*'=None facet.locale.fr_CA=None")
ed50658501d9ae8c85f6264831056b1debed11c3Timo Sirainen ["facet.locale*", None, False, 'local', False, False],
ed50658501d9ae8c85f6264831056b1debed11c3Timo Sirainen ["facet.locale.fr*", None, True, 'local', False,
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ["facet.locale.fr_CA", None, False, 'local', False,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # zap all the locales
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen self.pkg("change-facet -v facet.locale*=False facet.locale.nl_ZA=None")
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen self.assert_file_is_there("{0:d}".format(i), negate=(i != 0))
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # Verify that effective value is shown for facets that are
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # implicity false due to wildcards whether they're known to the
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # system through packages or not.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen self.pkg("facet -H -F tsv facet.locale.fr facet.locale.nl_ZA")
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen "facet.locale.fr\tFalse\tlocal\n"
1d3f7c1278168d5b1cbfa9a2cc9929a0909056b4Timo Sirainen "facet.locale.nl_ZA\tFalse\tlocal\n",
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # Verify that an action with multiple facets will be installed
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # if at least one is implicitly true even when the first facet
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # evaluated matches an explicit wildcard facet set to false.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # This test relies on Python iterating over the action
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen # attributes dictionary such that facet.locale.nl_ZA is
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # evaluated first. (There's no way to influence that and the
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # order seems 100% consistent for now.)
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen self.pkg("change-facet --parsable=0 'facet.locale*=None' "
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen "'facet.locale.*=false' facet.locale.fr_CA=true");
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ["facet.locale*", None, False, 'local', False, False],
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ["facet.locale.*", False, None, 'local', False, False],
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ["facet.locale.fr_CA", True, None, 'local', False,
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen # This test is merely here so that if the evaluation order is
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen # reversed for some reason that expected results are still seen.
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen self.pkg("change-facet --parsable=0 'facet.locale.*=None' "
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen "facet.locale.fr_*=false facet.locale.fr_CA=None");
7de1c472fd23ddac6b4dc5cbeee6fa6a8418b071Timo Sirainen ["facet.locale.*", None, False, 'local', False, False],
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ["facet.locale.fr_*", False, None, 'local', False,
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ["facet.locale.fr_CA", None, True, 'local', False,
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen # Test that setting an unset, non-existent facet to None works.
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen # Test that setting a non-existent facet to True then removing
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen self.assertEqual("facet.foo\tTrue\tlocal\n", self.output)
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen self.pkg("change-facet --parsable=0 foo=None")
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen self.assertEqualParsable(self.output, change_facets=[
7bd72e4deca3cbf757dd1ea298486d9f3bc24226Timo Sirainen ["facet.foo", None, True, 'local', False, False]])
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # Test that setting a facet at the same time as removing a facet
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # sees both as changing.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # First, install faceted package.
14c474d9f4591c397ed0b5206af6537c7b52c924Timo Sirainen # Next, set general locale.*=False, but locale.fr=True.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen self.pkg("change-facet 'locale.*=False' 'locale.fr=True'")
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # General 0 file, locale.fr file, and has slashes file should be
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # No other locale files should be present.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # Now set wombat=False and unset locale.fr.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen self.pkg("change-facet -vv locale.fr=None wombat=False")
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen self.assert_file_is_there(0) # general 0 file exists
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen self.assert_file_is_there(1, negate=True) # locale.fr file gone
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen self.pkg("change-facet -v facet.has/some/slashes=False")
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen self.pkg("change-facet -v facet.has/some/slashes=True")
a85d0d2b75e5effadf4d3c2167af0ff9ae95904aTimo Sirainen """Verify that non-facet related packaging operation don't
5787e39e2be32f657b8c98fee8bac794aa852cf8Timo Sirainen accidentally change facets."""
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # create an image w/ two facets set.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen self.pkg_image_create(rurl, additional_args=ic_args)
19779377be72c9fe8365bb9ba7a2e0d06dc99c3bTimo Sirainen # install a random package and make sure we don't accidentally
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen # change facets.
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen "facet.locale.fr\tFalse\tlocal\n"
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen "facet.locale.fr_FR\tFalse\tlocal\n")
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen self.assert_file_is_there(str(i), negate=True)
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen # update an image and make sure we don't accidentally change
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen "facet.locale.fr\tFalse\tlocal\n"
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen "facet.locale.fr_FR\tFalse\tlocal\n")
e20e638805c4bd54e039891a3e92760b1dfa189aTimo Sirainen self.assert_file_is_there(str(i), negate=True)
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen """Verify that resetting a Facet explicitly set to false
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen restores/removes delivered content."""
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen # create an image with pkg_A and no facets
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen self.assert_file_is_there("debug", negate=True)
d7c8280f58292cc292eba9209dcc9024fe96cf06Timo Sirainen # set a facet on an image with no facets
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen "facet.locale.fr\tFalse\tlocal\n")
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen for i in [ 1 ]:
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen self.assert_file_is_there(str(i), negate=True)
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen # set a facet on an image with existing facets
e20e638805c4bd54e039891a3e92760b1dfa189aTimo Sirainen self.pkg("change-facet -v locale.fr_FR=False")
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen "facet.locale.fr\tFalse\tlocal\n"
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen "facet.locale.fr_FR\tFalse\tlocal\n")
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainen self.assert_file_is_there(str(i), negate=True)
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainen # clear a facet while setting a facet on an image with other
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen # facets that aren't being changed
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen self.pkg("change-facet -v locale.fr=None locale.nl=False")
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen "facet.locale.fr_FR\tFalse\tlocal\n"
d0ab5936be1cd971007fc2241e0be120c442cb84Timo Sirainen "facet.locale.nl\tFalse\tlocal\n")
d0ab5936be1cd971007fc2241e0be120c442cb84Timo Sirainen self.assert_file_is_there(str(i), negate=True)
90a989e4f8bcb4fb86af32cbae577402e3f92b1aTimo Sirainen # clear a facet on an image with other facets that aren't
90a989e4f8bcb4fb86af32cbae577402e3f92b1aTimo Sirainen # being changed
d0ab5936be1cd971007fc2241e0be120c442cb84Timo Sirainen "facet.locale.fr_FR\tFalse\tlocal\n")
d0ab5936be1cd971007fc2241e0be120c442cb84Timo Sirainen for i in [ 2 ]:
d0ab5936be1cd971007fc2241e0be120c442cb84Timo Sirainen self.assert_file_is_there(str(i), negate=True)
d0ab5936be1cd971007fc2241e0be120c442cb84Timo Sirainen # clear the only facet on an image
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen # verify debug content removed when debug facet reset
7de1c472fd23ddac6b4dc5cbeee6fa6a8418b071Timo Sirainen "facet.debug.foo\tTrue\tlocal\n")
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen self.assert_file_is_there("debug", negate=True)
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen """Verify that the 'all' value for facets is handled as
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen # All faceted files except debug/optional should be installed.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen # All faceted files should be installed.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen self.pkg("change-facet -v debug.top=true optional.doc=true")
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen # Only top0[.debug] should be installed.
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen # No faceted files should be installed.
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen self.pkg('change-facet -v devel=false optional.doc=false')
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen # Only top1, top3, top4, optional.doc, and optional_fr.doc
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen # should be installed.
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen self.pkg('change-facet -v doc=true optional.doc=true')
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen # All faceted files should be installed.
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen self.pkg("change-facet -v devel=true optional.doc=true")
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen # Only top0[.debug], top1, top2, top4, top5, and optional.doc
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen # should be installed.
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen self.pkg("change-facet -v locale.fr_CA=false")
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen # Only top0[.debug], top1, top2, and optional.doc should be
c24c0f0a208e5ffc35dc8be19a9b504a5326467aTimo Sirainen self.pkg("change-facet -v locale.nl_ZA=false")