On 02/01/12 17:56, Brock Pytlik wrote:
Webrev:
https://cr.opensolaris.org/action/browse/pkg/bpytlik/7136706-v1

Bugs:
7136706 pkg operation planning can traceback for unprivileged users if
conflict cache files don't exist
7140772 image._load_actdict can find of isn't set when expected

So, I have a test case for this attached. It's almost identical to the test case for the other bug we discussed. It'd be great if you add it / verify it.

Your changes look right to me, although the wording of the synopsis for the second one is a little awkward ("can find of" ?).

-Shawn
diff --git a/src/tests/cli/t_change_facet.py b/src/tests/cli/t_change_facet.py
--- a/src/tests/cli/t_change_facet.py
+++ b/src/tests/cli/t_change_facet.py
@@ -29,6 +29,7 @@ import pkg5unittest
 
 import os
 import errno
+import shutil
 import unittest
 
 
@@ -47,6 +48,7 @@ class TestPkgChangeFacet(pkg5unittest.Si
         add file tmp/facets_6 mode=0555 owner=root group=bin path=6 
facet.locale.nl_NA=True
         add file tmp/facets_7 mode=0555 owner=root group=bin path=7 
facet.locale.nl_ZA=True
         add file tmp/facets_8 mode=0555 owner=root group=bin path=8 
facet.has/some/slashes=true
+        add link path=test target=1
         close"""
 
         misc_files = [
@@ -106,6 +108,25 @@ class TestPkgChangeFacet(pkg5unittest.Si
                 self.assert_file_is_there("6", negate=True)
                 self.assert_file_is_there("7", negate=True)
 
+                # verify that a non-existent facet can be set when other facets
+                # are in effect
+                self.pkg("change-facet -n --parsable=0 wombat=false")
+                self.assertEqualParsable(self.output,
+                    affect_packages=self.plist,
+                    change_facets=[["facet.wombat", False]])
+
+                # Again, but this time after removing the publisher cache data
+                # and as an unprivileged user to verify that cached manifest
+                # data doesn't affect operation.
+                cache_dir = os.path.join(self.get_img_api_obj().img.imgdir,
+                    "cache")
+                shutil.rmtree(cache_dir)
+                self.pkg("change-facet --no-refresh -n --parsable=0 
wombat=false",
+                    su_wrap=True)
+                self.assertEqualParsable(self.output,
+                    affect_packages=self.plist,
+                    change_facets=[["facet.wombat", False]])
+
                 # change to pick up another file w/ two tags and test the
                 # parsable output
                 self.pkg("change-facet --parsable=0 facet.locale.nl_ZA=True")
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to