3110N/A# The contents of this file are subject to the terms of the 3110N/A# Common Development and Distribution License (the "License"). 3110N/A# You may not use this file except in compliance with the License. 3110N/A# See the License for the specific language governing permissions 3110N/A# and limitations under the License. 3110N/A# When distributing Covered Code, include this CDDL HEADER in each 3110N/A# If applicable, add the following below this CDDL HEADER, with the 3110N/A# fields enclosed by brackets "[]" replaced with your own identifying 3110N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3339N/A# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. 3110N/A # Tests in this suite use the read only data directory. 3110N/A # A set of packages that we publish with additional hash attributes 3110N/A add dir mode=0755 owner=root group=bin path=dev 3110N/A add file dev/cfg/bar path=dev/cfg/bar mode=0644 owner=root group=bin preserve=true facet.locale.fr=True variant.opensolaris.zone=global 3110N/A add file dev/cfg/bar1 path=dev/cfg/bar1 mode=0555 owner=root group=bin facet.locale.fr=True variant.opensolaris.zone=global revert-tag="bob" 3110N/A add dir mode=0755 owner=root group=bin path=dev 3110N/A add dir mode=0755 owner=root group=bin path=dev 3110N/A add dir mode=0755 owner=root group=bin path=etc 3110N/A add dir mode=0755 owner=root group=bin path=etc 3110N/A add dir mode=0755 owner=root group=bin path=dba 3110N/A add dir mode=0755 owner=root group=bin path=cga 3110N/A add dir mode=0755 owner=root group=bin path=mnt 3110N/A # Nothing to do when there are no packages installed under 3110N/A"""PROPERTY VALUE\ndehydrated []\n""" 3110N/A # Rehydrate do nothing if the publisher has not been dehydrated. 3110N/A # Verify that unprivileged users are handled by dehydrate. 3110N/A # Verify that dehydrate fails gracefully, 3110N/A # if any of the specified publishers does not have a configured 3110N/A # if any of the publishers specified does not exist; 3110N/A # if all known publishers have no configured package repository. 3110N/A # If no publishers exist in the image, 3110N/A # dehydrate will default to do nothing; 3110N/A # the specified publisher will be treated as not having a 3110N/A # configured package repository. 3110N/A # Verify that dehydrate works as expected. 3110N/A"""PROPERTY VALUE\ndehydrated ['test1']\n""" 3110N/A # Verify dehydrate would not touch unpackaged data. 3110N/A # Verify that files are deleted or remained as expected. 3110N/A # Dehydrate do nothing on dehydrated publishers. 3110N/A"""PROPERTY VALUE\ndehydrated ['test1']\n""" 3110N/A # Verify that rehydrate fails gracefully, 3110N/A # if any of the specified publishers does not have a configured 3110N/A # if any of the publishers specified does not exist; 3110N/A # if all known publishers have no configured package repository. 3110N/A # If no publishers exist in the image, 3110N/A # The dehydrated property will not be removed if the publisher 3110N/A"""PROPERTY VALUE\ndehydrated ['test1']\n""" 3110N/A # rehydrate will default to do nothing; 3110N/A # the specified publisher will be treated as not having a 3110N/A # configured package repository. 3110N/A # Verify that unprivileged users are handled by rehydrate. 3110N/A # Verify that rehydrate works as expected. 3110N/A # Check that we didn't reindex. 3110N/A # Make sure it's the same size as the original. 3110N/A # Verify that rehydrate will not operate on rehydrated publishers. 3110N/A # Verify that dehydrate defaults to dehydrate on all publishers 3110N/A # that have configured repositories, regardless of whether the 3110N/A # publisher has installed packages or not. 3110N/A"""PROPERTY VALUE\ndehydrated ['test1', 'test2']\n""" 3110N/A # Verify that specifying publishers manually will work. 3110N/A # Verify that dehydrate defaults to operate on all publishers 3110N/A # with configured package repositories. 3110N/A # Verify that multiple origins with the same publisher will work. 3110N/A # Verify that packages with nothing to dehydrate will work. 3110N/A # More tests on the user behaviors. 3110N/A # Test the dehydrated property will be set correctly. 3110N/A"""PROPERTY VALUE\ndehydrated ['test1', 'test3']\n""" 3339N/A"""PROPERTY VALUE\ndehydrated ['test1', 'test2', 'test3']\n""" 3110N/A"""PROPERTY VALUE\ndehydrated ['test1', 'test2']\n""" 3110N/A # The dehydrated proerty should has no value after 3110N/A"""PROPERTY VALUE\ndehydrated []\n""" 3339N/A"""PROPERTY VALUE\ndehydrated ['test1', 'test2', 'test3']\n""" 3110N/A"""PROPERTY VALUE\ndehydrated []\n""" 3110N/A """Hardlink test: make sure that a file getting rehydrated gets 3110N/A any hardlinks that point to it updated""" 3110N/A # Get the inode of the orig file. 3110N/A # Get the inode of the new hardlink. 3110N/A # Make sure the inode of the link is now same. 3110N/A """Test that pkg install will install packages dehydrated from 3110N/A dehydrated publishers and install packages normally from normal 3110N/A"""PROPERTY VALUE\ndehydrated ['test1']\n""" 3110N/A # Verify that a package from a dehydrated publisher will be 3110N/A # installed dehydrated on the image. 3110N/A"""PROPERTY VALUE\ndehydrated ['test1']\n""" 3110N/A # Verify that if we dehydrate a publisher without any packages, 3110N/A # installing packages for that publisher are dehydrated. 3110N/A # Verify that if users adds a new publisher and install packages 3110N/A # from it, the package is installed normally. 3110N/A"""PROPERTY VALUE\ndehydrated ['test1']\n""" 3110N/A """Test that pkg update will update packages dehydrated from 3110N/A dehydrated publishers and update packages normally from normal 3110N/A # Verify that a package that is dilvered by a dehydrated publisher 3110N/A # will be updated dehydrated on the image. 3110N/A # Verify that a package that is not dilvered by a dehydrated 3110N/A # publisher will be updated normally. 3110N/A # Verify that update without pargs will work too. 3110N/A """Test uninstall works fine.""" 3110N/A # Verify that if we uninstall all packages under dehydrated 3110N/A # publishers, no work to do in dehydrate and rehydrate, and 3110N/A # the dehydrated property remains. 3110N/A"""PROPERTY VALUE\ndehydrated ['test1']\n""" 3110N/A # Verify that uninstalling some packages under dehydrated 3110N/A # publishers will not cause dehydrate to fail on other packages, 3110N/A # and the dehydrated property is deleted after rehydrate. 3110N/A"""PROPERTY VALUE\ndehydrated ['test1']\n""" 3110N/A"""PROPERTY VALUE\ndehydrated []\n""" 3110N/A # Verify that uninstalling some packages under a publisher 3110N/A # will not cause dehydrate to fail on another publisher. 3110N/A """Test that verify will only look at things that have not been 3110N/A """Test that fix will only fix things that have not been 3110N/A """Test that revert will only revert things that have not been 3110N/A # It will be treated as "not packaged" if revert by path-to-name. 3110N/A # Nothing to do if revert by tag-name. 3110N/A """Test that change-facet for dehydrated publishers will be 3110N/A automatically dehydrated.""" 3110N/A # Test that change-facet uninstalls files on dehydrated 3110N/A # Verify that change-facet installs new files dehydrated on 3110N/A """Test that change-variant for dehydrated publishers will be 3110N/A automatically dehydrated.""" 3110N/A # Test that change-variant uninstalls files on dehydrated 3110N/A self.
pkg(
"change-variant variant.opensolaris.zone=non-global")
3110N/A # Rehydrate will be restricted by variants. 3110N/A # Verify that change-variant installs new files dehydrated on 3110N/A will not be removed in dehydrate.""" 3110N/A """Test that rehydrate will reinstall the file if it was created 3110N/A manually at the same path.""" 3110N/A """Test that a warning emitted whenever dehydrated publishers 3110N/A exist and 'pkg mediator' or 'pkg set-mediator' is executed, and 3110N/A the correct mediation will be applied when the publishers are 3110N/AWARNING: pkg mediators may not be accurately shown when one or more publishers have been dehydrated. The correct mediation will be applied when the publishers are rehydrated. 3110N/A # If dehydrate all publishers that have the mediated hardlink 3110N/A # to remove it and its target file exists. 3110N/A # If dehydrate all publishers that have the mediated hardlink 3110N/A # to remove it and its target file doesn't exist. 3110N/A # If dehydrate only a publisher that has the mediated hardlink 3110N/A # but the other publisher still deliver it and its target file 3110N/A # If dehydrate only a publisher that has the mediated hardlink 3110N/A # but the other publisher still deliver it and its target file