t_pkg_image_update.py revision 1431
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
import testutils
if __name__ == "__main__":
import unittest
import os
foo10 = """
open foo@1.0,5.11-0
add dir mode=0755 owner=root group=bin path=/lib
close """
foo11 = """
open foo@1.1,5.11-0
add dir mode=0755 owner=root group=bin path=/lib
close """
bar10 = """
open bar@1.0,5.11-0
add dir mode=0755 owner=root group=bin path=/bin
close """
bar11 = """
open bar@1.1,5.11-0
add dir mode=0755 owner=root group=bin path=/bin
close """
baz10 = """
open baz@1.0,5.11-0
add dir mode=0755 owner=root group=bin path=/lib
close """
baz11 = """
open baz@1.1,5.11-0
add dir mode=0755 owner=root group=bin path=/lib
close """
qux10 = """
open qux@1.0,5.11-0
add depend type=require fmri=pkg:/quux@1.0
add dir mode=0755 owner=root group=bin path=/lib
close """
qux11 = """
open qux@1.1,5.11-0
add depend type=require fmri=pkg:/quux@1.1
add dir mode=0755 owner=root group=bin path=/lib
close """
quux10 = """
open quux@1.0,5.11-0
add depend type=require fmri=pkg:/corge@1.0
add dir mode=0755 owner=root group=bin path=/usr
close """
quux11 = """
open quux@1.1,5.11-0
add depend type=require fmri=pkg:/corge@1.1
add dir mode=0755 owner=root group=bin path=/usr
close """
corge10 = """
open corge@1.0,5.11-0
add dir mode=0755 owner=root group=bin path=/bin
close """
corge11 = """
open corge@1.1,5.11-0
add dir mode=0755 owner=root group=bin path=/bin
close """
"test3", "test4", "test5"])
"""Test image-update with bad options."""
"""Install packages from multiple publishers, then verify that
removal of the second publisher will not prevent an
image-update."""
# Install a package from the preferred publisher.
# Install a package from a second publisher.
# Remove the publisher of an installed package, then add the
# publisher back, but with an empty repository. An image-update
# should still be possible.
# Add two publishers with the same packages as a removed one;
# an image-update should be possible despite the conflict (as
# the newer versions will simply be ignored).
# Remove one of the conflicting publishers. An image-update
# should still be possible even though the conflicts no longer
# exist and the original publisher is unknown (see bug 6856).
# Remove the remaining test publisher.
"""Verify that image-updates work as expected when different
publishers offer the same package."""
# First, verify that the preferred status of a publisher will
# choose which source is used for image-update when two
# publishers offer the same package and the package publisher
# was preferred at the time of install.
# Next, verify that the preferred status of a publisher will
# not cause an upgrade of a package if the newer version is
# offered by the preferred publisher and the package publisher
# was not preferred at the time of isntall and was not used
# to install the package.
# Next, verify that if two non-preferred publishers offer
# the same package, that the publisher it was installed from
# will be chosen for an update and the update will succeed. In
# addition, its dependencies should be selected from the same
# publisher used for the update if that publisher has them and
# the remaining dependencies selected from the first available.
# Finally, cleanup and verify no packages are installed.
if __name__ == "__main__":