src/tests/cli/t_pkg_install.py
author saurabh.vyas@oracle.com
Fri, 23 Sep 2016 11:47:00 +0530
branchs11u3-sru
changeset 3432 489e5c945d1d
parent 3431 986e4ec518b8
child 3434 b3c023f9936c
permissions -rw-r--r--
19483340 driver action policy update displays false failure messages
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
     1
#!/usr/bin/python
3188
48b2c6a36bb6 18876698 Plan serialization for linked images does not support unicode in license actions
Danek Duvall <danek.duvall@oracle.com>
parents: 3172
diff changeset
     2
# -*- coding: utf-8 -*-
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
     3
#
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
     4
# CDDL HEADER START
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
     5
#
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
     6
# The contents of this file are subject to the terms of the
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
     7
# Common Development and Distribution License (the "License").
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
     8
# You may not use this file except in compliance with the License.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
     9
#
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    10
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    11
# or http://www.opensolaris.org/os/licensing.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    12
# See the License for the specific language governing permissions
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    13
# and limitations under the License.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    14
#
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    15
# When distributing Covered Code, include this CDDL HEADER in each
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    16
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    17
# If applicable, add the following below this CDDL HEADER, with the
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    18
# fields enclosed by brackets "[]" replaced with your own identifying
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    19
# information: Portions Copyright [yyyy] [name of copyright owner]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    20
#
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    21
# CDDL HEADER END
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    22
#
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    23
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
    24
#
3428
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
    25
# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
    26
#
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    27
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    28
import testutils
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    29
if __name__ == "__main__":
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
    30
        testutils.setup_environment("../../../proto")
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
    31
import pkg5unittest
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    32
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
    33
import errno
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    34
import os
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
    35
import platform
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
    36
import re
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
    37
import shutil
2580
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
    38
import socket
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
    39
import subprocess
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
    40
import stat
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
    41
import tempfile
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    42
import time
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    43
import unittest
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
    44
import urllib2
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
    45
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
    46
import pkg.actions
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    47
import pkg.digest as digest
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
    48
import pkg.fmri as fmri
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
    49
import pkg.manifest as manifest
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
    50
import pkg.portable as portable
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
    51
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
    52
from pkg.client.pkgdefs import EXIT_OOPS
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    53
3428
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
    54
try:
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
    55
        import pkg.sha512
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
    56
        sha512_supported = True
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
    57
except ImportError:
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
    58
        sha512_supported = False
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
    59
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    60
class _TestHelper(object):
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    61
        """Private helper class for shared functionality between test
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    62
        classes."""
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    63
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    64
        def _assertEditables(self, moved=[], removed=[], installed=[],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    65
            updated=[]):
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    66
                """Private helper function that verifies that expected editables
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    67
                are listed in parsable output.  If no editable of a given type
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    68
                is specified, then no editable files are expected."""
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    69
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    70
                changed = []
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    71
                if moved:
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    72
                        changed.append(['moved', moved])
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    73
                if removed:
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    74
                        changed.append(['removed', removed])
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    75
                if installed:
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    76
                        changed.append(['installed', installed])
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    77
                if updated:
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    78
                        changed.append(['updated', updated])
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    79
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    80
                self.assertEqualParsable(self.output,
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    81
                        include=["change-editables"],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    82
                        change_editables=changed)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    83
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
    84
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
    85
class TestPkgInstallBasics(pkg5unittest.SingleDepotTestCase):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    86
        # Only start/stop the depot once (instead of for every test)
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
    87
        persistent_setup = True
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    88
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    89
        foo10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    90
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    91
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    92
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    93
        foo11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    94
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    95
            add dir mode=0755 owner=root group=bin path=/lib
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
    96
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1 timestamp="20080731T024051Z"
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    97
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    98
        foo11_timestamp = 1217472051
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
    99
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   100
        foo12 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   101
            open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   102
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   103
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   104
922
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
   105
        afoo10 = """
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
   106
            open a/[email protected],5.11-0
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
   107
            close """
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
   108
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   109
        boring10 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   110
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   111
            close """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   112
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   113
        boring11 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   114
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   115
            close """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   116
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   117
        bar10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   118
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   119
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   120
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   121
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   122
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   123
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   124
        bar11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   125
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   126
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   127
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   128
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   129
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   130
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   131
        xfoo10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   132
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   133
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   134
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   135
        xbar10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   136
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   137
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   138
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   139
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   140
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   141
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   142
        xbar11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   143
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   144
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   145
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   146
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   147
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   148
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   149
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   150
        bar12 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   151
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   152
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   153
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   154
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   155
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   156
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   157
        baz10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   158
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   159
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   160
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   161
            add file tmp/baz mode=0555 owner=root group=bin path=/bin/baz
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   162
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   163
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   164
        deep10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   165
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   166
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   167
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   168
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   169
            close """
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   170
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   171
        xdeep10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   172
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   173
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   174
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   175
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   176
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   177
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   178
        ydeep10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   179
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   180
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   181
            add dir mode=0755 owner=root group=bin path=/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   182
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   183
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   184
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   185
        a6018_1 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   186
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   187
            close """
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   188
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   189
        a6018_2 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   190
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   191
            close """
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   192
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   193
        b6018_1 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   194
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   195
            add depend type=optional fmri=a6018@1
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   196
            close """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   197
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   198
        badfile10 = """
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   199
            open [email protected],5.11-0
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   200
            add file tmp/baz mode=644 owner=root group=bin path=/tmp/baz-file
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   201
            close """
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   202
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   203
        baddir10 = """
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   204
            open [email protected],5.11-0
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   205
            add dir mode=755 owner=root group=bin path=/tmp/baz-dir
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   206
            close """
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   207
1956
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   208
        a16189 = """
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   209
            open [email protected],5.11-0
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   210
            add depend type=require fmri=pkg:/[email protected]
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   211
            close """
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   212
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   213
        b16189 = """
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   214
            open [email protected],5.11-0
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   215
            add dir mode=0755 owner=root group=bin path=/bin
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   216
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   217
            close """
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   218
2876
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   219
        fuzzy = """
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   220
            open [email protected],5.11-0
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   221
            add dir mode=0755 owner=root group=bin path="opt/dir with white\tspace"
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   222
            add file tmp/cat mode=0644 owner=root group=bin path="opt/dir with white\tspace/cat in a hat"
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   223
            close
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   224
            open [email protected],5.11-0
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   225
            add dir mode=0755 owner=root group=bin path="opt/dir with white\tspace"
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   226
            add file tmp/cat mode=0644 owner=root group=bin path="opt/dir with white\tspace/cat in a hat"
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   227
            add link path=etc/cat_link target="../opt/dir with white\tspace/cat in a hat"
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   228
            close """
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
   229
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   230
        ffoo10 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   231
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   232
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   233
            close """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   234
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   235
        ffoo11 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   236
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   237
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   238
            close """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   239
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   240
        fbar10 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   241
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   242
            add depend type=require fmri=pkg:/[email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   243
            add dir mode=0755 owner=root group=bin path=/bin
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   244
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   245
            close """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   246
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   247
        fbar11 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   248
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   249
            add depend type=require fmri=pkg:/[email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   250
            add dir mode=0755 owner=root group=bin path=/bin
3188
48b2c6a36bb6 18876698 Plan serialization for linked images does not support unicode in license actions
Danek Duvall <danek.duvall@oracle.com>
parents: 3172
diff changeset
   251
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cät
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   252
            close """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   253
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   254
        secret1 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   255
            open [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   256
            add dir mode=0755 owner=root group=bin path=/p1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   257
            add file tmp/cat mode=0555 owner=root group=bin sysattr=TH path=/p1/cat
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   258
            close """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   259
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   260
        secret2 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   261
            open [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   262
            add dir mode=0755 owner=root group=bin path=/p2
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   263
            add file tmp/cat mode=0555 owner=root group=bin sysattr=hidden,sensitive path=/p2/cat
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   264
            close """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   265
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   266
        secret3 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   267
            open [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   268
            add dir mode=0755 owner=root group=bin path=/p3
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   269
            add file tmp/cat mode=0555 owner=root group=bin sysattr=horst path=/p3/cat
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   270
            close """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   271
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   272
        secret4 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   273
            open [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   274
            add dir mode=0755 owner=root group=bin path=/p3
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   275
            add file tmp/cat mode=0555 owner=root group=bin sysattr=hidden,horst path=/p3/cat
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   276
            close """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   277
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   278
        misc_files = [ "tmp/libc.so.1", "tmp/cat", "tmp/baz" ]
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   279
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   280
        def setUp(self):
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   281
                pkg5unittest.SingleDepotTestCase.setUp(self)
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
   282
                self.make_misc_files(self.misc_files)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   283
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   284
        def test_cli(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   285
                """Test bad cli options"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   286
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   287
                self.cli_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   288
                self.cli_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   289
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   290
        def cli_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   291
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   292
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   293
                self.pkg("-@", exit=2)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   294
                self.pkg("-s status", exit=2)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   295
                self.pkg("-R status", exit=2)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   296
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   297
                self.pkg("%s -@ foo" % install_cmd, exit=2)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   298
                self.pkg("%s -vq foo" % install_cmd, exit=2)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   299
                self.pkg("%s" % install_cmd, exit=2)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   300
                self.pkg("%s [email protected]" % install_cmd, exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   301
                self.pkg("%s pkg:/[email protected]" % install_cmd, exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   302
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   303
        def test_basics_1_install(self):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   304
                """ Send empty package [email protected], install and uninstall """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   305
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   306
                plist = self.pkgsend_bulk(self.rurl, self.foo10)
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   307
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   308
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   309
                self.pkg("list -a")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   310
                self.pkg("list", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   311
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   312
                self.pkg("install --parsable=0 foo")
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   313
                self.assertEqualParsable(self.output,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   314
                    add_packages=plist)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   315
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   316
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   317
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   318
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   319
                self.pkg("uninstall --parsable=0 foo")
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   320
                self.assertEqualParsable(self.output,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   321
                    remove_packages=plist)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   322
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   323
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   324
        def test_basics_1_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   325
                """ Send empty package [email protected], exact-install and uninstall """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   326
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   327
                plist = self.pkgsend_bulk(self.rurl, self.foo10)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   328
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   329
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   330
                self.pkg("list -a")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   331
                self.pkg("list", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   332
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   333
                self.pkg("exact-install --parsable=0 foo")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   334
                self.assertEqualParsable(self.output,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   335
                    add_packages=plist)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   336
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   337
                # Exact-install the same version should do nothing.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   338
                self.pkg("exact-install foo", exit=4)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   339
                self.pkg("list")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   340
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   341
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   342
                self.pkg("uninstall --parsable=0 foo")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   343
                self.assertEqualParsable(self.output,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   344
                    remove_packages=plist)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   345
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   346
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   347
        def test_basics_2(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   348
                """ Send package [email protected], containing a directory and a file,
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   349
                    install or exact-install, search, and uninstall. """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   350
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   351
                self.basics_2_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   352
                self.basics_2_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   353
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   354
        def basics_2_helper(self, install_cmd):
2064
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   355
                # This test needs to use the depot to be able to test the
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   356
                # download cache.
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   357
                self.dc.start()
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   358
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   359
                self.pkgsend_bulk(self.durl, (self.foo10, self.foo11),
2028
b2c674e6ee28 16744 repository multi-publisher on-disk format should be formalized and implemented
Shawn Walker <shawn.walker@oracle.com>
parents: 2026
diff changeset
   360
                    refresh_index=True)
2064
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   361
                self.image_create(self.durl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   362
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   363
                self.pkg("list -a")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   364
                self.pkg("%s foo" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   365
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   366
                # Verify that content cache is empty after successful install
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   367
                # or exact-install.
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   368
                api_inst = self.get_img_api_obj()
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   369
                img_inst = api_inst.img
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   370
                cache_dirs = []
2606
a9d3345192ee 19130 non-existent caches can significantly degrade transport performance
Shawn Walker <shawn.walker@oracle.com>
parents: 2602
diff changeset
   371
                for path, readonly, pub, layout in img_inst.get_cachedirs():
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   372
                        if os.path.exists(path):
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   373
                                cache_dirs.extend(os.listdir(path))
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   374
                self.assertEqual(cache_dirs, [])
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   375
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   376
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   377
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   378
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 931
diff changeset
   379
                self.pkg("search -l /lib/libc.so.1")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   380
                self.pkg("search -r /lib/libc.so.1")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   381
                self.pkg("search -l blah", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   382
                self.pkg("search -r blah", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   383
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   384
                # check to make sure timestamp was set to correct value
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   385
                libc_path = os.path.join(self.get_img_path(), "lib/libc.so.1")
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   386
                lstat = os.stat(libc_path)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   387
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   388
                assert (lstat[stat.ST_MTIME] == self.foo11_timestamp)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   389
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   390
                # check that verify finds changes
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   391
                now = time.time()
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   392
                os.utime(libc_path, (now, now))
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   393
                self.pkg("verify", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   394
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   395
                self.pkg("uninstall foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   396
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   397
                self.pkg("list -a")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   398
                self.pkg("verify")
2064
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   399
                self.dc.stop()
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   400
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   401
        def test_basics_3(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   402
                """Exact-install or Install [email protected], upgrade to [email protected],
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   403
                uninstall. """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   404
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   405
                self.basics_3_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   406
                self.basics_3_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   407
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   408
        def basics_3_helper(self, installed_cmd):
2064
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   409
                # This test needs to use the depot to be able to test the
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   410
                # download cache.
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   411
                self.dc.start()
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   412
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   413
                self.pkgsend_bulk(self.durl, (self.foo10, self.foo11))
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   414
                self.image_create(self.durl)
2518
8ac25b43cff1 18835 flush-content-cache-on-success should default to True
Shawn Walker <shawn.walker@oracle.com>
parents: 2500
diff changeset
   415
                self.pkg("set-property flush-content-cache-on-success False")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   416
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   417
                # Verify that content cache is empty before install or
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   418
                # exact-install.
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   419
                api_inst = self.get_img_api_obj()
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   420
                img_inst = api_inst.img
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   421
                cache_dirs = []
2606
a9d3345192ee 19130 non-existent caches can significantly degrade transport performance
Shawn Walker <shawn.walker@oracle.com>
parents: 2602
diff changeset
   422
                for path, readonly, pub, layout in img_inst.get_cachedirs():
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   423
                        if os.path.exists(path):
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   424
                                cache_dirs.extend(os.listdir(path))
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   425
                self.assertEqual(cache_dirs, [])
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   426
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   427
                self.pkg("%s [email protected]" % installed_cmd)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   428
                self.pkg("list [email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   429
                self.pkg("list [email protected]", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   430
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   431
                self.pkg("%s [email protected]" % installed_cmd)
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   432
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   433
                # Verify that content cache is not empty after successful
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   434
                # install or exact_install (since
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   435
                # flush-content-cache-on-success is True by default) for
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   436
                # packages that have content.
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   437
                cache_dirs = []
2606
a9d3345192ee 19130 non-existent caches can significantly degrade transport performance
Shawn Walker <shawn.walker@oracle.com>
parents: 2602
diff changeset
   438
                for path, readonly, pub, layout in img_inst.get_cachedirs():
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   439
                        if os.path.exists(path):
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   440
                                cache_dirs.extend(os.listdir(path))
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   441
                self.assertNotEqual(cache_dirs, [])
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   442
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   443
                self.pkg("list [email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   444
                self.pkg("list [email protected]", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   445
                self.pkg("list foo@1")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   446
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   447
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   448
                self.pkg("uninstall foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   449
                self.pkg("list -a")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   450
                self.pkg("verify")
2064
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   451
                self.dc.stop()
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   452
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   453
        def test_basics_4(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   454
                """ Add [email protected], dependent on [email protected], exact-install or
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   455
                install, uninstall. """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   456
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   457
                self.basics_4_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   458
                self.basics_4_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   459
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   460
        def basics_4_helper(self, installed_cmd):
2064
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   461
                # This test needs to use the depot to be able to test the
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   462
                # download cache.
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   463
                self.dc.start()
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   464
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   465
                self.pkgsend_bulk(self.durl, (self.foo10, self.foo11,
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   466
                    self.bar10))
2064
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   467
                self.image_create(self.durl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   468
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   469
                # Set content cache to not be flushed on success.
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   470
                self.pkg("set-property flush-content-cache-on-success False")
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   471
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   472
                # Verify that content cache is empty before install or
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   473
                # exact-install.
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   474
                api_inst = self.get_img_api_obj()
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   475
                img_inst = api_inst.img
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   476
                cache_dirs = []
2606
a9d3345192ee 19130 non-existent caches can significantly degrade transport performance
Shawn Walker <shawn.walker@oracle.com>
parents: 2602
diff changeset
   477
                for path, readonly, pub, layout in img_inst.get_cachedirs():
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   478
                        if os.path.exists(path):
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   479
                                cache_dirs.extend(os.listdir(path))
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   480
                self.assertEqual(cache_dirs, [])
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   481
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   482
                self.pkg("list -a")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   483
                self.pkg("%s [email protected]" % installed_cmd)
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   484
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   485
                # Verify that content cache is not empty after successful
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   486
                # install or exact-install (since
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   487
                # flush-content-cache-on-success is False)
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   488
                # for packages that have content.
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   489
                cache_dirs = []
2606
a9d3345192ee 19130 non-existent caches can significantly degrade transport performance
Shawn Walker <shawn.walker@oracle.com>
parents: 2602
diff changeset
   490
                for path, readonly, pub, layout in img_inst.get_cachedirs():
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   491
                        if os.path.exists(path):
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   492
                                cache_dirs.extend(os.listdir(path))
2055
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   493
                self.assertNotEqual(cache_dirs, [])
552262a56a9a 16950 imageconfig set property silently converts single values to lists breaking consumers
Shawn Walker <shawn.walker@oracle.com>
parents: 2038
diff changeset
   494
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   495
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   496
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   497
                self.pkg("uninstall -v bar foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   498
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   499
                # foo and bar should not be installed at this point
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   500
                self.pkg("list bar", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   501
                self.pkg("list foo", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   502
                self.pkg("verify")
2064
2aef71869aaa 16976 transport caching mechanism for file repository needs update
Shawn Walker <shawn.walker@oracle.com>
parents: 2055
diff changeset
   503
                self.dc.stop()
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   504
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   505
        def test_basics_5_install(self):
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   506
                """ Install [email protected], upgrade to [email protected].
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   507
                Boring should be left alone, while
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   508
                foo gets upgraded as needed"""
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   509
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   510
                self.pkgsend_bulk(self.rurl, (self.bar10, self.bar11,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   511
                    self.foo10, self.foo11, self.foo12, self.boring10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   512
                    self.boring11))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   513
                self.image_create(self.rurl)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   514
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   515
                self.pkg("install [email protected] [email protected] [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   516
                self.pkg("list")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   517
                self.pkg("list [email protected] [email protected] [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   518
                self.pkg("install -v [email protected]") # upgrade bar
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   519
                self.pkg("list")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   520
                self.pkg("list [email protected] [email protected] [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   521
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   522
        def test_basics_5_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   523
                """ exact-nstall [email protected], upgrade to [email protected].
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   524
                Boring should be left alone, while
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   525
                foo gets upgraded as needed"""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   526
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   527
                self.pkgsend_bulk(self.rurl, (self.bar10, self.bar11,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   528
                    self.foo10, self.foo11, self.foo12, self.boring10,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   529
                    self.boring11))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   530
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   531
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   532
                self.pkg("exact-install [email protected] [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   533
                self.pkg("list [email protected] [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   534
                self.pkg("exact-install -v [email protected]") # upgrade bar
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   535
                self.pkg("list [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   536
                self.pkg("list [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   537
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   538
        def test_basics_6_install(self):
2224
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   539
                """Verify that '@latest' will install the latest version
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   540
                of a package."""
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   541
2270
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   542
                # Create a repository for the test publisher.
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   543
                t1dir = os.path.join(self.test_root, "test-repo")
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   544
                self.create_repo(t1dir, properties={ "publisher": {
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   545
                    "prefix": "test" } })
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   546
                self.pkgsend_bulk(t1dir, (self.bar10,
2224
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   547
                    self.foo10, self.foo11, self.foo12, self.boring10,
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   548
                    self.boring11))
2270
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   549
                self.image_create("file:%s" % t1dir)
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   550
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   551
                # Create a repository for a different publisher for at
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   552
                # least one of the packages so that we can verify that
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   553
                # publisher search order is accounted for by @latest.
2299
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   554
                # The second publisher is called 'pub2' here so that
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   555
                # it comes lexically before 'test' (see bug 18180) to
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   556
                # ensure that latest version ordering works correctly
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   557
                # when the same stem is provided by different publishers.
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   558
                t2dir = os.path.join(self.test_root, "pub2-repo")
2270
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   559
                self.create_repo(t2dir, properties={ "publisher": {
2299
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   560
                    "prefix": "pub2" } })
2270
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   561
                self.pkgsend_bulk(t2dir, self.bar11)
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   562
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   563
                self.pkg("set-publisher -p %s" % t2dir)
2224
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   564
                self.pkg("install '*@latest'")
2270
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   565
2299
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   566
                # 1.0 of bar should be installed here since pub2 is a
2270
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   567
                # lower-ranked publisher.
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   568
                self.pkg("list")
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   569
                self.pkg("info [email protected] [email protected] [email protected]")
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   570
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   571
                self.pkg("set-publisher --non-sticky test")
2299
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   572
                self.pkg("set-publisher -P pub2 ")
2270
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   573
                self.pkg("install bar@latest")
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   574
2299
04f16b1bc15c 18180 @latest can be thwarted by publisher lexical ordering if matched package is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2295
diff changeset
   575
                # 1.1 of bar should be installed here since pub2 is a
2270
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   576
                # higher-ranked publisher and test is non-sticky.
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   577
                self.pkg("list")
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   578
                self.pkg("info [email protected]")
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   579
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   580
                # Cleanup.
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   581
                shutil.rmtree(t1dir)
fa67fb6ef882 18023 @latest ignores publisher search order for install and update
Shawn Walker <shawn.walker@oracle.com>
parents: 2267
diff changeset
   582
                shutil.rmtree(t2dir)
2224
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   583
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   584
        def test_basics_6_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   585
                """Verify that '@latest' will install the latest version
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   586
                of a package."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   587
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   588
                # Create a repository for the test publisher.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   589
                t1dir = os.path.join(self.test_root, "test-repo")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   590
                self.create_repo(t1dir, properties={ "publisher": {
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   591
                    "prefix": "test" } })
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   592
                self.pkgsend_bulk(t1dir, (self.bar10,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   593
                    self.foo10, self.foo11, self.foo12, self.boring10,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   594
                    self.boring11))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   595
                self.image_create("file:%s" % t1dir)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   596
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   597
                # Create a repository for a different publisher for at
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   598
                # least one of the packages so that we can verify that
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   599
                # publisher search order is accounted for by @latest.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   600
                # The second publisher is called 'pub2' here so that
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   601
                # it comes lexically before 'test' (see bug 18180) to
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   602
                # ensure that latest version ordering works correctly
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   603
                # when the same stem is provided by different publishers.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   604
                t2dir = os.path.join(self.test_root, "pub2-repo")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   605
                self.create_repo(t2dir, properties={ "publisher": {
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   606
                    "prefix": "pub2" } })
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   607
                self.pkgsend_bulk(t2dir, self.bar11)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   608
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   609
                self.pkg("set-publisher -p %s" % t2dir)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   610
                self.pkg("exact-install '*@latest'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   611
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   612
                # 1.0 of bar should be installed here since pub2 is a
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   613
                # lower-ranked publisher.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   614
                self.pkg("list")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   615
                self.pkg("info [email protected] [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   616
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   617
                self.pkg("set-publisher --non-sticky test")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   618
                self.pkg("set-publisher -P pub2 ")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   619
                self.pkg("exact-install bar@latest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   620
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   621
                # 1.1 of bar should be installed here since pub2 is a
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   622
                # higher-ranked publisher and test is non-sticky.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   623
                self.pkg("info [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   624
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   625
                self.pkg("list [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   626
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   627
                # Cleanup.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   628
                shutil.rmtree(t1dir)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   629
                shutil.rmtree(t2dir)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   630
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   631
        def test_basics_7_install(self):
2224
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   632
                """ Add [email protected], install [email protected]. """
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   633
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   634
                self.pkgsend_bulk(self.rurl, self.xbar11)
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   635
                self.image_create(self.rurl)
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   636
                self.pkg("install [email protected]", exit=1)
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
   637
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   638
        def test_basics_7_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   639
                """Add [email protected], exact-install [email protected]."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   640
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   641
                self.pkgsend_bulk(self.rurl, self.xbar11)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   642
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   643
                self.pkg("exact-install [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   644
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   645
        def test_basics_8_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   646
                """Try to exact-install two versions of the same package."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   647
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   648
                self.pkgsend_bulk(self.rurl, (self.foo11, self.foo12))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   649
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   650
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   651
                self.pkg("exact-install [email protected] [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   652
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   653
        def test_basics_9_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   654
                """Verify downgrade will fail with exact-install."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   655
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   656
                self.pkgsend_bulk(self.rurl, (self.bar10, self.bar11,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   657
                    self.foo10, self.foo12))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   658
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   659
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   660
                self.pkg("install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   661
                self.pkg("exact-install [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   662
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   663
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   664
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   665
        def test_freeze_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   666
                """Verify frozen packages can be relaxed with exact_install.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   667
                Which means we can ignore the frozen list with exact_install.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   668
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   669
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   670
                self.pkgsend_bulk(self.rurl, (self.fbar10, self.ffoo10,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   671
                    self.fbar11, self.ffoo11))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   672
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   673
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   674
                # Freeze [email protected].
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   675
                self.pkg("install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   676
                self.pkg("freeze [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   677
                self.pkg("exact-install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   678
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   679
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   680
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   681
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   682
                # Freeze both [email protected] and [email protected].
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   683
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   684
                self.pkg("install [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   685
                self.pkg("freeze [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   686
                self.pkg("freeze [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   687
                self.pkg("exact-install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   688
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   689
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   690
1902
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   691
        def test_basics_mdns(self):
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   692
                """ Send empty package [email protected], install and uninstall """
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   693
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   694
                self.pkgsend_bulk(self.rurl, self.foo11)
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   695
                self.image_create(self.rurl)
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   696
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   697
                self.pkg("set-property mirror-discovery True")
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   698
                self.pkg("list -a")
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   699
                self.pkg("list", exit=1)
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   700
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   701
                self.pkg("install foo")
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   702
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   703
                self.pkg("list")
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   704
                self.pkg("verify")
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   705
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   706
                self.pkg("uninstall foo")
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   707
                self.pkg("verify")
59b7214232cb 6957 mDNS support for depot
johansen <johansen@opensolaris.org>
parents: 1895
diff changeset
   708
2230
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   709
        def test_basics_ipv6(self):
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   710
                """Verify package operations can be performed using a depot
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   711
                server being addressed via IPv6."""
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   712
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   713
                # This test needs to use the depot to be able to test
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   714
                # IPv6 connectivity.
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   715
                self.dc.set_address("::1")
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   716
                self.dc.start()
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   717
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   718
                durl = self.dc.get_depot_url()
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   719
                self.pkgsend_bulk(durl, (self.foo10, self.foo12))
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   720
                self.wait_repo(self.dc.get_repodir())
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   721
                self.image_create(durl)
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   722
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   723
                self.pkg("install [email protected]")
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   724
                self.pkg("info [email protected]")
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   725
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   726
                self.pkg("update")
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   727
                self.pkg("list")
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   728
                self.pkg("info [email protected]")
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   729
                self.pkg("uninstall '*'")
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   730
                self.dc.stop()
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   731
                self.dc.set_address(None)
76f30e842e82 15750 depot bind address should be configurable
Shawn Walker <shawn.walker@oracle.com>
parents: 2228
diff changeset
   732
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   733
        def test_image_upgrade(self):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   734
                """ Send package [email protected], dependent on [email protected].  Install
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   735
                or exact-install [email protected].  List all packages.  Upgrade image.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   736
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   737
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   738
                self.image_upgrade_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   739
                self.image_upgrade_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   740
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   741
        def image_upgrade_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   742
                self.pkgsend_bulk(self.rurl, (self.foo10, self.foo11,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   743
                    self.bar10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   744
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   745
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   746
                self.pkg("%s [email protected]" % install_cmd)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   747
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   748
                self.pkgsend_bulk(self.rurl, (self.foo12, self.bar11))
996
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 988
diff changeset
   749
                self.pkg("refresh")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   750
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   751
                self.pkg("contents -H")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   752
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   753
                self.pkg("refresh")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   754
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   755
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   756
                self.pkg("verify")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
   757
                self.pkg("update -v")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   758
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   759
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   760
                self.pkg("list [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   761
                self.pkg("list [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   762
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   763
                self.pkg("uninstall bar foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   764
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   765
2382
b91a97e46434 18413 recursive uninstall functionality should be removed
Shawn Walker <shawn.walker@oracle.com>
parents: 2347
diff changeset
   766
        def test_dependent_uninstall(self):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   767
                """Trying to remove a package that's a dependency of another
2382
b91a97e46434 18413 recursive uninstall functionality should be removed
Shawn Walker <shawn.walker@oracle.com>
parents: 2347
diff changeset
   768
                package should fail since uninstall isn't recursive."""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   769
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   770
                self.pkgsend_bulk(self.rurl, (self.foo10, self.bar10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   771
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   772
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   773
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   774
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   775
                self.pkg("uninstall -v foo", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   776
                self.pkg("list bar")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   777
                self.pkg("list foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   778
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   779
        def test_bug_1338(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   780
                """ Add [email protected], dependent on [email protected], install [email protected]. """
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   781
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   782
                self.pkg("list -a")
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   783
                self.pkgsend_bulk(self.rurl, self.bar11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   784
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   785
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   786
                self.pkg("install [email protected]", exit=1)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   787
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   788
        def test_bug_1338_2(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   789
                """ Add [email protected], dependent on [email protected], and [email protected], dependent
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   790
                    on [email protected], install [email protected] and [email protected]. """
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   791
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   792
                self.pkgsend_bulk(self.rurl, (self.bar11, self.baz10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   793
                self.image_create(self.rurl)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   794
                self.pkg("list -a")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   795
                self.pkg("install [email protected] [email protected]")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   796
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   797
        def test_bug_1338_3(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   798
                """ Add [email protected], [email protected]. [email protected] depends on [email protected] which
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   799
                    depends on [email protected], install [email protected]. """
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   800
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   801
                self.pkgsend_bulk(self.rurl, (self.xbar10, self.xdeep10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   802
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   803
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   804
                self.pkg("install [email protected]", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   805
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   806
        def test_bug_1338_4(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   807
                """ Add [email protected]. [email protected] depends on [email protected] which depends
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   808
                on [email protected], install [email protected]. """
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   809
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   810
                self.pkgsend_bulk(self.rurl, self.ydeep10)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   811
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   812
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   813
                self.pkg("install [email protected]", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   814
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   815
        def test_bug_2795(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   816
                """ Try to install two versions of the same package """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   817
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   818
                self.pkgsend_bulk(self.rurl, (self.foo11, self.foo12))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   819
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   820
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   821
                self.pkg("install [email protected] [email protected]", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   822
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   823
        def test_bug_6018(self):
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   824
                """  From original comment in bug report:
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   825
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   826
                Consider a repository that contains:
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   827
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   828
                a@1 and a@2
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   829
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   830
                b@1 that contains an optional dependency on package a@1
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   831
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
   832
                If a@1 and b@1 are installed in an image, the "pkg update" command
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   833
                produces the following output:
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   834
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
   835
                $ pkg update
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   836
                No updates available for this image.
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   837
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   838
                However, "pkg install a@2" works.
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   839
                """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   840
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   841
                plist = self.pkgsend_bulk(self.rurl, (self.a6018_1,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   842
                    self.a6018_2, self.b6018_1))
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   843
                self.image_create(self.rurl)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   844
                self.pkg("install b6018@1 a6018@1")
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   845
                # Test the parsable output of update.
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   846
                self.pkg("update --parsable=0")
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   847
                self.assertEqualParsable(self.output,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
   848
                    change_packages=[[plist[0], plist[1]]])
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   849
                self.pkg("list b6018@1 a6018@2")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
   850
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   851
        def test_install_matching(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   852
                """ Try to [un]install or exact-install packages matching a
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   853
                pattern """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   854
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   855
                self.install_matching_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   856
                self.install_matching_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   857
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   858
        def install_matching_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   859
                self.pkgsend_bulk(self.rurl, (self.foo10, self.bar10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   860
                    self.baz10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   861
                self.image_create(self.rurl)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   862
                # don't specify versions here; we have many
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   863
                # different versions of foo, bar & baz in repo
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   864
                # when entire class is run w/ one repo instance.
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   865
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   866
                # first case should fail since multiple patterns
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   867
                # match the same pacakge
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   868
                self.pkg("%s 'ba*' 'b*'" % install_cmd, exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   869
                self.pkg("%s 'ba*'" % install_cmd, exit=0)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   870
                self.pkg("list foo", exit=0)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   871
                self.pkg("list bar", exit=0)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   872
                self.pkg("list baz", exit=0)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
   873
                self.pkg("uninstall 'b*' 'f*'")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
   874
2260
ea8567aa3ef8 17944 specifying multiple forms of the same pattern should not result in a matching error
Shawn Walker <shawn.walker@oracle.com>
parents: 2239
diff changeset
   875
                # However, multiple forms of the same pattern should simply be
ea8567aa3ef8 17944 specifying multiple forms of the same pattern should not result in a matching error
Shawn Walker <shawn.walker@oracle.com>
parents: 2239
diff changeset
   876
                # coalesced and allowed.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   877
                self.pkg("%s pkg:/foo /foo ///foo pkg:///foo" % install_cmd)
2260
ea8567aa3ef8 17944 specifying multiple forms of the same pattern should not result in a matching error
Shawn Walker <shawn.walker@oracle.com>
parents: 2239
diff changeset
   878
                self.pkg("list")
ea8567aa3ef8 17944 specifying multiple forms of the same pattern should not result in a matching error
Shawn Walker <shawn.walker@oracle.com>
parents: 2239
diff changeset
   879
                self.pkg("verify pkg:/foo /foo ///foo pkg:///foo")
ea8567aa3ef8 17944 specifying multiple forms of the same pattern should not result in a matching error
Shawn Walker <shawn.walker@oracle.com>
parents: 2239
diff changeset
   880
                self.pkg("uninstall pkg:/foo /foo ///foo "
ea8567aa3ef8 17944 specifying multiple forms of the same pattern should not result in a matching error
Shawn Walker <shawn.walker@oracle.com>
parents: 2239
diff changeset
   881
                    "pkg:///foo")
ea8567aa3ef8 17944 specifying multiple forms of the same pattern should not result in a matching error
Shawn Walker <shawn.walker@oracle.com>
parents: 2239
diff changeset
   882
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   883
        def test_bad_package_actions(self):
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   884
                """Test the install of packages that have actions that are
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   885
                invalid."""
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   886
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   887
                self.bad_package_actions("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   888
                self.bad_package_actions("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   889
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   890
        def bad_package_actions(self, install_cmd):
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   891
                # First, publish the package that will be corrupted and create
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   892
                # an image for testing.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   893
                plist = self.pkgsend_bulk(self.rurl, (self.badfile10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   894
                    self.baddir10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   895
                self.image_create(self.rurl)
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   896
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   897
                # This should succeed and cause the manifest to be cached.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   898
                self.pkg("%s %s" % (install_cmd, " ".join(plist)))
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   899
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   900
                # While the manifest is cached, get a copy of its contents.
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   901
                for p in plist:
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   902
                        pfmri = fmri.PkgFmri(p)
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   903
                        mdata = self.get_img_manifest(pfmri)
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   904
                        if mdata.find("dir") != -1:
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   905
                                src_mode = "mode=755"
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   906
                        else:
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   907
                                src_mode = "mode=644"
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   908
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   909
                        # Now remove the package so corrupt case can be tested.
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   910
                        self.pkg("uninstall %s" % pfmri.pkg_name)
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   911
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   912
                        # Now attempt to corrupt the client's copy of the
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   913
                        # manifest in various ways to check if the client
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   914
                        # handles missing mode and invalid mode cases for
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   915
                        # file and directory actions.
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   916
                        for bad_mode in ("", 'mode=""', "mode=???"):
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   917
                                self.debug("Testing with bad mode "
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   918
                                    "'%s'." % bad_mode)
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   919
                                bad_mdata = mdata.replace(src_mode, bad_mode)
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   920
                                self.write_img_manifest(pfmri, bad_mdata)
2808
05c6015a8c62 7195369 corrupt manifests can end up on disk when -g is used
Dan Price <daniel.price@oracle.com>
parents: 2756
diff changeset
   921
                                self.pkg("--debug manifest_validate=Never "
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   922
                                    "%s %s" % (install_cmd, pfmri.pkg_name),
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   923
                                    exit=1)
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   924
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   925
                        # Now attempt to corrupt the client's copy of the
1784
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   926
                        # manifest in various ways to check if the client
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   927
                        # handles missing or invalid owners and groups.
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   928
                        for bad_owner in ("", 'owner=""', "owner=invaliduser"):
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   929
                                self.debug("Testing with bad owner "
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   930
                                    "'%s'." % bad_owner)
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   931
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   932
                                bad_mdata = mdata.replace("owner=root",
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   933
                                    bad_owner)
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   934
                                self.write_img_manifest(pfmri, bad_mdata)
2808
05c6015a8c62 7195369 corrupt manifests can end up on disk when -g is used
Dan Price <daniel.price@oracle.com>
parents: 2756
diff changeset
   935
                                self.pkg("--debug manifest_validate=Never "
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   936
                                    "%s %s" % (install_cmd, pfmri.pkg_name),
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   937
                                    exit=1)
1784
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   938
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   939
                        for bad_group in ("", 'group=""', "group=invalidgroup"):
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   940
                                self.debug("Testing with bad group "
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   941
                                    "'%s'." % bad_group)
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   942
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   943
                                bad_mdata = mdata.replace("group=bin",
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   944
                                    bad_group)
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   945
                                self.write_img_manifest(pfmri, bad_mdata)
2808
05c6015a8c62 7195369 corrupt manifests can end up on disk when -g is used
Dan Price <daniel.price@oracle.com>
parents: 2756
diff changeset
   946
                                self.pkg("--debug manifest_validate=Never "
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   947
                                    "%s %s" % (install_cmd, pfmri.pkg_name),
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   948
                                    exit=1)
1784
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   949
e69b4aa1a6b5 791 stack trace when installing directory or file with missing mandatory attributes
Shawn Walker <srw@sun.com>
parents: 1778
diff changeset
   950
                        # Now attempt to corrupt the client's copy of the
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   951
                        # manifest such that actions are malformed.
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   952
                        for bad_act in (
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   953
                            'set name=description value="" \" my desc \" ""',
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   954
                            "set name=com.sun.service.escalations value="):
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   955
                                self.debug("Testing with bad action "
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   956
                                    "'%s'." % bad_act)
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   957
                                bad_mdata = mdata + "%s\n" % bad_act
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   958
                                self.write_img_manifest(pfmri, bad_mdata)
2808
05c6015a8c62 7195369 corrupt manifests can end up on disk when -g is used
Dan Price <daniel.price@oracle.com>
parents: 2756
diff changeset
   959
                                self.pkg("--debug manifest_validate=Never "
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   960
                                    "%s %s" % (install_cmd, pfmri.pkg_name),
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
   961
                                    exit=1)
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
   962
594
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents: 590
diff changeset
   963
        def test_bug_3770(self):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   964
                """ Try to install a package from a publisher with an
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   965
                unavailable repository. """
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   966
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   967
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   968
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   969
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   970
                # Depot hasn't been started, so client can't connect.
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   971
                self.pkg("set-publisher --no-refresh -O %s test" % self.durl)
594
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents: 590
diff changeset
   972
                self.pkg("install [email protected]", exit=1)
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents: 590
diff changeset
   973
1211
cb66dbad522f 9929 Captive portal overzealously tested
johansen <johansen@sun.com>
parents: 1158
diff changeset
   974
        def test_bug_9929(self):
2149
1f90c73bcde3 8035 imageplan post execute should remove unused manifests
Shawn Walker <shawn.walker@oracle.com>
parents: 2144
diff changeset
   975
                """Make sure that we can uninstall a package that already
1f90c73bcde3 8035 imageplan post execute should remove unused manifests
Shawn Walker <shawn.walker@oracle.com>
parents: 2144
diff changeset
   976
                has its contents on disk even when the repository isn't
1f90c73bcde3 8035 imageplan post execute should remove unused manifests
Shawn Walker <shawn.walker@oracle.com>
parents: 2144
diff changeset
   977
                accessible."""
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   978
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   979
                # Depot required for this test since client doesn't cache
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   980
                # files from a file repository by default.
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   981
                self.dc.start()
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   982
                self.pkgsend_bulk(self.durl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   983
                self.image_create(self.durl)
1211
cb66dbad522f 9929 Captive portal overzealously tested
johansen <johansen@sun.com>
parents: 1158
diff changeset
   984
cb66dbad522f 9929 Captive portal overzealously tested
johansen <johansen@sun.com>
parents: 1158
diff changeset
   985
                self.pkg("install foo")
cb66dbad522f 9929 Captive portal overzealously tested
johansen <johansen@sun.com>
parents: 1158
diff changeset
   986
2144
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
   987
                # Stop depot, so client can't connect.
1211
cb66dbad522f 9929 Captive portal overzealously tested
johansen <johansen@sun.com>
parents: 1158
diff changeset
   988
                self.dc.stop()
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
   989
                self.pkg("set-publisher --no-refresh -O %s test" % self.durl)
1211
cb66dbad522f 9929 Captive portal overzealously tested
johansen <johansen@sun.com>
parents: 1158
diff changeset
   990
                self.pkg("uninstall foo")
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
   991
1956
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   992
        def test_bug_16189(self):
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   993
                """Create a repository with a pair of manifests.  Have
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   994
                pkg A depend upon pkg B.  Rename pkg B on the depot-side
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   995
                and attempt to install. This should fail, but not traceback.
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   996
                Then, modify the manifest on the serverside, ensuring that
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   997
                the contents don't match the hash.  Then try the install again.
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   998
                This should also fail, but not traceback."""
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
   999
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1000
                afmri = self.pkgsend_bulk(self.rurl, self.a16189)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1001
                bfmri = self.pkgsend_bulk(self.rurl, self.b16189)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1002
                self.image_create(self.rurl)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1003
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1004
                repo = self.dc.get_repo()
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1005
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1006
                bpath = repo.manifest(bfmri[0])
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1007
                old_dirname = os.path.basename(os.path.dirname(bpath))
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1008
                old_dirpath = os.path.dirname(os.path.dirname(bpath))
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1009
                new_dirname = "potato"
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1010
                old_path = os.path.join(old_dirpath, old_dirname)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1011
                new_path = os.path.join(old_dirpath, new_dirname)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1012
                os.rename(old_path, new_path)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1013
                self.pkg("install a16189", exit=1)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1014
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1015
                os.rename(new_path, old_path)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1016
                self.image_destroy()
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1017
                self.image_create(self.rurl)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1018
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1019
                apath = repo.manifest(afmri[0])
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1020
                afobj = open(apath, "w")
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1021
                afobj.write("set name=pkg.summary value=\"banana\"\n")
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1022
                afobj.close()
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1023
                self.pkg("install a16189", exit=1)
62313f241a4d 16366 Fix for 16189 misses additional corner cases
johansen <johansen@opensolaris.org>
parents: 1903
diff changeset
  1024
2876
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1025
        def test_install_fuzz(self):
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1026
                """Verify that packages delivering files with whitespace in
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1027
                their paths can be installed or exact-installed, updated, and
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1028
                uninstalled."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1029
2876
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1030
                self.pkgsend_bulk(self.rurl, self.fuzzy)
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1031
                self.image_create(self.rurl)
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1032
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  1033
                self.pkg("install fuzzy@1")
2876
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1034
                self.pkg("verify -v")
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1035
                self.pkg("update -vvv fuzzy@2")
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1036
                self.pkg("verify -v")
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1037
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1038
                for name in (
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1039
                    "opt/dir with white\tspace/cat in a hat",
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1040
                    "etc/cat_link",
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1041
                ):
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1042
                        self.debug("fname: %s" % name)
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1043
                        self.assert_(os.path.exists(os.path.join(self.get_img_path(),
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1044
                            name)))
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1045
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1046
                self.pkg("uninstall -vvv fuzzy")
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1047
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1048
        def test_sysattrs(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1049
                """Test install with setting system attributes."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1050
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1051
                if portable.osname != "sunos":
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1052
                        raise pkg5unittest.TestSkippedException(
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1053
                            "System attributes unsupported on this platform.")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1054
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1055
                plist = self.pkgsend_bulk(self.rurl, [self.secret1,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1056
                    self.secret2, self.secret3, self.secret4])
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1057
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1058
                # Need to create an image in /var/tmp since sysattrs don't work
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1059
                # in tmpfs.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1060
                self.debug(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1061
                old_img_path = self.img_path()
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1062
                self.set_img_path(tempfile.mkdtemp(dir="/var/tmp"))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1063
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1064
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1065
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1066
                # test without permission for setting sensitive system attribute
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1067
                self.pkg("install secret1", su_wrap=True, exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1068
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1069
                # now some tests which should succeed
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1070
                self.pkg("install secret1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1071
                fpath = os.path.join(self.img_path(),"p1/cat")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1072
                p = subprocess.Popen(["/usr/bin/ls", "-/", "c", fpath],
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1073
                    stdout=subprocess.PIPE)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1074
                out, err = p.communicate()
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1075
                expected = "{AH-----m----T}"
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1076
                self.assertTrue(expected in out, out)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1077
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1078
                self.pkg("install secret2")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1079
                fpath = os.path.join(self.img_path(),"p2/cat")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1080
                p = subprocess.Popen(["/usr/bin/ls", "-/", "c", fpath],
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1081
                    stdout=subprocess.PIPE)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1082
                out, err = p.communicate()
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1083
                expected = "{AH-----m----T}"
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1084
                self.assertTrue(expected in out, out)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1085
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1086
                # test some packages with invalid sysattrs
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1087
                self.pkg("install secret3", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1088
                self.pkg("install secret4", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1089
                shutil.rmtree(self.img_path())
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1090
                self.set_img_path(old_img_path)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1091
2876
fd422f3cc04f 16389464 multiple whitespaces in action path can cause package metadata errors
Shawn Walker <shawn.walker@oracle.com>
parents: 2869
diff changeset
  1092
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1093
class TestPkgInstallApache(pkg5unittest.ApacheDepotTestCase):
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1094
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1095
        # Only start/stop the depot once (instead of for every test)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1096
        persistent_setup = True
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1097
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1098
        foo11 = """
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1099
            open [email protected],5.11-0
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1100
            add dir mode=0755 owner=root group=bin path=/lib
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1101
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1 timestamp="20080731T024051Z"
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1102
            close """
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1103
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1104
        upgrade_np10 = """
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1105
            open [email protected],5.11-0
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1106
            close"""
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1107
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1108
        misc_files = [ "tmp/libc.so.1" ]
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1109
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1110
        def setUp(self):
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1111
                pkg5unittest.ApacheDepotTestCase.setUp(self, ["test1", "test2"],
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1112
                    start_depots=True)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1113
                self.make_misc_files(self.misc_files)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1114
                self.durl1 = self.dcs[1].get_depot_url()
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1115
                self.durl2 = self.dcs[2].get_depot_url()
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1116
                self.pkgsend_bulk(self.durl1, self.foo11)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1117
                self.pkgsend_bulk(self.durl2, self.upgrade_np10)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1118
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1119
        def test_corrupt_web_cache(self):
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1120
                """Make sure the client can detect corrupt content being served
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1121
                to it from a corrupt web cache, modifying its requests to
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1122
                retrieve correct content."""
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1123
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1124
                fmris = self.pkgsend_bulk(self.durl1, (self.foo11,
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1125
                    self.upgrade_np10))
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1126
                # we need to record just the version string of foo in order
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1127
                # to properly quote it later.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1128
                foo_version = fmris[0].split("@")[1]
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1129
                self.image_create(self.durl1)
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1130
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1131
                # we use the system repository as a convenient way to setup
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1132
                # a caching proxy
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1133
                self.sysrepo("")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1134
                sc_runtime_dir = os.path.join(self.test_root, "sysrepo_runtime")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1135
                sc_conf = os.path.join(sc_runtime_dir, "sysrepo_httpd.conf")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1136
                sc_cache = os.path.join(self.test_root, "sysrepo_cache")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1137
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1138
                # ensure pkg5srv can write cache content
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1139
                os.chmod(sc_cache, 0777)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1140
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1141
                sysrepo_port = self.next_free_port
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1142
                self.next_free_port += 1
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1143
                sc = pkg5unittest.SysrepoController(sc_conf,
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1144
                    sysrepo_port, sc_runtime_dir, testcase=self)
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1145
                self.register_apache_controller("sysrepo", sc)
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1146
                sc.start()
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1147
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1148
                sysrepo_url = "http://localhost:%s" % sysrepo_port
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1149
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1150
                saved_pkg_sysrepo_env = os.environ.get("PKG_SYSREPO_URL")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1151
                os.environ["PKG_SYSREPO_URL"] = sysrepo_url
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1152
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1153
                # create an image, installing a package, to warm up the webcache
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1154
                self.image_create(props={"use-system-repo": True})
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1155
                self.pkg("install [email protected]")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1156
                self.pkg("uninstall foo")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1157
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1158
                # now recreate the image.  image_create calls image_destroy,
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1159
                # thereby cleaning any cached content in the image.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1160
                self.image_create(props={"use-system-repo": True})
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1161
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1162
                def corrupt_path(path, value="noodles\n", rename=False):
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1163
                        """Given a path, corrupt its contents."""
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1164
                        self.assert_(os.path.exists(path))
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  1165
                        if rename:
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1166
                                os.rename(path, path + ".not-corrupt")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1167
                                open(path, "wb").write(value)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1168
                        else:
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1169
                                df = open(path, "wb")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1170
                                df.write(value)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1171
                                df.close()
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1172
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1173
                def corrupt_cache(cache_dir):
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1174
                        """Given an apache cache, corrupt it's contents."""
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1175
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1176
                        for dirpath, dirname, filenames in os.walk(cache_dir):
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1177
                                for name in filenames:
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1178
                                        if name.endswith(".header"):
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1179
                                                data = name.replace(".header",
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1180
                                                    ".data")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1181
                                                corrupt_path(os.path.join(
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1182
                                                    dirpath, data))
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1183
                # corrupt our web cache
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1184
                corrupt_cache(sc_cache)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1185
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1186
                urls = [
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1187
                    # we need to quote the version carefully to use exactly the
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1188
                    # format pkg(1) uses - two logically identical urls that
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1189
                    # differ only by the way they're quoted are treated by
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1190
                    # Apache as separate cacheable resources.
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1191
                    "%s/test1/manifest/0/foo@%s" % (self.durl1, urllib2.quote(
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1192
                    foo_version)),
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1193
                    "%s/test1/file/1/8535c15c49cbe1e7cb1a0bf8ff87e512abed66f8" %
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1194
                    self.durl1,
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1195
                ]
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1196
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1197
                proxy_handler = urllib2.ProxyHandler({"http": sysrepo_url})
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1198
                proxy_opener = urllib2.build_opener(proxy_handler)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1199
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1200
                # validate that our cache is returning corrupt urls.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1201
                for url in urls:
2756
04d926cf9f51 7140807 sysrepo should not cache catalog responses
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2753
diff changeset
  1202
                        self.debug("url:%s" % url)
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1203
                        # we should get clean content when we don't use the
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1204
                        # cache
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1205
                        u = urllib2.urlopen(url)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1206
                        content = u.readlines()
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1207
                        self.assert_(content != ["noodles\n"],
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1208
                            "Unexpected content from depot")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1209
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1210
                        # get the corrupted version, and verify it is broken
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1211
                        req = urllib2.Request(url)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1212
                        u = proxy_opener.open(req)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1213
                        content = u.readlines()
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1214
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1215
                        self.assert_(content == ["noodles\n"],
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1216
                            "Expected noodles, got %s for %s" % (content, url))
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1217
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1218
                # the following should work, as pkg should retry requests
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1219
                # where it has detected corrupt contents with a
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1220
                # "Cache-Control: no-cache" header.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1221
                self.pkg("refresh --full")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1222
                self.pkg("contents -rm [email protected]")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1223
                self.pkg("install [email protected]")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1224
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1225
                # since the cache has been refreshed, we should see valid
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1226
                # contents when going through the proxy now.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1227
                for url in urls:
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1228
                        req = urllib2.Request(url)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1229
                        u = proxy_opener.open(req)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1230
                        content = u.readlines()
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1231
                        self.assert_(content != ["noodles\n"],
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1232
                            "Unexpected content from depot")
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1233
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1234
                # ensure that when we actually corrupt the repository
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1235
                # as well as the cache, we do detect the errors properly.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1236
                corrupt_cache(sc_cache)
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1237
                repodir = self.dcs[1].get_repodir()
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1238
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1239
                prefix = "publisher/test1"
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1240
                self.image_create(props={"use-system-repo": True})
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1241
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1242
                # When we corrupt the files in the repository, we intentionally
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1243
                # corrupt them with different contents than the the cache,
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1244
                # allowing us to check the error messages being printed by the
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1245
                # transport subsystem.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1246
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1247
                filepath = os.path.join(repodir,
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1248
                    "%s/file/85/8535c15c49cbe1e7cb1a0bf8ff87e512abed66f8" %
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1249
                    prefix)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1250
                mfpath = os.path.join(repodir, "%s/pkg/foo/%s" % (prefix,
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1251
                    urllib2.quote(foo_version)))
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1252
                catpath = os.path.join(repodir, "%s/catalog/catalog.base.C" %
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1253
                    prefix)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1254
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1255
                try:
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1256
                        # first corrupt the file
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1257
                        corrupt_path(filepath, value="spaghetti\n", rename=True)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1258
                        self.pkg("install [email protected]", stderr=True, exit=1)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1259
                        os.rename(filepath + ".not-corrupt", filepath)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1260
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1261
                        # we should be getting two hash errors, one from the
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1262
                        # cache, one from the repo. The one from the repo should
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1263
                        # repeat
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1264
                        self.assert_(
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1265
                            "1: Invalid contentpath lib/libc.so.1: chash" in
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1266
                            self.errout)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1267
                        self.assert_(
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1268
                            "2: Invalid contentpath lib/libc.so.1: chash" in
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1269
                            self.errout)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1270
                        self.assert_("(happened 3 times)" in self.errout)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1271
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1272
                        # now corrupt the manifest (we have to re-corrupt the
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1273
                        # cache, since attempting to install foo above would
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1274
                        # have caused the cache to refetch the valid manifest
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1275
                        # from the repo) and remove the version of the manifest
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1276
                        # cached in the image.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1277
                        corrupt_cache(sc_cache)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1278
                        corrupt_path(mfpath, value="spaghetti\n", rename=True)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1279
                        shutil.rmtree(os.path.join(self.img_path(),
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1280
                            "var/pkg/publisher/test1/pkg"))
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1281
                        self.pkg("contents -rm [email protected]", stderr=True, exit=1)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1282
                        os.rename(mfpath + ".not-corrupt", mfpath)
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  1283
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1284
                        # we should get two hash errors, one from the cache, one
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1285
                        # from the repo - the one from the repo should repeat.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1286
                        self.assert_(
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1287
                            "1: Invalid content: manifest hash failure" in
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1288
                            self.errout)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1289
                        self.assert_("2: Invalid content: manifest hash failure"
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1290
                            in self.errout)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1291
                        self.assert_("(happened 3 times)" in self.errout)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1292
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1293
                        # finally, corrupt the catalog. Given we've asked for a
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1294
                        # full refresh, we retrieve the upstream version only.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1295
                        corrupt_path(catpath, value="spaghetti\n", rename=True)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1296
                        self.pkg("refresh --full", stderr=True, exit=1)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1297
                        self.assert_("catalog.base.C' is invalid." in
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1298
                            self.errout)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1299
                        os.rename(catpath + ".not-corrupt", catpath)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1300
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1301
                finally:
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1302
                        # make sure we clean up any corrupt repo contents.
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1303
                        for path in [filepath, mfpath, catpath]:
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1304
                                not_corrupt = path + ".not-corrupt"
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1305
                                if os.path.exists(not_corrupt):
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1306
                                        os.rename(not_corrupt, path)
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1307
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1308
                        if saved_pkg_sysrepo_env:
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1309
                                os.environ["PKG_SYSREPO_URL"] = \
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1310
                                    saved_pkg_sysrepo_env
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1311
2830
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1312
        def test_granular_proxy(self):
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1313
                """Tests that images can use the set-publisher --proxy argument
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1314
                to selectively proxy requests."""
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1315
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1316
                # we use the system repository as a convenient way to setup
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1317
                # a caching proxy.   Since the image doesn't have the property
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1318
                # 'use-system-repo=True', the configuration of the sysrepo
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1319
                # will remain static.
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1320
                self.image_create(self.durl1)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1321
                self.sysrepo("")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1322
                sc_runtime_dir = os.path.join(self.test_root, "sysrepo_runtime")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1323
                sc_conf = os.path.join(sc_runtime_dir, "sysrepo_httpd.conf")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1324
                sc_cache = os.path.join(self.test_root, "sysrepo_cache")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1325
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1326
                # ensure pkg5srv can write cache content
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1327
                os.chmod(sc_cache, 0777)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1328
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1329
                sysrepo_port = self.next_free_port
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1330
                self.next_free_port += 1
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1331
                sc = pkg5unittest.SysrepoController(sc_conf,
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1332
                    sysrepo_port, sc_runtime_dir, testcase=self)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1333
                self.register_apache_controller("sysrepo", sc)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1334
                sc.start()
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1335
                sysrepo_url = "http://localhost:%s" % sysrepo_port
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1336
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1337
                self.image_create()
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1338
                self.pkg("set-publisher -p %s --proxy %s" % (self.durl1,
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1339
                    sysrepo_url))
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1340
                self.pkg("install foo")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1341
                self.pkg("uninstall foo")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1342
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1343
                sc.stop()
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1344
                # with our proxy offline, and with no other origins
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1345
                # available, we should be unable to install
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1346
                self.pkg("install --no-refresh foo", exit=1)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1347
                sc.start()
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1348
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1349
                # we cannot add another origin with the same url
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1350
                self.pkg("set-publisher --no-refresh -g %s test1" %
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1351
                    self.durl1, exit=1)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1352
                # we cannot add another proxied origin with that url
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1353
                self.pkg("set-publisher --no-refresh -g %s "
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1354
                    "--proxy http://noodles test1" % self.durl1,
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1355
                    exit=1)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1356
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1357
                # Now add a second, unproxied publisher, ensuring we
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1358
                # can install packages from there.  Since the proxy
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1359
                # isn't configured to proxy that resource, this tests
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1360
                # that the proxy for self.durl1 isn't being used.
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1361
                self.pkg("set-publisher -g %s test2" % self.durl2)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1362
                self.pkg("install --no-refresh "
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1363
                    "pkg://test2/[email protected]")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1364
                self.pkg("uninstall pkg://test2/[email protected]")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1365
                self.pkg("set-publisher -G %s test2" % self.durl2)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1366
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1367
                # check that runtime proxies are being used - we
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1368
                # set a bogus proxy, then ensure our $http_proxy value
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1369
                # gets used.
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1370
                self.pkg("publisher")
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1371
                self.pkg("set-publisher -G %s test1" % self.durl1)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1372
                self.pkg("set-publisher --no-refresh -g %s "
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1373
                    "--proxy http://noodles test1" % self.durl1)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1374
                env = {"http_proxy": sysrepo_url}
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1375
                self.pkg("refresh", env_arg=env)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1376
                self.pkg("install foo", env_arg=env)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1377
                self.pkg("uninstall foo", env_arg=env)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1378
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1379
                # check that $all_proxy works
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1380
                env = {"all_proxy": sysrepo_url}
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1381
                self.pkg("install foo", env_arg=env)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1382
                self.pkg("uninstall foo", env_arg=env)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1383
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1384
                # now check that no_proxy works
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1385
                env["no_proxy"] = "*"
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1386
                self.pkg("install foo", env_arg=env)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1387
                self.pkg("refresh --full", env_arg=env)
ef033a81a335 15785921 test suite should use apache worker mpm rather than prefork
Tim Foster <tim.s.foster@oracle.com>
parents: 2818
diff changeset
  1388
2642
5b92d3ae1b76 7112857 transport could try harder when being fed corrupt data
Tim Foster <tim.s.foster@oracle.com>
parents: 2620
diff changeset
  1389
2753
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1390
class TestPkgInstallRepoPerTest(pkg5unittest.SingleDepotTestCase):
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1391
        persistent_setup = False
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1392
        # Tests in this suite use the read only data directory.
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1393
        need_ro_data = True
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1394
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1395
        foo10 = """
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1396
            open [email protected],5.11-0
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1397
            close """
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1398
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1399
        disappear10 = """
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1400
            open [email protected],5.11-0
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1401
            add file tmp/cat mode=0555 owner=root group=bin path=/bin/cat
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1402
            close """
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1403
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1404
        disappear11 = """
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1405
            open [email protected],5.11-0
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1406
            close """
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1407
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1408
        misc_files = ["tmp/cat"]
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1409
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1410
        def setUp(self):
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1411
                pkg5unittest.SingleDepotTestCase.setUp(self)
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1412
                self.make_misc_files(self.misc_files)
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1413
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1414
        def test_install_changed_manifest(self):
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1415
                """Test that if a manifest that is being installed is cached
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1416
                locally has been changed on the repo is updated, the new
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1417
                manifest is used."""
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1418
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1419
                plist = self.pkgsend_bulk(self.rurl, self.foo10)
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1420
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1421
                self.image_create(self.rurl)
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1422
                self.seed_ta_dir("ta3")
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1423
                api_inst = self.get_img_api_obj()
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1424
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1425
                # Use pkg contents to cache the manifest.
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1426
                self.pkg("contents -r foo")
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1427
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1428
                # Specify location as filesystem path.
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1429
                self.pkgsign_simple(self.dc.get_repodir(), plist[0])
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1430
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1431
                # Ensure that the image requires signed manifests.
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1432
                self.pkg("set-property signature-policy require-signatures")
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1433
                api_inst.reset()
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1434
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1435
                # Install the package
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1436
                self._api_install(api_inst, ["foo"])
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1437
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1438
        def test_keep_installed_changed_manifest(self):
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1439
                """Test that if a manifest that has been installed is changed on
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1440
                the server is updated, the installed manifest is not changed."""
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1441
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1442
                pfmri = self.pkgsend_bulk(self.rurl, self.disappear10)[0]
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1443
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1444
                self.image_create(self.rurl)
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1445
                api_inst = self.get_img_api_obj()
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1446
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1447
                # Install the package
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1448
                self._api_install(api_inst, ["disappear"])
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1449
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1450
                self.assert_(os.path.isfile(os.path.join(
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1451
                    self.img_path(), "bin", "cat")))
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1452
                repo = self.dc.get_repo()
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1453
                m_path = repo.manifest(pfmri)
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1454
                with open(m_path, "rb") as fh:
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1455
                        fmri_lines = fh.readlines()
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1456
                with open(m_path, "wb") as fh:
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1457
                        for l in fmri_lines:
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1458
                                if "usr/bin/cat" in l:
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1459
                                        continue
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1460
                                fh.write(l)
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1461
                repo.rebuild()
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1462
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1463
                pfmri = self.pkgsend_bulk(self.rurl, self.disappear11)[0]
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1464
                self._api_update(api_inst)
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1465
                self.assert_(not os.path.isfile(os.path.join(
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1466
                    self.img_path(), "bin", "cat")))
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1467
4d4b2324d1c0 7139940 cached manifests persist for packages not currently installed even when copy in repository changes
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2729
diff changeset
  1468
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1469
class TestPkgActuators(pkg5unittest.SingleDepotTestCase):
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1470
        """Test package actuators"""
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1471
        persistent_setup = True
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1472
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1473
        pkgs = (
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1474
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1475
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1476
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1477
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1478
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1479
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1480
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1481
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1482
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1483
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1484
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1485
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1486
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1487
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1488
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1489
                """
3288
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1490
                    open [email protected],5.11-0
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1491
                    add depend type=require fmri=trigger
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1492
                    close """,
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1493
                """
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1494
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1495
                    add set name=pkg.additional-update-on-uninstall value=A@2
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1496
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1497
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1498
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1499
                    add set pkg.additional-update-on-uninstall=A@1
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1500
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1501
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1502
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1503
                    add set name=pkg.additional-uninstall-on-uninstall value=A
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1504
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1505
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1506
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1507
                    add set pkg.additional-uninstall-on-uninstall=A
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1508
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1509
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1510
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1511
                    add set name=pkg.additional-uninstall-on-uninstall value=A@2 value=B@2
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1512
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1513
                """
3286
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1514
                    open [email protected],5.11-0
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1515
                    add set name=pkg.additional-uninstall-on-uninstall value=A@1
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1516
                    close """,
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1517
                """
3288
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1518
                    open [email protected],5.11-0
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1519
                    add set name=pkg.additional-uninstall-on-uninstall value=C
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1520
                    close """,
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1521
                """
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1522
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1523
                    add set name=pkg.additional-update-on-uninstall value=evil@2
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1524
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1525
                """
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1526
                    open [email protected],5.11-0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1527
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1528
                )
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1529
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1530
        def setUp(self):
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1531
                pkg5unittest.SingleDepotTestCase.setUp(self)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1532
                self.pkgsend_bulk(self.rurl, self.pkgs)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1533
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1534
        def test_basics(self):
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1535
                """Test that pkg actuators work as expected."""
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1536
                # prepare image
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1537
                self.image_create(self.rurl)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1538
                self.pkg("install A@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1539
                self.pkg("install -v trigger@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1540
                self.pkg("list A@1 trigger@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1541
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1542
                # update on uninstall
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1543
                self.pkg("uninstall -v trigger")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1544
                self.pkg("list A@2")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1545
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1546
                self.pkg("install -v trigger@2")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1547
                self.pkg("uninstall -v trigger")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1548
                self.pkg("list A@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1549
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1550
                # uninstall on uninstall
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1551
                self.pkg("install -v trigger@3")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1552
                self.pkg("uninstall -v trigger")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1553
                self.pkg("list A", exit=1)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1554
3286
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1555
                # verify unversioned actuator triggers
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1556
                self.pkg("install -v trigger@4 A@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1557
                self.pkg("uninstall -v trigger")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1558
                self.pkg("list A", exit=1)
3286
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1559
                self.pkg("install -v trigger@4 A@2")
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1560
                self.pkg("uninstall -v trigger")
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1561
                self.pkg("list A", exit=1)
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1562
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1563
                # verify correct version is uninstalled
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1564
                self.pkg("install -v trigger@6 A@1")
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1565
                self.pkg("uninstall -v trigger")
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1566
                self.pkg("list A", exit=1)
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1567
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1568
                # verify non-matching version is not installed
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1569
                self.pkg("install -v trigger@6 A@2")
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1570
                self.pkg("uninstall -v trigger")
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1571
                self.pkg("list A")
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1572
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1573
                # multiple values
3286
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1574
                self.pkg("install -v trigger@5 A@2 B@2")
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1575
                self.pkg("uninstall -v trigger")
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1576
                self.pkg("list A B", exit=1)
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1577
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1578
                # multiple values but at different versions
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1579
                self.pkg("install -v trigger@5 A@1 B@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1580
                self.pkg("uninstall -v trigger")
3286
06d211f2e94d 21754883 pkg.additional uninstall on uninstall does not remove named package
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3283
diff changeset
  1581
                self.pkg("list A@1 B@1")
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1582
3288
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1583
                # removal pkg depends on trigger
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1584
                self.pkg("install -v trigger@7 C")
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1585
                self.pkg("uninstall -v trigger")
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1586
                self.pkg("list C", exit=1)
f1f511a129ca 21911413 pkg triggered uninstalls fail if pkg to be removed depends on trigger
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3286
diff changeset
  1587
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1588
                # test that uninstall actuators also work when pkg is rejected
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1589
                self.pkg("install -v A@1 trigger@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1590
                self.pkg("list A@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1591
                # install with reject
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1592
                self.pkg("install --reject trigger B@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1593
                self.pkg("list A@2")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1594
                # update with reject
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1595
                self.pkg("install -v trigger@2")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1596
                self.pkg("update -v --reject trigger B@2")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1597
                self.pkg("list A@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1598
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1599
                # self-referencing (evil) pkgs
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1600
                self.pkg("install -v evil@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1601
                # solver will complain about passing same pkg to reject and
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1602
                # proposed dict
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1603
                self.pkg("uninstall -v evil@1", exit=1)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1604
                # try workaround
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1605
                self.cmdline_run("pkg -R %s -D ignore-pkg-actuators=true " \
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1606
                    "uninstall -v evil@1" % self.get_img_path())
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1607
                self.pkg("list evil", exit=1)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1608
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1609
                # Test overlapping user and actuator pkg requests.
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1610
                # Since actuators are treated like user requests, the solver
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1611
                # will pick the latest one.
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1612
                self.pkg("install -v A@1 trigger@1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1613
                # update with reject
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1614
                self.pkg("update --parsable=0 --reject trigger [email protected]")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1615
                self.pkg("list A@2")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1616
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1617
2183
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1618
class TestPkgInstallUpdateReject(pkg5unittest.SingleDepotTestCase):
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1619
        """Test --reject option to pkg update/install"""
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1620
        persistent_setup = True
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1621
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1622
        pkgs = (
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1623
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1624
                    open [email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1625
                    add depend type=require-any fmri=pkg:/[email protected] fmri=pkg:/[email protected]
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1626
                    close """,
2445
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1627
                """
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1628
                    open [email protected],5.11-0
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1629
                    add depend type=require-any fmri=pkg:/[email protected] fmri=pkg:/[email protected]
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1630
                    close """,
2183
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1631
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1632
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1633
                    open [email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1634
                    add depend type=exclude fmri=pkg:/C
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1635
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1636
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1637
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1638
                    open [email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1639
                    add depend type=exclude fmri=pkg:/B
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1640
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1641
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1642
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1643
                    open [email protected],5.11-0.1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1644
                    add depend type=require fmri=pkg:/incorp
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1645
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1646
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1647
                """
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1648
                    open [email protected],5.11-0.1
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1649
                    add depend type=require fmri=pkg:/incorp
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1650
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1651
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1652
                """
2183
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1653
                    open [email protected],5.11-0.2
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1654
                    add depend type=require fmri=pkg:/incorp
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1655
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1656
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1657
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1658
                    open [email protected],5.11-0.1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1659
                    add depend type=incorporate [email protected],5.11-0.1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1660
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1661
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1662
                 """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1663
                    open [email protected],5.11-0.2
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1664
                    add depend type=incorporate [email protected],5.11-0.2
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1665
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1666
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1667
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1668
                    open [email protected],5.11-0.1.1.0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1669
                    add depend type=require fmri=pkg:/incorp
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1670
                    add depend type=require fmri=pkg:/idr1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1671
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1672
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1673
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1674
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1675
                    open [email protected],5.11-0.1.1.1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1676
                    add depend type=require fmri=pkg:/incorp
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1677
                    add depend type=require fmri=pkg:/idr1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1678
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1679
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1680
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1681
                    open [email protected],5.11-0.1.2.0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1682
                    add depend type=require fmri=pkg:/incorp
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1683
                    add depend type=require fmri=pkg:/idr2
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1684
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1685
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1686
                """
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1687
                    open [email protected],5.11-0.1.1.0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1688
                    add depend type=require fmri=pkg:/incorp
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1689
                    add depend type=require fmri=pkg:/idrX
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1690
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1691
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1692
                """
2183
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1693
                    open [email protected],5.11-0.1.1.0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1694
                    add depend type=incorporate [email protected],5.11-0.1.1.0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1695
                    add depend type=require fmri=idr1_entitlement
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1696
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1697
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1698
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1699
                    open [email protected],5.11-0.1.1.1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1700
                    add depend type=incorporate [email protected],5.11-0.1.1.1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1701
                    add depend type=require fmri=idr1_entitlement
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1702
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1703
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1704
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1705
                    open [email protected],5.11-0.1.2.0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1706
                    add depend type=incorporate [email protected],5.11-0.1.2.0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1707
                    add depend type=require fmri=idr2_entitlement
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1708
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1709
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1710
                """
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1711
                    open [email protected],5.11-0.1.1.0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1712
                    add set name=pkg.additional-update-on-uninstall [email protected],5.11-0.1
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1713
                    add depend type=incorporate [email protected],5.11-0.1.1.0
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1714
                    add depend type=require fmri=idr1_entitlement
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1715
                    close """,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1716
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1717
                """
2183
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1718
                    open [email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1719
                    add depend type=exclude fmri=no-idrs
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1720
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1721
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1722
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1723
                    open [email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1724
                    add depend type=exclude fmri=no-idrs
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1725
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1726
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1727
                # hack to prevent idrs from being installed from repo...
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1728
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1729
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1730
                    open [email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1731
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1732
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1733
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1734
                    open pkg://contrib/[email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1735
                    add depend type=exclude fmri=A
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1736
                    add depend type=require fmri=bogus1
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1737
                    add depend type=require fmri=bogus2
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1738
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1739
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1740
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1741
                    open pkg://contrib/[email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1742
                    add depend type=exclude fmri=B
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1743
                    close """,
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1744
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1745
                """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1746
                    open pkg://contrib/[email protected],5.11-0
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1747
                    add depend type=exclude fmri=C
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1748
                    close """
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1749
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1750
                )
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1751
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1752
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1753
        def setUp(self):
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1754
                pkg5unittest.SingleDepotTestCase.setUp(self)
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1755
                self.pkgsend_bulk(self.rurl, self.pkgs)
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1756
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1757
        def test_install(self):
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1758
                self.image_create(self.rurl, prefix="")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1759
                # simple test of reject
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1760
                self.pkg("install --reject B A")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1761
                self.pkg("list A C")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1762
                self.pkg("uninstall '*'")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1763
                self.pkg("install --reject C A")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1764
                self.pkg("list A B")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1765
                self.pkg("uninstall '*'")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1766
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1767
                # test swapping XOR'd pkgs B & C w/o uninstalling A
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1768
                self.pkg("install B")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1769
                self.pkg("install A")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1770
                self.pkg("list A B")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1771
                self.pkg("install --reject B C")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1772
                self.pkg("list A C")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1773
                self.pkg("uninstall '*'")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1774
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1775
                # test that solver picks up on impossible cases
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1776
                self.pkg("install -v --reject B --reject C A", exit=1)
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1777
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1778
                # test that publisher matching works
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1779
                self.pkg("install bogus")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1780
                self.pkg("list bogus")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1781
                self.pkg("install --reject B --reject 'pkg://contrib/*' A")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1782
2445
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1783
                # verify that matching accounts for reject.
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1784
                self.pkg("uninstall '*'")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1785
                self.pkg("install -v --reject A A", exit=1)
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1786
                self.pkg("install -v --reject 'idr*' --reject 'bogus*' "
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1787
                    "--reject B '*'")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1788
                self.pkg("list 'idr*' 'bogus*' B", exit=1)
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1789
                self.pkg("list A C incorp kernel no-idrs")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1790
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1791
        def test_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1792
                """Test that the --reject option performs as expected."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1793
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1794
                self.image_create(self.rurl, prefix="")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1795
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1796
                # test basic usage of --reject
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1797
                self.pkg("exact-install --reject B A")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1798
                self.pkg("list A C")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1799
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1800
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1801
                # test swapping XOR'd pkgs B & C.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1802
                self.pkg("install B")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1803
                self.pkg("install A")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1804
                self.pkg("list A B")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1805
                self.pkg("exact-install --reject B A")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1806
                self.pkg("list A C")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1807
                self.pkg("list B", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1808
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1809
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1810
                # test that solver picks up on impossible cases fails
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1811
                self.pkg("exact-install -v --reject B --reject C A", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1812
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1813
                # test that publisher matching works.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1814
                self.pkg("install bogus")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1815
                self.pkg("list bogus")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1816
                self.pkg("exact-install --reject B --reject "
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1817
                    "'pkg://contrib/*' A")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1818
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1819
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1820
                # verify that matching accounts for reject with --exact option.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1821
                self.pkg("exact-install -v --reject A A", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1822
                self.pkg("exact-install -v --reject 'idr*' --reject 'bogus*' "
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1823
                    "--reject B '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1824
                self.pkg("list 'idr*' 'bogus*' B", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1825
                self.pkg("list A C incorp kernel no-idrs")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1826
2183
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1827
        def test_idr(self):
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1828
                self.image_create(self.rurl)
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1829
                # install kernel pkg; remember version so we can reinstall it later
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1830
                self.pkg("install no-idrs")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1831
                self.pkg("install -v [email protected],5.11-0.1")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1832
                self.pkg("list -Hv [email protected],5.11-0.1 | /usr/bin/awk '{print $1}'")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1833
                kernel_fmri = self.output
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1834
                # upgrade to next version w/o encountering idrs
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1835
                self.pkg("update -v");
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1836
                self.pkg("list [email protected],5.11-0.2")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1837
                self.pkg("list")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1838
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1839
                # try installing idr1; testing wild card support as well
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1840
                self.pkg("uninstall no-idrs")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1841
                self.pkg("install --reject 'k*' --reject 'i*'  no-idrs")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1842
                self.pkg("install -v [email protected],5.11-0.1")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1843
                self.pkg("install -v --reject no-idrs idr1_entitlement")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1844
                self.pkg("install -v [email protected],5.11-0.1.1.0")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1845
                self.pkg("update -v --reject idr2")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1846
                self.pkg("list [email protected],5.11-0.1.1.1")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1847
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1848
                # switch to idr2, which affects same package
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1849
                self.pkg("install -v --reject idr1 --reject 'idr1_*' idr2 idr2_entitlement")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1850
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1851
                # switch back to base version of kernel
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1852
                self.pkg("update -v --reject idr2 --reject 'idr2_*' %s" % kernel_fmri)
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1853
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1854
                # reinstall idr1, then update to version 2 of base kernel
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1855
                self.pkg("install -v [email protected],5.11-0.1.1.0 idr1_entitlement")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1856
                self.pkg("list [email protected],5.11-0.1.1.0")
2199
7ddd3f2cfb0b 17710 matching version class parsing fails if build version is omitted
Shawn Walker <shawn.walker@oracle.com>
parents: 2192
diff changeset
  1857
                # Wildcards are purposefully used here for both patterns to
7ddd3f2cfb0b 17710 matching version class parsing fails if build version is omitted
Shawn Walker <shawn.walker@oracle.com>
parents: 2192
diff changeset
  1858
                # ensure pattern matching works as expected for update.
7ddd3f2cfb0b 17710 matching version class parsing fails if build version is omitted
Shawn Walker <shawn.walker@oracle.com>
parents: 2192
diff changeset
  1859
                self.pkg("update -v --reject 'idr1*' '*[email protected]'")
2183
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1860
                self.pkg("list  [email protected],5.11-0.2")
21ae45e8dfcf 17581 There should be a way of removing a package as part of upgrade
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2164
diff changeset
  1861
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1862
        def test_idr_removal(self):
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1863
                """IDR removal with pkg actuators."""
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1864
                self.image_create(self.rurl)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1865
                self.pkg("install no-idrs")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1866
                self.pkg("install -v [email protected],5.11-0.1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1867
                self.pkg("list [email protected],5.11-0.1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1868
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1869
                # try installing idr
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1870
                self.pkg("install -v --reject no-idrs idr1_entitlement")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1871
                self.pkg("install -v [email protected],5.11-0.1.1.0")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1872
                # check if IDR pkgs got installed
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1873
                self.pkg("list [email protected],5.11-0.1.1.0")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1874
                self.pkg("list [email protected],5.11-0.1.1.0")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1875
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1876
                # uninstall IDR
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1877
                self.pkg("uninstall -v [email protected],5.11-0.1.1.0")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1878
                self.pkg("list [email protected],5.11-0.1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1879
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1880
                # try with reject
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1881
                self.pkg("install -v [email protected],5.11-0.1.1.0")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1882
                self.pkg("list [email protected],5.11-0.1.1.0")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1883
                self.pkg("list [email protected],5.11-0.1.1.0")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1884
                self.pkg("install --reject idrX B")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1885
                self.pkg("list [email protected],5.11-0.1")
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  1886
2295
5430fa2b6e53 18111 reject packages for update can cause solver traceback
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2294
diff changeset
  1887
        def test_update(self):
5430fa2b6e53 18111 reject packages for update can cause solver traceback
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2294
diff changeset
  1888
                self.image_create(self.rurl)
2445
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1889
                # Test update reject without wildcards.
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1890
                self.pkg("install  [email protected],5.11-0.1.1.0 [email protected],5.11-0")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1891
                self.pkg("update -v --reject A")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1892
                self.pkg("list A", exit=1)
2295
5430fa2b6e53 18111 reject packages for update can cause solver traceback
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2294
diff changeset
  1893
                self.pkg("verify")
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  1894
2445
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1895
                # Reinstall kernel package, install A, and test update again using
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1896
                # wildcards.
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1897
                self.pkg("uninstall '*'")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1898
                self.pkg("install [email protected],5.11-0.1.1.0")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1899
                self.pkg("list [email protected],5.11-0.1.1.0")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1900
                self.pkg("install [email protected],5.11-0")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1901
                self.pkg("update -v --reject A '*'")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1902
                self.pkg("list A", exit=1)
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1903
                self.pkg("list [email protected],5.11-0.1.1.1")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1904
                self.pkg("verify")
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1905
3ae7fde31e19 18512 install/update matching could account for reject matches
Shawn Walker <shawn.walker@oracle.com>
parents: 2400
diff changeset
  1906
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  1907
class TestPkgInstallAmbiguousPatterns(pkg5unittest.SingleDepotTestCase):
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1908
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1909
        # An "ambiguous" package name pattern is one which, because of the
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1910
        # pattern matching rules, might refer to more than one package.  This
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1911
        # may be as obvious as the pattern "SUNW*", but also like the pattern
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1912
        # "foo", where "foo" and "a/foo" both exist in the catalog.
922
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1913
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1914
        afoo10 = """
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1915
            open a/[email protected],5.11-0
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1916
            close """
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1917
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1918
        bfoo10 = """
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1919
            open b/[email protected],5.11-0
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1920
            close """
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1921
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1922
        bar10 = """
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1923
            open [email protected],5.11-0
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1924
            close """
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1925
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1926
        foo10 = """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1927
            open [email protected],5.11-0
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1928
            close """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1929
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1930
        foo11 = """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1931
            open [email protected],5.11-0
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1932
            close """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1933
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1934
        anotherfoo11 = """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1935
            open another/[email protected],5.11-0
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1936
            close """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1937
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1938
        depender10 = """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1939
            open [email protected],5.11-0
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1940
            add depend type=require [email protected]
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1941
            close """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1942
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1943
        depender11 = """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1944
            open [email protected],5.11-0
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1945
            add depend type=require [email protected]
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1946
            close """
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1947
633
12f974919ab3 4204 Traceback when attempting to uninstall a package that I have multiples of
Brock Pytlik <bpytlik@sun.com>
parents: 596
diff changeset
  1948
        def test_bug_4204(self):
922
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1949
                """Don't stack trace when printing a PlanCreationException with
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1950
                "multiple_matches" populated (on uninstall)."""
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1951
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1952
                self.pkgsend_bulk(self.rurl, (self.afoo10, self.bfoo10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1953
                    self.bar10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1954
                self.image_create(self.rurl)
633
12f974919ab3 4204 Traceback when attempting to uninstall a package that I have multiples of
Brock Pytlik <bpytlik@sun.com>
parents: 596
diff changeset
  1955
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  1956
                self.pkg("install foo", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  1957
                self.pkg("install a/foo b/foo", exit=0)
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  1958
                self.pkg("list")
633
12f974919ab3 4204 Traceback when attempting to uninstall a package that I have multiples of
Brock Pytlik <bpytlik@sun.com>
parents: 596
diff changeset
  1959
                self.pkg("uninstall foo", exit=1)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  1960
                self.pkg("uninstall a/foo b/foo", exit=0)
633
12f974919ab3 4204 Traceback when attempting to uninstall a package that I have multiples of
Brock Pytlik <bpytlik@sun.com>
parents: 596
diff changeset
  1961
922
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1962
        def test_bug_6874(self):
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1963
                """Don't stack trace when printing a PlanCreationException with
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  1964
                "multiple_matches" populated (on install and update)."""
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1965
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1966
                self.pkgsend_bulk(self.rurl, (self.afoo10, self.bfoo10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1967
                self.image_create(self.rurl)
922
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1968
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1969
                self.pkg("install foo", exit=1)
0074b10d84e0 6874 stack trace on install with ambiguous package names
Danek Duvall <danek.duvall@sun.com>
parents: 834
diff changeset
  1970
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1971
        def test_ambiguous_pattern_install(self):
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  1972
                """An update should never get confused about an existing
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1973
                package being part of an ambiguous set of package names."""
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1974
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1975
                self.pkgsend_bulk(self.rurl, self.foo10)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1976
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1977
                self.image_create(self.rurl)
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1978
                self.pkg("install foo")
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1979
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1980
                self.pkgsend_bulk(self.rurl, self.anotherfoo11)
996
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 988
diff changeset
  1981
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  1982
                self.pkg("update -v", exit=4)
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1983
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1984
        def test_ambiguous_pattern_depend(self):
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1985
                """A dependency on a package should pull in an exact name
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1986
                match."""
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1987
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1988
                self.ambiguous_pattern_depend_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1989
                self.ambiguous_pattern_depend_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1990
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1991
        def ambiguous_pattern_depend_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1992
                self.pkgsend_bulk(self.rurl, (self.depender10, self.foo10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1993
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1994
                self.image_create(self.rurl)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  1995
                self.pkg("%s depender" % install_cmd)
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  1996
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1997
                self.pkgsend_bulk(self.rurl, (self.foo11, self.anotherfoo11,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  1998
                    self.depender11))
996
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 988
diff changeset
  1999
                self.pkg("refresh")
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2000
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2001
                self.pkg("%s depender" % install_cmd)
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2002
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2003
                # Make sure that we didn't get other/foo from the dependency.
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2004
                self.pkg("list another/foo", exit=1)
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2005
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2006
        def test_non_ambiguous_fragment(self):
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2007
                """We should be able to refer to a package by its "basename", if
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2008
                that component is unique."""
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2009
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2010
                self.non_ambiguous_fragment_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2011
                self.non_ambiguous_fragment_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2012
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2013
        def non_ambiguous_fragment_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2014
                self.pkgsend_bulk(self.rurl, self.anotherfoo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2015
                self.image_create(self.rurl)
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2016
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2017
                # Right now, this is not exact, but still unambiguous
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2018
                self.pkg("%s foo" % install_cmd)
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2019
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2020
                # Create ambiguity
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2021
                self.pkgsend_bulk(self.rurl, self.foo11)
996
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 988
diff changeset
  2022
                self.pkg("refresh")
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2023
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2024
                # This is unambiguous, should succeed
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2025
                self.pkg("%s pkg:/foo" % install_cmd)
931
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2026
2c497b23356a 7200 package name matching too loose on upgrade
Danek Duvall <danek.duvall@sun.com>
parents: 926
diff changeset
  2027
                # This is now ambiguous, should fail
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2028
                self.pkg("%s foo" % install_cmd, exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2029
                self.pkgrepo("remove -s %s pkg:/[email protected]" % self.rurl )
594
b072bc027c54 3770 pkg install when authority unavailable traces back
Brock Pytlik <bpytlik@sun.com>
parents: 590
diff changeset
  2030
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2031
2681
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2032
class TestPkgInstallOverlappingPatterns(pkg5unittest.SingleDepotTestCase):
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2033
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2034
        a_1 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2035
            open [email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2036
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2037
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2038
        pub2_a_1 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2039
            open pkg://pub2/[email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2040
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2041
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2042
        a_11 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2043
            open [email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2044
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2045
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2046
        a_2 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2047
            open [email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2048
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2049
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2050
        pub2_a_2 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2051
            open pkg://pub2/[email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2052
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2053
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2054
        a_3 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2055
            open [email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2056
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2057
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2058
        aa_1 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2059
            open [email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2060
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2061
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2062
        afoo_1 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2063
            open a/[email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2064
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2065
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2066
        bfoo_1 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2067
            open b/[email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2068
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2069
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2070
        fooa_1 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2071
            open foo/[email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2072
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2073
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2074
        foob_1 = """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2075
            open foo/[email protected],5.11-0
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2076
            close """
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2077
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2078
        def test_overlapping_one_package_available(self):
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2079
                self.pkgsend_bulk(self.rurl, self.a_1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2080
                api_inst = self.image_create(self.rurl)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2081
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2082
                self._api_install(api_inst, ["a@1", "a@1"], noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2083
                self._api_install(api_inst, ["a@1", "[email protected]"], noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2084
                self._api_install(api_inst, ["a@1", "pkg://test/a@1"],
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2085
                    noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2086
                self._api_install(api_inst, ["a*@1", "pkg:/*a@1"],
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2087
                    noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2088
                self._api_install(api_inst, ["a*@1", "a@1"], noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2089
                self._api_install(api_inst, ["a@1", "pkg://test/a*@1"],
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2090
                    noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2091
                # This fails because a*@2 matches no patterns on its own.
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2092
                self.pkg("install -n 'a*@2' 'a@1'", exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2093
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2094
        def test_overlapping_conflicting_versions_no_wildcard_match(self):
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2095
                self.pkgsend_bulk(self.rurl, self.a_1 + self.a_2)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2096
                api_inst = self.image_create(self.rurl)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2097
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2098
                self.pkg("install -n a@1 a@2", exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2099
                self.pkg("install -n a@2 pkg://test/a@1", exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2100
                self.pkg("install -n 'a*@2' 'pkg:/*a@1'", exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2101
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2102
                # This is allowed because a*@1 matches published packages, even
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2103
                # though the packages it matches aren't installed in the image.
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2104
                self._api_install(api_inst, ["a*@1", "a@2"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2105
                self.pkg("list a@2")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2106
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2107
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2108
                self._api_install(api_inst, ["a@1", "pkg://test/a*@2"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2109
                self.pkg("list a@1")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2110
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2111
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2112
                self.pkgsend_bulk(self.rurl, self.a_3)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2113
                self._api_install(api_inst, ["a*@1", "*a@2", "a@3"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2114
                self.pkg("list a@3")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2115
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2116
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2117
                self._api_install(api_inst, ["a*@1", "*a@2", "a@latest"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2118
                self.pkg("list a@3")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2119
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2120
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2121
                self.pkgsend_bulk(self.rurl, self.a_11)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2122
                self.pkg("install [email protected] [email protected]", exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2123
                self._api_install(api_inst, ["a@1", "[email protected]", "a*@1.1"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2124
                self.pkg("list [email protected]")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2125
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2126
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2127
                self._api_install(api_inst, ["*", "[email protected]"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2128
                self.pkg("list [email protected]")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2129
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2130
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2131
        def test_overlapping_multiple_packages(self):
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2132
                self.pkgsend_bulk(self.rurl, self.a_1 + self.a_2 + self.aa_1 +
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2133
                    self.afoo_1 + self.bfoo_1 + self.fooa_1 + self.foob_1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2134
                api_inst = self.image_create(self.rurl)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2135
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2136
                self.pkg("install '*a@1' 'a*@2'", exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2137
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2138
                self._api_install(api_inst, ["a*@1", "a@2"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2139
                self.pkg("list -Hv")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2140
                self.assertEqual(len(self.output.splitlines()), 3)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2141
                self.assert_("a@2" in self.output)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2142
                self._api_uninstall(api_inst, ["a", "aa", "a/foo"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2143
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2144
                self._api_install(api_inst, ["/a@1", "a*@2", "*foo*@1"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2145
                self.pkg("list -Hv")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2146
                self.assertEqual(len(self.output.splitlines()), 5)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2147
                self.assert_("a@1" in self.output)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2148
                self._api_uninstall(api_inst,
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2149
                    ["/a", "a/foo", "b/foo", "foo/a", "foo/b"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2150
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2151
        def test_overlapping_multiple_publishers(self):
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2152
                self.pkgsend_bulk(self.rurl, self.a_1 + self.pub2_a_2)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2153
                api_inst = self.image_create(self.rurl)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2154
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2155
                self._api_install(api_inst, ["a*@1", "pkg://pub2/a@2"],
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2156
                    noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2157
                self._api_install(api_inst, ["a@1", "pkg://pub2/a*@2"],
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2158
                    noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2159
                self._api_install(api_inst, ["a@1", "pkg://pub2/*@2"],
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2160
                    noexecute=True)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2161
                self.pkg("install -n 'pkg://test/a*@1' 'pkg://pub2/*a@2'",
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2162
                    exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2163
                self.pkg("install -n 'pkg://test/a@1' 'pkg://pub2/a@2'",
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2164
                    exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2165
                self.pkg("install -n 'a@1' 'pkg://pub2/a@2'", exit=1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2166
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2167
                self.pkgsend_bulk(self.rurl, self.pub2_a_1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2168
                self._api_install(api_inst, ["a@1", "pkg://pub2/a@1"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2169
                self.pkg("list -Hv 'pkg://pub2/*'")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2170
                self.assertEqual(len(self.output.splitlines()), 1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2171
                self.assert_("a@1" in self.output)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2172
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2173
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2174
                self._api_install(api_inst, ["a@1", "pkg://test/a@1"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2175
                self.pkg("list -Hv 'pkg://test/*'")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2176
                self.assertEqual(len(self.output.splitlines()), 1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2177
                self.assert_("a@1" in self.output)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2178
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2179
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2180
                self._api_install(api_inst, ["a*@1", "pkg://pub2/*@2"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2181
                self.pkg("list -Hv 'pkg://pub2/*'")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2182
                self.assertEqual(len(self.output.splitlines()), 1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2183
                self.assert_("a@2" in self.output)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2184
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2185
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2186
                self._api_install(api_inst,
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2187
                    ["pkg://test/a@1", "pkg://pub2/*@2"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2188
                self.pkg("list -Hv 'pkg://test/*'")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2189
                self.assertEqual(len(self.output.splitlines()), 1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2190
                self.assert_("a@1" in self.output)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2191
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2192
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2193
                # This intentionally doesn't use api_install to check for
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2194
                # special handling of '*' in client.py.
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2195
                self.pkg("install '*' 'pkg://pub2/*@2'")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2196
                self.pkg("list -Hv 'pkg://pub2/*'")
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2197
                self.assertEqual(len(self.output.splitlines()), 1)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2198
                self.assert_("a@2" in self.output)
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2199
                self._api_uninstall(api_inst, ["a"])
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2200
29aba686b970 7140060 install and update should allow multiple pattern matches when they intersect
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2654
diff changeset
  2201
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2202
class TestPkgInstallCircularDependencies(pkg5unittest.SingleDepotTestCase):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2203
        # Only start/stop the depot once (instead of for every test)
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2204
        persistent_setup = True
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2205
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2206
        pkg10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2207
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2208
            add depend type=require fmri=pkg:/pkg2
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2209
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2210
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2211
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2212
        pkg20 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2213
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2214
            add depend type=require fmri=pkg:/pkg3
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2215
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2216
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2217
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2218
        pkg30 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2219
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2220
            add depend type=require fmri=pkg:/pkg1
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2221
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2222
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2223
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2224
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2225
        pkg11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2226
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2227
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2228
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2229
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2230
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2231
        pkg21 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2232
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2233
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2234
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2235
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2236
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2237
        pkg31 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2238
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2239
            add depend type=require fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2240
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2241
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2242
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2243
        def test_unanchored_circular_dependencies(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2244
                """ check to make sure we can install or exact-install
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2245
                circular dependencies w/o versions
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2246
                """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2247
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2248
                self.unanchored_circular_dependencies_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2249
                self.unanchored_circular_dependencies_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2250
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2251
        def unanchored_circular_dependencies_helper(self, install_cmd):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2252
                # Send 1.0 versions of packages.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2253
                self.pkgsend_bulk(self.rurl, (self.pkg10, self.pkg20,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2254
                    self.pkg30))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2255
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2256
                self.image_create(self.rurl)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2257
                self.pkg("%s pkg1" % install_cmd)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2258
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2259
                self.pkg("verify -v")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2260
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2261
        def test_anchored_circular_dependencies(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2262
                """ check to make sure we can install or exact-install
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2263
                circular dependencies w/ versions
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2264
                """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2265
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2266
                self.anchored_circular_dependencies_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2267
                self.unanchored_circular_dependencies_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2268
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2269
        def anchored_circular_dependencies_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2270
                # Send 1.1 versions of packages.
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2271
                self.pkgsend_bulk(self.rurl, (self.pkg11, self.pkg21,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2272
                    self.pkg31))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2273
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2274
                self.image_create(self.rurl)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  2275
                self.pkg("%s pkg1" % install_cmd)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2276
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2277
                self.pkg("verify -v")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2278
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  2279
3221
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2280
class TestPkgInstallUpdateSolverOutput(pkg5unittest.SingleDepotTestCase):
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2281
        # Only start/stop the depot once (instead of for every test)
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2282
        persistent_setup = True
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2283
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2284
        octo10 = """
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2285
            open [email protected],5.11-0
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2286
            close
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2287
        """
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2288
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2289
        octo20 = """
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2290
            open [email protected],5.11-0
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2291
            close
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2292
        """
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2293
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2294
        incorp = """
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2295
            open [email protected],5.11-0
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2296
            add depend type=incorporate fmri=pkg:/[email protected]
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2297
            close
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2298
        """
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2299
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2300
        def test_output_two_issues(self):
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2301
                """ ^^^ hard to find a good name for this, it tests for bug
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2302
                21130996.
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2303
                In case one pkg triggers two or more issues, one of which is not
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2304
                considered print-worthy, we wouldn't print anything at all."""
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2305
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2306
                self.pkgsend_bulk(self.rurl,
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2307
                    (self.incorp, self.octo10, self.octo20))
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2308
                self.image_create(self.rurl)
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2309
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2310
                self.pkg("install incorp octo@2")
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2311
                self.pkg("install -v octo@1", exit=1)
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2312
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2313
                # Check that the root cause for the issue is shown;
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2314
                # the incorporation does not allow the older version.
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2315
                self.assertTrue("[email protected]" in self.errout,
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2316
                    "Excluding incorporation not shown in solver error.")
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2317
                # Check that the notice about a newer version already installed
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2318
                # is ommited (it's not relevant).
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2319
                self.assertFalse("[email protected]" in self.errout,
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2320
                    "Newer version should not be shown in solver error.")
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2321
246cd21a6196 21130996 pkg solver doesn't print error if pkg has two issues and one is not print-worthy
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 3188
diff changeset
  2322
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  2323
class TestPkgInstallUpgrade(_TestHelper, pkg5unittest.SingleDepotTestCase):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2324
        # Only start/stop the depot once (instead of for every test)
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2325
        persistent_setup = True
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  2326
        need_ro_data = True
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2327
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2328
        incorp10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2329
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2330
            add depend type=incorporate fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2331
            add depend type=incorporate fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2332
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2333
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2334
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2335
        incorp20 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2336
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2337
            add depend type=incorporate fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2338
            add depend type=incorporate fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2339
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2340
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2341
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2342
        incorp30 = """
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2343
            open [email protected],5.11-0
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2344
            add depend type=incorporate fmri=pkg:/[email protected]
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2345
            close
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2346
        """
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2347
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2348
        incorpA = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2349
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2350
            add depend type=incorporate fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2351
            add depend type=incorporate fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2352
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2353
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2354
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2355
        incorpB =  """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2356
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2357
            add depend type=incorporate fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2358
            add depend type=incorporate fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2359
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2360
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2361
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2362
        iridium10 = """
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2363
            open [email protected],5.11-0
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2364
            add depend fmri=pkg:/[email protected] type=require
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2365
            close
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2366
        """
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2367
        amber10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2368
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2369
            add dir mode=0755 owner=root group=bin path=/lib
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2370
            add dir mode=0755 owner=root group=bin path=/etc
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2371
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2372
            add link path=/lib/libc.symlink target=/lib/libc.so.1
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2373
            add hardlink path=/lib/libc.hardlink target=/lib/libc.so.1
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2374
            add file tmp/amber1 mode=0444 owner=root group=bin path=/etc/amber1
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2375
            add file tmp/amber2 mode=0444 owner=root group=bin path=/etc/amber2
3188
48b2c6a36bb6 18876698 Plan serialization for linked images does not support unicode in license actions
Danek Duvall <danek.duvall@oracle.com>
parents: 3172
diff changeset
  2376
            add license tmp/copyright1 license=copyright_ä
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2377
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2378
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2379
676
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  2380
        brass10 = """
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  2381
            open [email protected],5.11-0
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  2382
            add depend fmri=pkg:/bronze type=require
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  2383
            close
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  2384
        """
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  2385
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2386
        bronze10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2387
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2388
            add dir mode=0755 owner=root group=bin path=/usr
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2389
            add dir mode=0755 owner=root group=bin path=/usr/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2390
            add file tmp/sh mode=0555 owner=root group=bin path=/usr/bin/sh
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2391
            add link path=/usr/bin/jsh target=./sh
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2392
            add hardlink path=/lib/libc.bronze target=/lib/libc.so.1
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2393
            add file tmp/bronze1 mode=0444 owner=root group=bin path=/etc/bronze1
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2394
            add file tmp/bronze2 mode=0444 owner=root group=bin path=/etc/bronze2
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2395
            add file tmp/bronzeA1 mode=0444 owner=root group=bin path=/A/B/C/D/E/F/bronzeA1
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2396
            add depend fmri=pkg:/[email protected] type=require
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2397
            add license tmp/copyright2 license=copyright
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2398
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2399
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2400
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2401
        amber20 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2402
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2403
            add dir mode=0755 owner=root group=bin path=/usr
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2404
            add dir mode=0755 owner=root group=bin path=/usr/bin
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2405
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2406
            add link path=/lib/libc.symlink target=/lib/libc.so.1
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2407
            add hardlink path=/lib/libc.amber target=/lib/libc.bronze
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2408
            add hardlink path=/lib/libc.hardlink target=/lib/libc.so.1
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2409
            add file tmp/amber1 mode=0444 owner=root group=bin path=/etc/amber1
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2410
            add file tmp/amber2 mode=0444 owner=root group=bin path=/etc/bronze2
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2411
            add depend fmri=pkg:/[email protected] type=require
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2412
            add license tmp/copyright2 license=copyright
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2413
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2414
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2415
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2416
        bronze20 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2417
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2418
            add dir mode=0755 owner=root group=bin path=/etc
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2419
            add dir mode=0755 owner=root group=bin path=/lib
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2420
            add file tmp/sh mode=0555 owner=root group=bin path=/usr/bin/sh
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2421
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.bronze
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2422
            add link path=/usr/bin/jsh target=./sh
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2423
            add hardlink path=/lib/libc.bronze2.0.hardlink target=/lib/libc.so.1
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2424
            add file tmp/bronze1 mode=0444 owner=root group=bin path=/etc/bronze1
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2425
            add file tmp/bronze2 mode=0444 owner=root group=bin path=/etc/amber2
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2426
            add license tmp/copyright3 license=copyright
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2427
            add file tmp/bronzeA2 mode=0444 owner=root group=bin path=/A1/B2/C3/D4/E5/F6/bronzeA2
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2428
            add depend fmri=pkg:/[email protected] type=require
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  2429
            close
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2430
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2431
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2432
        bronze30 = """
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2433
            open [email protected],5.11-0
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2434
            add dir mode=0755 owner=root group=bin path=/etc
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2435
            add dir mode=0755 owner=root group=bin path=/lib
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2436
            add file tmp/sh mode=0555 owner=root group=bin path=/usr/bin/sh
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2437
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.bronze
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2438
            add link path=/usr/bin/jsh target=./sh
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2439
            add hardlink path=/lib/libc.bronze2.0.hardlink target=/lib/libc.so.1
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2440
            add file tmp/bronze1 mode=0444 owner=root group=bin path=/etc/bronze1
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2441
            add file tmp/bronze2 mode=0444 owner=root group=bin path=/etc/amber2
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2442
            add license tmp/copyright3 license=copyright
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2443
            add file tmp/bronzeA2 mode=0444 owner=root group=bin path=/A1/B2/C3/D4/E5/F6/bronzeA2
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2444
            add depend fmri=pkg:/[email protected] type=require
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  2445
            close
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2446
        """
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2447
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2448
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2449
        gold10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2450
            open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2451
            add file tmp/gold-passwd1 mode=0644 owner=root group=bin path=etc/passwd preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2452
            add file tmp/gold-group mode=0644 owner=root group=bin path=etc/group preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2453
            add file tmp/gold-shadow mode=0600 owner=root group=bin path=etc/shadow preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2454
            add file tmp/gold-ftpusers mode=0644 owner=root group=bin path=etc/ftpd/ftpusers preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2455
            add file tmp/gold-silly mode=0644 owner=root group=bin path=etc/silly
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2456
            add file tmp/gold-silly mode=0644 owner=root group=bin path=etc/silly2
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2457
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2458
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2459
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2460
        gold20 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2461
            open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2462
            add file tmp/config2 mode=0644 owner=root group=bin path=etc/config2 original_name="gold:etc/passwd" preserve=true
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2463
            close
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2464
        """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2465
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2466
        gold30 = """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2467
            open [email protected],5.11-0
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2468
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2469
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2470
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2471
        golduser10 = """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2472
            open [email protected]
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2473
            add user username=Kermit group=adm home-dir=/export/home/Kermit
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2474
            close
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2475
        """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2476
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2477
        golduser20 = """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2478
            open [email protected]
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2479
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2480
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2481
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2482
        silver10  = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2483
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2484
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2485
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2486
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2487
        silver20  = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2488
            open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2489
            add file tmp/gold-passwd2 mode=0644 owner=root group=bin path=etc/passwd original_name="gold:etc/passwd" preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2490
            add file tmp/gold-group mode=0644 owner=root group=bin path=etc/group original_name="gold:etc/group" preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2491
            add file tmp/gold-shadow mode=0600 owner=root group=bin path=etc/shadow original_name="gold:etc/shadow" preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2492
            add file tmp/gold-ftpusers mode=0644 owner=root group=bin path=etc/ftpd/ftpusers original_name="gold:etc/ftpd/ftpusers" preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2493
            add file tmp/gold-silly mode=0644 owner=root group=bin path=etc/silly
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2494
            add file tmp/silver-silly mode=0644 owner=root group=bin path=etc/silly2
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2495
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2496
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2497
        silver30  = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2498
            open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2499
            add file tmp/config2 mode=0644 owner=root group=bin path=etc/config2 original_name="gold:etc/passwd" preserve=true
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2500
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2501
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2502
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2503
        silveruser = """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2504
            open [email protected]
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  2505
            add user username=Kermit group=adm home-dir=/export/home/Kermit
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2506
            close
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2507
        """
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2508
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2509
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2510
        iron10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2511
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2512
            add dir mode=0755 owner=root group=bin path=etc
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2513
            add file tmp/config1 mode=0644 owner=root group=bin path=etc/foo
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2514
            add hardlink path=etc/foo.link target=foo
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  2515
            add license tmp/copyright1 license=copyright
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2516
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2517
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2518
        iron20 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2519
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2520
            add dir mode=0755 owner=root group=bin path=etc
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2521
            add file tmp/config2 mode=0644 owner=root group=bin path=etc/foo
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2522
            add hardlink path=etc/foo.link target=foo
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  2523
            add license tmp/copyright2 license=copyright
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2524
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2525
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2526
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2527
        concorp10 = """
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2528
            open [email protected],5.11-0
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2529
            add depend type=incorporate fmri=pkg:/[email protected]
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2530
            add depend type=incorporate fmri=pkg:/[email protected]
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2531
            close
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2532
        """
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2533
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2534
        dricon1 = """
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2535
            open dricon@1
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2536
            add dir path=var mode=755 owner=root group=root
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2537
            add dir path=var/run mode=755 owner=root group=root
2200
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  2538
            add dir mode=0755 owner=root group=root path=system
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  2539
            add dir mode=0755 owner=root group=root path=system/volatile
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2540
            add dir path=/tmp mode=755 owner=root group=root
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2541
            add dir path=/etc mode=755 owner=root group=root
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2542
            add file tmp/dricon_da path=/etc/driver_aliases mode=644 owner=root group=sys preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2543
            add file tmp/dricon_n2m path=/etc/name_to_major mode=644 owner=root group=sys preserve=true
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2544
            close
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2545
        """
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2546
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2547
        dricon2 = """
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2548
            open dricon@2
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2549
            add dir path=var mode=755 owner=root group=root
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2550
            add dir path=var/run mode=755 owner=root group=root
2200
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  2551
            add dir mode=0755 owner=root group=root path=system
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  2552
            add dir mode=0755 owner=root group=root path=system/volatile
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2553
            add dir path=/tmp mode=755 owner=root group=root
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2554
            add dir path=/etc mode=755 owner=root group=root
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2555
            add file tmp/dricon2_da path=/etc/driver_aliases mode=644 owner=root group=sys preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2556
            add file tmp/dricon_n2m path=/etc/name_to_major mode=644 owner=root group=sys preserve=true
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2557
            add driver name=zigit alias=pci8086,1234
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2558
            close
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2559
        """
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2560
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2561
        dricon3 = """
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2562
            open dricon@3
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2563
            add dir path=var mode=755 owner=root group=root
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2564
            add dir path=var/run mode=755 owner=root group=root
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2565
            add dir path=/tmp mode=755 owner=root group=root
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2566
            add dir path=/etc mode=755 owner=root group=root
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2567
            add file tmp/dricon2_da path=/etc/driver_aliases mode=644 owner=root group=sys preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2568
            add file tmp/dricon_n2m path=/etc/name_to_major mode=644 owner=root group=sys preserve=true
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2569
            add driver name=zigit alias=pci8086,1234
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2570
            add driver name=figit alias=pci8086,1234
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2571
            close
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2572
        """
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2573
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2574
        dripol1 = """
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2575
            open dripol@1
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2576
            add dir path=var mode=755 owner=root group=root
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2577
            add dir path=var/run mode=755 owner=root group=root
2200
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  2578
            add dir mode=0755 owner=root group=root path=system
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  2579
            add dir mode=0755 owner=root group=root path=system/volatile
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2580
            add dir path=/tmp mode=755 owner=root group=root
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2581
            add dir path=/etc mode=755 owner=root group=root
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2582
            add dir path=/etc/security mode=755 owner=root group=root
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2583
            add file tmp/dricon2_da path=/etc/driver_aliases mode=644 owner=root group=sys preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2584
            add file tmp/dricon_n2m path=/etc/name_to_major mode=644 owner=root group=sys preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2585
            add file tmp/dripol1_dp path=/etc/security/device_policy mode=644 owner=root group=sys preserve=true
3432
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2586
            add driver name=frigit policy="read_priv_set=net_rawaccess write_priv_set=net_rawaccess tpd_member=true"
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2587
            close
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2588
        """
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2589
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2590
        dripol2 = """
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2591
            open dripol@2
1903
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2592
            add dir path=var mode=755 owner=root group=root
460ef45c8ebd 15939 Need a easy way to format package manifests in a consistent style
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 1902
diff changeset
  2593
            add dir path=var/run mode=755 owner=root group=root
2200
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  2594
            add dir mode=0755 owner=root group=root path=system
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  2595
            add dir mode=0755 owner=root group=root path=system/volatile
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2596
            add dir path=/tmp mode=755 owner=root group=root
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2597
            add dir path=/etc mode=755 owner=root group=root
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2598
            add dir path=/etc/security mode=755 owner=root group=root
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2599
            add file tmp/dricon2_da path=/etc/driver_aliases mode=644 owner=root group=sys preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2600
            add file tmp/dricon_n2m path=/etc/name_to_major mode=644 owner=root group=sys preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2601
            add file tmp/dripol1_dp path=/etc/security/device_policy mode=644 owner=root group=sys preserve=true
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2602
            add driver name=frigit
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2603
            close
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2604
        """
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2605
3432
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2606
        dripol3 = """
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2607
            open dripol@3
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2608
            add dir path=var mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2609
            add dir path=var/run mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2610
            add dir mode=0755 owner=root group=root path=system
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2611
            add dir mode=0755 owner=root group=root path=system/volatile
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2612
            add dir path=/tmp mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2613
            add dir path=/etc mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2614
            add dir path=/etc/security mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2615
            add file tmp/dricon2_da path=/etc/driver_aliases mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2616
            add file tmp/dricon_n2m path=/etc/name_to_major mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2617
            add file tmp/dripol1_dp path=/etc/security/device_policy mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2618
            add driver name=frigit policy="tpd_member=true"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2619
            close
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2620
        """
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2621
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2622
        dripol4 = """
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2623
            open dripol@4
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2624
            add dir path=var mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2625
            add dir path=var/run mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2626
            add dir mode=0755 owner=root group=root path=system
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2627
            add dir mode=0755 owner=root group=root path=system/volatile
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2628
            add dir path=/tmp mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2629
            add dir path=/etc mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2630
            add dir path=/etc/security mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2631
            add file tmp/dricon2_da path=/etc/driver_aliases mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2632
            add file tmp/dricon_n2m path=/etc/name_to_major mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2633
            add file tmp/dripol1_dp path=/etc/security/device_policy mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2634
            add driver name=frigit
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2635
            close
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2636
        """
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2637
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2638
        dripol5 = """
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2639
            open dripol@5
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2640
            add dir path=var mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2641
            add dir path=var/run mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2642
            add dir mode=0755 owner=root group=root path=system
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2643
            add dir mode=0755 owner=root group=root path=system/volatile
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2644
            add dir path=/tmp mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2645
            add dir path=/etc mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2646
            add dir path=/etc/security mode=755 owner=root group=root
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2647
            add file tmp/dricon2_da path=/etc/driver_aliases mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2648
            add file tmp/dricon_n2m path=/etc/name_to_major mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2649
            add file tmp/dripol1_dp path=/etc/security/device_policy mode=644 owner=root group=sys preserve=true
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2650
            add driver name=frigit perms="node1 0666 root sys" policy="node1 read_priv_set=all write_priv_set=all tpd_member=true"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2651
            close
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2652
        """
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  2653
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
  2654
        liveroot10 = """
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  2655
            open [email protected]
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  2656
            add dir path=/etc mode=755 owner=root group=root
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2657
            add file tmp/liveroot1 path=/etc/liveroot mode=644 owner=root group=sys reboot-needed=true
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  2658
            close
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  2659
        """
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
  2660
        liveroot20 = """
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  2661
            open [email protected]
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  2662
            add dir path=/etc mode=755 owner=root group=root
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2663
            add file tmp/liveroot2 path=/etc/liveroot mode=644 owner=root group=sys reboot-needed=true
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  2664
            close
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  2665
        """
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2666
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2667
        renameold1 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2668
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2669
            add file tmp/renold1 path=testme mode=0644 owner=root group=root preserve=renameold
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2670
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2671
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2672
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2673
        renameold2 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2674
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2675
            add file tmp/renold1 path=testme mode=0640 owner=root group=root preserve=renameold
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2676
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2677
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2678
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2679
        renameold3 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2680
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2681
            add file tmp/renold3 path=testme mode=0644 owner=root group=root preserve=renameold
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2682
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2683
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2684
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2685
        renamenew1 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2686
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2687
            add file tmp/rennew1 path=testme mode=0644 owner=root group=root preserve=renamenew
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2688
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2689
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2690
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2691
        renamenew2 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2692
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2693
            add file tmp/rennew1 path=testme mode=0640 owner=root group=root preserve=renamenew
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2694
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2695
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2696
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2697
        renamenew3 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2698
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2699
            add file tmp/rennew3 path=testme mode=0644 owner=root group=root preserve=renamenew
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2700
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2701
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2702
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2703
        preserve1 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2704
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2705
            add file tmp/preserve1 path=testme mode=0644 owner=root group=root preserve=true
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2706
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2707
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2708
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2709
        preserve2 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2710
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2711
            add file tmp/preserve1 path=testme mode=0640 owner=root group=root preserve=true
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2712
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2713
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2714
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2715
        preserve3 = """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2716
            open [email protected]
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2717
            add file tmp/preserve3 path=testme mode=0644 owner=root group=root preserve=true
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2718
            close
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2719
        """
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  2720
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2721
        preslegacy = """
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2722
            open [email protected]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2723
            add file tmp/preserve1 path=testme mode=0644 owner=root group=root preserve=true
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2724
            close
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2725
            open [email protected]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2726
            add file tmp/preserve2 path=testme mode=0444 owner=root group=root preserve=legacy
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2727
            close
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2728
            open [email protected]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2729
            add file tmp/preserve3 path=testme mode=0444 owner=root group=root preserve=legacy
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2730
            close
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2731
        """
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2732
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2733
        renpreslegacy = """
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2734
            open [email protected]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2735
            add file tmp/preserve1 path=testme mode=0644 owner=root group=root preserve=true
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2736
            close
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2737
            open [email protected]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2738
            add set pkg.renamed=true
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2739
            add depend type=require [email protected]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2740
            close
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2741
            open [email protected]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2742
            add file tmp/preserve2 path=newme mode=0444 owner=root group=root preserve=legacy original_name=orig_preslegacy:testme
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2743
            close
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2744
        """
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2745
3429
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2746
        presabandon = """
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2747
            open [email protected]
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2748
            add file tmp/preserve1 path=testme mode=0444 owner=root group=root preserve=true
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2749
            close
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2750
            open [email protected]
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2751
            add file tmp/preserve1 path=testme mode=0644  owner=root group=root preserve=abandon
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2752
            close
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2753
            open [email protected]
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2754
            add file tmp/preserve3 path=testme mode=0444  owner=root group=root preserve=abandon
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2755
            close
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2756
            open [email protected]
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2757
            add file tmp/preserve3 path=testme mode=0644  owner=root group=root preserve=true
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2758
            close
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2759
        """
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  2760
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2761
        renpreserve = """
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2762
            open [email protected]
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2763
            add file tmp/preserve1 path=foo1 mode=0644 owner=root group=root preserve=true
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2764
            add file tmp/bronze1 path=bronze1 mode=0644 owner=root group=root preserve=true
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2765
            close
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2766
            open [email protected]
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2767
            add set pkg.renamed=true
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2768
            add depend type=require [email protected]
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2769
            close
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2770
            open [email protected]
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  2771
            add file tmp/foo2 path=foo2 mode=0644 owner=root group=root original_name=orig_pkg:foo1 preserve=true
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2772
            add file tmp/bronze1 path=bronze1 mode=0644 owner=root group=root preserve=true
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2773
            close
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2774
        """
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  2775
2869
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2776
        linkpreserve = """
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2777
            open [email protected]
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2778
            add file tmp/preserve1 path=etc/ssh/sshd_config mode=0644 owner=root group=root preserve=true
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2779
            close
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2780
            open [email protected]
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2781
            add file tmp/preserve2 path=etc/sunssh/sshd_config mode=0644 owner=root group=root preserve=true original_name=linkpreserve:etc/ssh/sshd_config
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2782
            add link path=etc/ssh/sshd_config target=../sunssh/sshd_config
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2783
            close """
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  2784
2470
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2785
        salvage = """
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2786
            open [email protected]
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2787
            add dir path=var mode=755 owner=root group=root
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2788
            add dir path=var/mail mode=755 owner=root group=root
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2789
            add dir path=var/log mode=755 owner=root group=root
2818
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2790
            add dir path=var/noodles mode=755 owner=root group=root
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2791
            add dir path=var/persistent mode=755 owner=root group=root
2470
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2792
            close
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2793
            open [email protected]
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2794
            add dir path=var mode=755 owner=root group=root
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2795
            add dir path=var/.migrate-to-shared mode=755 owner=root group=root
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2796
            add dir path=var/.migrate-to-shared/mail salvage-from=var/mail mode=755 owner=root group=root
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2797
            add dir path=var/.migrate-to-shared/log salvage-from=var/log mode=755 owner=root group=root
2818
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2798
            add dir path=var/spaghetti mode=755 owner=root group=root
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2799
            add dir path=var/persistent mode=755 owner=root group=root salvage-from=var/noodles
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2800
            close
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2801
            open [email protected]
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2802
            add dir path=var mode=755 owner=root group=root
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2803
            add dir path=var/.migrate-to-shared mode=755 owner=root group=root
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2804
            add dir path=var/.migrate-to-shared/mail salvage-from=var/mail mode=755 owner=root group=root
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2805
            add dir path=var/.migrate-to-shared/log salvage-from=var/log mode=755 owner=root group=root
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  2806
            add dir path=var/persistent mode=755 owner=root group=root salvage-from=var/noodles salvage-from=var/spaghetti
2470
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2807
            close
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2808
        """
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  2809
2580
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  2810
        salvage_special = """
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  2811
            open [email protected]
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  2812
            add dir path=salvage mode=755 owner=root group=root
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  2813
            close
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  2814
        """
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  2815
3430
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2816
        dumdir10 = """
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2817
            open [email protected]
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2818
            add dir path=etc mode=0755 owner=root group=bin
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2819
            add file tmp/amber1 mode=0755 owner=root group=bin path=etc/amber1
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2820
            close
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2821
        """
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2822
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2823
        dumdir20 = """
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2824
            open [email protected]
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2825
            add dir path=etc mode=0700 owner=root group=bin
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2826
            add file tmp/amber1 mode=0444 owner=root group=bin path=etc/amber1
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2827
            close
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2828
        """
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  2829
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2830
        misc_files1 = [
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2831
            "tmp/amber1", "tmp/amber2", "tmp/bronzeA1",  "tmp/bronzeA2",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2832
            "tmp/bronze1", "tmp/bronze2",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2833
            "tmp/copyright1", "tmp/copyright2",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2834
            "tmp/copyright3", "tmp/copyright4",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2835
            "tmp/libc.so.1", "tmp/sh", "tmp/config1", "tmp/config2",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2836
            "tmp/gold-passwd1", "tmp/gold-passwd2", "tmp/gold-group",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2837
            "tmp/gold-shadow", "tmp/gold-ftpusers", "tmp/gold-silly",
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2838
            "tmp/silver-silly", "tmp/preserve1", "tmp/preserve2",
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2839
            "tmp/preserve3", "tmp/renold1", "tmp/renold3", "tmp/rennew1",
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  2840
            "tmp/rennew3", "tmp/liveroot1", "tmp/liveroot2", "tmp/foo2",
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2841
        ]
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2842
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2843
        misc_files2 = {
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2844
            "tmp/dricon_da": """\
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2845
wigit "pci8086,1234"
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2846
wigit "pci8086,4321"
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2847
# someother "pci8086,1234"
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2848
foobar "pci8086,9999"
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2849
""",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2850
            "tmp/dricon2_da": """\
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2851
zigit "pci8086,1234"
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2852
wigit "pci8086,4321"
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2853
# someother "pci8086,1234"
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2854
foobar "pci8086,9999"
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2855
""",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2856
            "tmp/dricon_n2m": """\
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2857
wigit 1
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2858
foobar 2
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  2859
""",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2860
            "tmp/dripol1_dp": """\
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  2861
*               read_priv_set=none              write_priv_set=none
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2862
""",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2863
            "tmp/gold-passwd1": """\
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2864
root:x:0:0::/root:/usr/bin/bash
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2865
daemon:x:1:1::/:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2866
bin:x:2:2::/usr/bin:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2867
sys:x:3:3::/:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2868
adm:x:4:4:Admin:/var/adm:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2869
""",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2870
            "tmp/gold-passwd2": """\
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2871
root:x:0:0::/root:/usr/bin/bash
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2872
daemon:x:1:1::/:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2873
bin:x:2:2::/usr/bin:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2874
sys:x:3:3::/:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2875
adm:x:4:4:Admin:/var/adm:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2876
bogus:x:10001:10001:Bogus User:/:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2877
""",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2878
            "tmp/gold-group": """\
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2879
root::0:
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2880
other::1:root
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2881
bin::2:root,daemon
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2882
sys::3:root,bin,adm
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2883
adm::4:root,daemon
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2884
""",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2885
            "tmp/gold-shadow": """\
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2886
root:9EIfTNBp9elws:13817::::::
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2887
daemon:NP:6445::::::
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2888
bin:NP:6445::::::
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2889
sys:NP:6445::::::
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2890
adm:NP:6445::::::
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2891
""",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2892
            "tmp/gold-ftpusers": """\
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2893
root
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2894
bin
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2895
sys
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2896
adm
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2897
""",
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  2898
        }
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2899
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2900
        cat_data = " "
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2901
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2902
        foo10 = """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2903
            open [email protected],5.11-0
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2904
            close """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2905
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2906
        only_attr10 = """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2907
            open [email protected],5.11-0
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2908
            add set name=foo value=bar
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2909
            close """
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  2910
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2911
        def setUp(self):
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2912
                pkg5unittest.SingleDepotTestCase.setUp(self)
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2913
                self.make_misc_files(self.misc_files1)
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  2914
                self.make_misc_files(self.misc_files2)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2915
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2916
        def __salvage_file_contains(self, sroot, fprefix, entry):
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2917
                salvaged = [
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2918
                    n for n in os.listdir(sroot)
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2919
                    if n.startswith(fprefix + "-")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2920
                ]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2921
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2922
                sfile = os.path.join(sroot, salvaged[0])
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2923
                with open(sfile, "rb") as f:
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2924
                        found = [l.strip() for l in f if entry in l]
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2925
                        self.assertEqual(found, [entry])
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  2926
1085
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2927
        def test_incorp_install(self):
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2928
                """Make sure we don't round up packages we specify on
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2929
                install"""
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2930
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2931
                first_bronze = self.pkgsend_bulk(self.rurl, self.bronze20)[0]
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2932
                self.pkgsend_bulk(self.rurl, (self.incorp20, self.amber10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2933
                    self.bronze10, self.amber20, self.bronze20))
1085
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2934
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  2935
                # create image
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2936
                self.image_create(self.rurl)
1085
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2937
                # install incorp2
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2938
                self.pkg("install [email protected]")
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2939
                # try to install version 1
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2940
                self.pkg("install [email protected]", exit=1)
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2941
                # install earliest version [email protected]
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2942
                self.pkg("install %s" % first_bronze)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2943
                self.pkg("list -v %s" % first_bronze)
1085
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2944
                self.pkg("install [email protected]")
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  2945
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2946
        def test_upgrade1(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2947
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2948
                """ Upgrade torture test.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2949
                    Send package [email protected], bronze1.0; install bronze1.0, which
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2950
                    should cause amber to also install.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2951
                    Send 2.0 versions of packages which contains a lot of
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2952
                    complex transactions between amber and bronze, then do
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  2953
                    an update, and try to check the results.
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2954
                """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2955
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2956
                # Send 1.0 versions of packages.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2957
                self.pkgsend_bulk(self.rurl, (self.incorp10, self.amber10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2958
                    self.bronze10))
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2959
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2960
                #
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2961
                # In version 2.0, several things happen:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2962
                #
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2963
                # Amber and Bronze swap a file with each other in both
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2964
                # directions.  The dependency flips over (Amber now depends
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2965
                # on Bronze).  Amber and Bronze swap ownership of various
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2966
                # directories.
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2967
                #
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2968
                # Bronze's 1.0 hardlink to amber's libc goes away and is
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2969
                # replaced with a file of the same name.  Amber hardlinks
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2970
                # to that.
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2971
                #
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2972
                self.pkgsend_bulk(self.rurl, (self.incorp20, self.amber20,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2973
                    self.bronze20))
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2974
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2975
                # create image and install version 1
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  2976
                self.image_create(self.rurl)
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2977
                self.pkg("install [email protected]")
2333
d7d310363aeb 18191 need flag to indicate some self-assembly is required
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2299
diff changeset
  2978
                self.file_exists(".SELF-ASSEMBLY-REQUIRED")
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2979
                self.pkg("install bronze")
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2980
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2981
                self.pkg("list [email protected] [email protected]")
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2982
                self.pkg("verify -v")
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2983
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2984
                # demonstrate that [email protected] prevents package movement
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2985
                self.pkg("install [email protected] [email protected]", exit=1)
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2986
2224
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
  2987
                # ...again, but using @latest.
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
  2988
                self.pkg("install bronze@latest amber@latest", exit=1)
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
  2989
                self.pkg("update bronze@latest amber@latest", exit=1)
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
  2990
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  2991
                # Now update to get new versions of amber and bronze
2333
d7d310363aeb 18191 need flag to indicate some self-assembly is required
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2299
diff changeset
  2992
                self.file_remove(".SELF-ASSEMBLY-REQUIRED")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  2993
                self.pkg("update")
2333
d7d310363aeb 18191 need flag to indicate some self-assembly is required
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2299
diff changeset
  2994
                self.file_exists(".SELF-ASSEMBLY-REQUIRED")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2995
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2996
                # Try to verify that it worked.
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  2997
                self.pkg("list [email protected] [email protected]")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2998
                self.pkg("verify -v")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  2999
                # make sure old implicit directories for bronzeA1 were removed
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3000
                self.assert_(not os.path.isdir(os.path.join(self.get_img_path(),
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3001
                    "A")))
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3002
                # Remove packages
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3003
                self.pkg("uninstall amber bronze")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3004
                self.pkg("verify -v")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3005
2092
0ef66bf272d3 16852 pkg should look at its image for certs if active image lacks certs
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2089
diff changeset
  3006
                # Make sure all directories are gone save /var in test image.
0ef66bf272d3 16852 pkg should look at its image for certs if active image lacks certs
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2089
diff changeset
  3007
                self.assertEqual(set(os.listdir(self.get_img_path())),
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  3008
                    set([".SELF-ASSEMBLY-REQUIRED", "var"]))
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3009
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3010
        def test_upgrade2(self):
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3011
                """ test incorporations:
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3012
                        1) install files that conflict w/ existing incorps
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3013
                        2) install package w/ dependencies that violate incorps
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3014
                        3) install incorp that violates existing incorp
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3015
                        4) install incorp that would force package backwards
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3016
                        """
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3017
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3018
                # Send all pkgs
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3019
                self.pkgsend_bulk(self.rurl, (self.incorp10, self.incorp20,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3020
                    self.incorp30, self.iridium10, self.concorp10, self.amber10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3021
                    self.amber20, self.bronze10, self.bronze20, self.bronze30,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3022
                    self.brass10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3023
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3024
                self.image_create(self.rurl)
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3025
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3026
                self.pkg("install [email protected]")
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3027
                # install files that conflict w/ existing incorps
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3028
                self.pkg("install [email protected]", exit=1)
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3029
                # install package w/ dependencies that violate incorps
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3030
                self.pkg("install [email protected]", exit=1)
676
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  3031
                # install package w/ unspecified dependency that pulls
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  3032
                # in bronze
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  3033
                self.pkg("install brass")
216d2efd0c27 4571 incorporation wad doesn'r handle unachored dependencies correctly anymore
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 655
diff changeset
  3034
                self.pkg("verify [email protected] [email protected]")
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3035
                # attempt to install conflicting incorporation
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3036
                self.pkg("install [email protected]", exit=1)
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3037
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3038
                # attempt to force downgrade of package w/ older incorp
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3039
                self.pkg("install [email protected]")
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3040
                self.pkg("uninstall [email protected]")
3431
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
  3041
                self.pkg("install [email protected]")
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3042
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3043
                # upgrade pkg that loses incorp. deps. in new version
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  3044
                self.pkg("install [email protected]")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3045
                self.pkg("update")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  3046
                self.pkg("list [email protected]")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3047
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3048
        def test_upgrade3(self):
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3049
                """Test for editable files moving between packages or locations
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3050
                or both."""
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3051
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3052
                install_cmd = "install"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3053
                self.pkgsend_bulk(self.rurl, (self.silver10, self.silver20,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3054
                    self.silver30, self.gold10, self.gold20, self.gold30,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3055
                    self.golduser10, self.golduser20, self.silveruser))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3056
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3057
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3058
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3059
                # test 1: move an editable file between packages
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3060
                self.pkg("%s --parsable=0 [email protected] [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3061
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3062
                    installed=[
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3063
                        'etc/ftpd/ftpusers',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3064
                        'etc/group',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3065
                        'etc/passwd',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3066
                        'etc/shadow',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3067
                    ]
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3068
                )
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3069
                self.pkg("verify -v")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  3070
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3071
                # modify config file
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
  3072
                test_str = "this file has been modified 1"
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3073
                file_path = "etc/passwd"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3074
                self.file_append(file_path, test_str)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3075
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3076
                # make sure /etc/passwd contains correct string
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3077
                self.file_contains(file_path, test_str)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3078
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3079
                # update packages
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3080
                self.pkg("%s -nvv [email protected] [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3081
                self.pkg("%s --parsable=0 [email protected] [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3082
                self._assertEditables()
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3083
                self.pkg("verify -v")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  3084
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3085
                # make sure /etc/passwd contains still correct string
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3086
                self.file_contains(file_path, test_str)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3087
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3088
                self.pkg("uninstall --parsable=0 silver gold")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3089
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3090
                    removed=[
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3091
                        'etc/ftpd/ftpusers',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3092
                        'etc/group',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3093
                        'etc/passwd',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3094
                        'etc/shadow',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3095
                    ],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3096
                )
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3097
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3098
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3099
                # test 2: change an editable file's path within a package
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3100
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3101
                self.pkg("verify -v")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  3102
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3103
                # modify config file
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
  3104
                test_str = "this file has been modified test 2"
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3105
                file_path = "etc/passwd"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3106
                self.file_append(file_path, test_str)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  3107
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3108
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3109
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3110
                    moved=[['etc/passwd', 'etc/config2']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3111
                    removed=[
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3112
                        'etc/ftpd/ftpusers',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3113
                        'etc/group',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3114
                        'etc/shadow',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3115
                    ],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3116
                )
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3117
                self.pkg("verify -v")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3118
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3119
                # make sure /etc/config2 contains correct string
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3120
                file_path = "etc/config2"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3121
                self.file_contains(file_path, test_str)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3122
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3123
                self.pkg("uninstall --parsable=0 gold")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3124
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3125
                    removed=['etc/config2'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3126
                )
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3127
                self.pkg("verify -v")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3128
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3129
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3130
                # test 3: move an editable file between packages and change its path
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3131
                self.pkg("%s --parsable=0 [email protected] [email protected]" % install_cmd)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3132
                self.pkg("verify -v")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3133
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3134
                # modify config file
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3135
                file_path = "etc/passwd"
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
  3136
                test_str = "this file has been modified test 3"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3137
                self.file_append(file_path, test_str)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3138
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3139
                self.file_contains(file_path, test_str)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3140
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3141
                self.pkg("%s --parsable=0 [email protected] [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3142
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3143
                    moved=[['etc/passwd', 'etc/config2']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3144
                    removed=[
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3145
                        'etc/ftpd/ftpusers',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3146
                        'etc/group',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3147
                        'etc/shadow',
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3148
                    ],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3149
                )
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3150
                self.pkg("verify -v")
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3151
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3152
                # make sure /etc/config2 now contains correct string
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3153
                file_path = "etc/config2"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3154
                self.file_contains(file_path, test_str)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3155
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3156
                self.pkg("uninstall --parsable=0 gold silver")
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3157
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3158
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3159
                # test 4: move /etc/passwd between packages and ensure that we
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3160
                # can still uninstall a user at the same time.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3161
                self.pkg("%s --parsable=0 [email protected] [email protected]" % install_cmd)
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3162
                self.pkg("verify -v")
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3163
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3164
                # add a user
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3165
                self.pkg("install [email protected]")
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3166
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3167
                # make local changes to the user
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3168
                pwdpath = os.path.join(self.get_img_path(), "etc/passwd")
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3169
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3170
                pwdfile = file(pwdpath, "r+")
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3171
                lines = pwdfile.readlines()
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3172
                for i, l in enumerate(lines):
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3173
                        if l.startswith("Kermit"):
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3174
                                lines[i] = lines[i].replace("& User",
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3175
                                    "Kermit loves Miss Piggy")
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3176
                pwdfile.seek(0)
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3177
                pwdfile.writelines(lines)
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3178
                pwdfile.close()
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3179
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3180
                silly_path = os.path.join(self.get_img_path(), "etc/silly")
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3181
                silly_inode = os.stat(silly_path).st_ino
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3182
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3183
                # update packages
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3184
                self.pkg("%s --parsable=0 [email protected] [email protected] [email protected] "
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3185
                    "silveruser" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3186
                self._assertEditables()
1713
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3187
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3188
                # make sure Kermie is still installed and still has our local
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3189
                # changes
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3190
                self.file_contains("etc/passwd",
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3191
                    "Kermit:x:5:4:Kermit loves Miss Piggy:/export/home/Kermit:")
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3192
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3193
                # also make sure that /etc/silly hasn't been removed and added
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3194
                # again, even though it wasn't marked specially
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3195
                self.assertEqual(os.stat(silly_path).st_ino, silly_inode)
79b3c456f189 13907 renaming SUNWcs causes renamed package delivering user to fail uninstall
Danek Duvall <danek.duvall@sun.com>
parents: 1710
diff changeset
  3196
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3197
        def test_upgrade4(self):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3198
                """Test to make sure hardlinks are correctly restored when file
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3199
                they point to is updated."""
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3200
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3201
                self.pkgsend_bulk(self.rurl, (self.iron10, self.iron20))
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3202
                self.image_create(self.rurl)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3203
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3204
                self.pkg("install [email protected]")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3205
                self.pkg("verify -v")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  3206
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3207
                self.pkg("install [email protected]")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3208
                self.pkg("verify -v")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  3209
3430
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3210
        def test_upgrade5(self):
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3211
                """Test manually removed directory and files will be restored
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3212
                 during update, if mode are different."""
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3213
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3214
                self.pkgsend_bulk(self.rurl, (self.dumdir10, self.dumdir20))
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3215
                self.image_create(self.rurl)
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3216
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3217
                self.pkg("install -vvv [email protected]")
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3218
                self.pkg("verify -v")
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3219
                dirpath = os.path.join(self.test_root, "image0", "etc")
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3220
                shutil.rmtree(dirpath)
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3221
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3222
                self.pkg("update -vvv [email protected]")
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3223
                self.pkg("verify -v")
e4b69edc64ab 15504318 action upgrade needs to consider a missing origin
saurabh.vyas@oracle.com
parents: 3429
diff changeset
  3224
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  3225
        def test_upgrade_liveroot(self):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3226
                """Test to make sure upgrade of package fails if on live root
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3227
                and reboot is needed."""
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3228
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3229
                self.upgrade_liveroot_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3230
                self.upgrade_liveroot_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3231
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3232
        def upgrade_liveroot_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3233
                self.pkgsend_bulk(self.rurl, (self.liveroot10, self.liveroot20))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3234
                self.image_create(self.rurl)
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  3235
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3236
                self.pkg("--debug simulate_live_root=%s %s [email protected]" %
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3237
                    (self.get_img_path(), install_cmd))
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  3238
                self.pkg("verify -v")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3239
                self.pkg("--debug simulate_live_root=%s %s --deny-new-be "
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3240
                    "[email protected]" % (self.get_img_path(),  install_cmd),
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3241
                    exit=5)
2158
5a688b5b92a3 15864 inferring image location from current working directory can be harmful
Shawn Walker <shawn.walker@oracle.com>
parents: 2151
diff changeset
  3242
                self.pkg("--debug simulate_live_root=%s uninstall "
5a688b5b92a3 15864 inferring image location from current working directory can be harmful
Shawn Walker <shawn.walker@oracle.com>
parents: 2151
diff changeset
  3243
                    "--deny-new-be liveroot" % self.get_img_path(), exit=5)
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  3244
                # "break" liveroot@1
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  3245
                self.file_append("etc/liveroot", "this file has been changed")
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  3246
                self.pkg("--debug simulate_live_root=%s fix --deny-new-be "
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  3247
                    "liveroot" % self.get_img_path(), exit=5)
1328
5c3747a4fe0a 9387 pkg fix should honor reboot-needed flag
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1309
diff changeset
  3248
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3249
        def test_upgrade_driver_conflicts(self):
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3250
                """Test to make sure driver_aliases conflicts don't cause
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3251
                add_drv to fail."""
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3252
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3253
                self.upgrade_driver_conflicts_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3254
                self.upgrade_driver_conflicts_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3255
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3256
        def upgrade_driver_conflicts_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3257
                self.pkgsend_bulk(self.rurl, (self.dricon1, self.dricon2,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3258
                    self.dricon3))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3259
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3260
                self.image_create(self.rurl)
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3261
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3262
                self.pkg("list -afv")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3263
                self.pkg("%s dricon@1" % install_cmd)
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3264
                # This one should comment out the wigit entry in driver_aliases
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3265
                self.pkg("%s dricon@2" % install_cmd)
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3266
                da_contents = file(os.path.join(self.get_img_path(),
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3267
                    "etc/driver_aliases")).readlines()
1309
1adb555e1fef 10630 driver action gets confused by driver_aliases entries not covered by an action (fix testcase)
Danek Duvall <danek.duvall@sun.com>
parents: 1306
diff changeset
  3268
                self.assert_("# pkg(5): wigit \"pci8086,1234\"\n" in da_contents)
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3269
                self.assert_("wigit \"pci8086,1234\"\n" not in da_contents)
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3270
                self.assert_("wigit \"pci8086,4321\"\n" in da_contents)
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3271
                self.assert_("zigit \"pci8086,1234\"\n" in da_contents)
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3272
                # This one should fail
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3273
                self.pkg("%s dricon@3" % install_cmd, exit=1)
1306
9a02ddf28dea 10630 driver action gets confused by driver_aliases entries not covered by an action
Danek Duvall <danek.duvall@sun.com>
parents: 1211
diff changeset
  3274
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3275
        def test_driver_policy_removal(self):
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3276
                """Test for bug #9568 - that removing a policy for a
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3277
                driver where there is no minor node associated with it,
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3278
                works successfully.
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3279
                """
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3280
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3281
                self.driver_policy_removal_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3282
                self.driver_policy_removal_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3283
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3284
        def driver_policy_removal_helper(self, install_cmd):
3432
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3285
                self.pkgsend_bulk(self.rurl, (self.dripol1, self.dripol2,
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3286
                    self.dripol3, self.dripol4, self.dripol5))
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3287
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3288
                self.image_create(self.rurl)
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3289
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3290
                self.pkg("list -afv")
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3291
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3292
                # Should install the frigit driver with a policy.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3293
                self.pkg("%s dripol@1" % install_cmd)
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3294
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3295
                # Check that there is a policy entry for this
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3296
                # device in /etc/security/device_policy
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3297
                dp_contents = file(os.path.join(self.get_img_path(),
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3298
                    "etc/security/device_policy")).readlines()
3432
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3299
                self.assert_("frigit:*\tread_priv_set=net_rawaccess\t"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3300
                    "write_priv_set=net_rawaccess\ttpd_member=true\n"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3301
                    in dp_contents)
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3302
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3303
                # Should reinstall the frigit driver without a policy.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3304
                self.pkg("%s dripol@2" % install_cmd)
1340
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3305
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3306
                # Check that there is no longer a policy entry for this
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3307
                # device in /etc/security/device_policy
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3308
                dp_contents = file(os.path.join(self.get_img_path(),
f735aad5ca3f 9568 image-update produces driver removal of policy warnings
Peter Dennis - Sustaining Engineer <Peter.Dennis@Sun.COM>
parents: 1328
diff changeset
  3309
                    "etc/security/device_policy")).readlines()
3432
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3310
                self.assert_("frigit:*\tread_priv_set=net_rawaccess\t"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3311
                    "write_priv_set=net_rawaccess\ttpd_member=true\n"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3312
                    not in dp_contents)
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3313
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3314
                self.pkg("update dripol@3")
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3315
                dp_contents = open(os.path.join(self.get_img_path(),
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3316
                    "etc/security/device_policy")).readlines()
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3317
                self.assert_("frigit:*\ttpd_member=true\n"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3318
                    in dp_contents)
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3319
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3320
                self.pkg("update dripol@5")
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3321
                dp_contents = open(os.path.join(self.get_img_path(),
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3322
                    "etc/security/device_policy")).readlines()
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3323
                self.assert_("frigit:node1\tread_priv_set=all"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3324
                    "\twrite_priv_set=all\ttpd_member=true\n"
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3325
                    in dp_contents)
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3326
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3327
                self.pkg("update dripol@4")
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3328
                dp_contents = open(os.path.join(self.get_img_path(),
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3329
                    "etc/security/device_policy")).readlines()
489e5c945d1d 19483340 driver action policy update displays false failure messages
saurabh.vyas@oracle.com
parents: 3431
diff changeset
  3330
                self.assert_("frigit:node1" not in dp_contents)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  3331
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3332
        def test_file_preserve(self):
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3333
                """Verify that file preserve=true works as expected during
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3334
                package install, update, upgrade, and removal."""
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3335
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3336
                install_cmd = "install"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3337
                self.pkgsend_bulk(self.rurl, (self.preserve1, self.preserve2,
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3338
                    self.preserve3, self.renpreserve))
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3339
                self.image_create(self.rurl)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3340
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3341
                # If there are no local modifications, no preservation should be
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3342
                # done.  First with no content change ...
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3343
                self.pkg("%s --parsable=0 preserve@1" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3344
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3345
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3346
                )
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3347
                self.pkg("%s --parsable=0 preserve@2" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3348
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3349
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3350
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3351
                self.file_contains("testme", "preserve1")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3352
                self.pkg("verify preserve")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3353
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3354
                self.pkg("update --parsable=0 preserve@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3355
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3356
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3357
                )
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3358
                self.file_contains("testme", "preserve1")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3359
                self.pkg("verify preserve")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3360
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3361
                self.pkg("uninstall --parsable=0 preserve")
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3362
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3363
                # ... and again with content change.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3364
                self.pkg("install --parsable=0 preserve@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3365
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3366
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3367
                )
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3368
                self.pkg("install --parsable=0 preserve@3")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3369
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3370
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3371
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3372
                self.file_contains("testme", "preserve3")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3373
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3374
                self.pkg("update --parsable=0 preserve@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3375
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3376
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3377
                )
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3378
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3379
                self.file_contains("testme", "preserve1")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3380
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3381
                self.pkg("verify preserve")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3382
                self.pkg("uninstall --parsable=0 preserve")
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3383
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3384
                # Modify the file locally and update to a version where the
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3385
                # content changes.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3386
                self.pkg("%s --parsable=0 preserve@1" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3387
                self.file_append("testme", "junk")
1832
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  3388
                self.file_contains("testme", "preserve1")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3389
                self.pkg("%s --parsable=0 preserve@3" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3390
                self._assertEditables()
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3391
                self.file_contains("testme", "preserve1")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3392
                self.file_contains("testme", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3393
                self.file_doesnt_exist("testme.old")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3394
                self.file_doesnt_exist("testme.new")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3395
                self.pkg("verify preserve")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3396
                self.pkg("uninstall --parsable=0 preserve")
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3397
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3398
                # Modify the file locally and downgrade to a version where
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3399
                # the content changes.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3400
                self.pkg("%s --parsable=0 preserve@3" % install_cmd)
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3401
                self.file_append("testme", "junk")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3402
                self.file_contains("testme", "preserve3")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3403
                self.pkg("update --parsable=0 preserve@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3404
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3405
                    moved=[['testme', 'testme.update']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3406
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3407
                )
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3408
                self.file_doesnt_contain("testme", "preserve3")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3409
                self.file_doesnt_contain("testme", "junk")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3410
                self.file_doesnt_exist("testme.old")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3411
                self.file_doesnt_exist("testme.new")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3412
                self.file_exists("testme.update")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3413
                self.file_remove("testme.update")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3414
                self.pkg("verify preserve")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3415
                self.pkg("uninstall --parsable=0 preserve")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3416
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3417
                # Modify the file locally and update to a version where just the
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3418
                # mode changes.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3419
                self.pkg("%s --parsable=0 preserve@1" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3420
                self.file_append("testme", "junk")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3421
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3422
                self.pkg("%s --parsable=0 preserve@2" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3423
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3424
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3425
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3426
                self.file_contains("testme", "preserve1")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3427
                self.file_contains("testme", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3428
                self.file_doesnt_exist("testme.old")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3429
                self.file_doesnt_exist("testme.new")
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3430
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3431
                self.pkg("update --parsable=0 preserve@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3432
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3433
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3434
                )
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3435
                self.file_contains("testme", "preserve1")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3436
                self.file_contains("testme", "junk")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3437
                self.file_doesnt_exist("testme.old")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3438
                self.file_doesnt_exist("testme.new")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3439
                self.file_doesnt_exist("testme.update")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3440
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3441
                self.pkg("%s --parsable=0 preserve@2" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3442
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3443
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3444
                )
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3445
                self.file_doesnt_exist("testme.old")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3446
                self.file_doesnt_exist("testme.new")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3447
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3448
                # Remove the file locally and update the package; this should
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3449
                # simply replace the missing file.
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3450
                self.file_remove("testme")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3451
                self.pkg("%s --parsable=0 preserve@3" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3452
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3453
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3454
                )
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3455
                self.pkg("verify preserve")
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3456
                self.file_exists("testme")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3457
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3458
                # Remove the file locally and downgrade the package; this should
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3459
                # simply replace the missing file.
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3460
                self.file_remove("testme")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3461
                self.pkg("update --parsable=0 preserve@2")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3462
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3463
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3464
                )
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3465
                self.pkg("verify preserve")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3466
                self.file_exists("testme")
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  3467
                self.pkg("uninstall preserve@2")
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3468
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3469
                # Verify preserved files will have their mode changed on update.
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3470
                self.pkg("%s --parsable=0 preserve@1" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3471
                self.pkg("%s --parsable=0 preserve@2" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3472
                self.pkg("verify preserve")
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3473
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3474
                # Verify that a package with a missing file that is marked with
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3475
                # the preserve=true won't cause uninstall failure.
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3476
                self.file_remove("testme")
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3477
                self.file_doesnt_exist("testme")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3478
                self.pkg("uninstall --parsable=0 preserve")
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3479
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3480
                # Verify preserve works across package rename with and without
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3481
                # original_name use and even when the original file is missing.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3482
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3483
                foo1_path = os.path.join(self.get_img_path(), "foo1")
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3484
                self.assert_(os.path.isfile(foo1_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3485
                bronze1_path = os.path.join(self.get_img_path(), "bronze1")
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3486
                self.assert_(os.path.isfile(bronze1_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3487
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3488
                # Update across the rename boundary, then verify that the files
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3489
                # were installed with their new name and the old ones were
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3490
                # removed.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3491
                self.pkg("update -nvv orig_pkg")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3492
                self.pkg("update --parsable=0 orig_pkg")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3493
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3494
                    moved=[['foo1', 'foo2']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3495
                )
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3496
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3497
                foo2_path = os.path.join(self.get_img_path(), "foo2")
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3498
                self.assert_(not os.path.exists(foo1_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3499
                self.assert_(os.path.isfile(foo2_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3500
                self.assert_(os.path.isfile(bronze1_path))
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3501
                self.pkg("uninstall --parsable=0 \*")
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3502
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3503
                # Update across the rename boundary, then truncate each of the
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3504
                # preserved files.  They should remain empty even though one is
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3505
                # changing names and the other is simply being preserved across
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3506
                # a package rename.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3507
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3508
                open(foo1_path, "wb").close()
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3509
                open(bronze1_path, "wb").close()
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3510
                self.pkg("update --parsable=0 orig_pkg")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3511
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3512
                    moved=[['foo1', 'foo2']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3513
                )
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3514
                self.assert_(not os.path.exists(foo1_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3515
                self.assert_(os.path.isfile(foo2_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3516
                self.assertEqual(os.stat(foo2_path).st_size, 0)
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3517
                self.assert_(os.path.isfile(bronze1_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3518
                self.assertEqual(os.stat(bronze1_path).st_size, 0)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3519
                self.pkg("uninstall --parsable=0 \*")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3520
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3521
                    removed=['bronze1', 'foo2'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3522
                )
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3523
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3524
                # Update across the rename boundary, then verify that a change
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3525
                # in file name will cause re-delivery of preserved files, but
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3526
                # unchanged, preserved files will not be re-delivered.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3527
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3528
                os.unlink(foo1_path)
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3529
                os.unlink(bronze1_path)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3530
                self.pkg("update --parsable=0 orig_pkg")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3531
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3532
                    moved=[['foo1', 'foo2']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3533
                )
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3534
                self.assert_(not os.path.exists(foo1_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3535
                self.assert_(os.path.isfile(foo2_path))
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3536
                self.assert_(not os.path.exists(bronze1_path))
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3537
                self.pkg("uninstall --parsable=0 \*")
2192
906bafc90a02 17702 file install can fail when original_name and preserve set and old file exists
Shawn Walker <shawn.walker@oracle.com>
parents: 2183
diff changeset
  3538
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3539
                # Ensure directory is empty before testing.
2293
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3540
                api_inst = self.get_img_api_obj()
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3541
                img_inst = api_inst.img
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3542
                sroot = os.path.join(img_inst.imgdir, "lost+found")
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3543
                shutil.rmtree(sroot)
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3544
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3545
                # Verify that unmodified, preserved files will not be salvaged
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3546
                # on uninstall.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3547
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
2293
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3548
                self.file_contains("testme", "preserve1")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3549
                self.pkg("uninstall --parsable=0 preserve")
2293
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3550
                salvaged = [
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3551
                    n for n in os.listdir(sroot)
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3552
                    if n.startswith("testme-")
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3553
                ]
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3554
                self.assertEqual(salvaged, [])
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3555
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3556
                # Verify that modified, preserved files will be salvaged
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3557
                # on uninstall.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3558
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
2293
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3559
                self.file_contains("testme", "preserve1")
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3560
                self.file_append("testme", "junk")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3561
                self.pkg("uninstall --parsable=0 preserve")
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3562
                self.__salvage_file_contains(sroot, "testme", "junk")
2293
631000734928 3679 modified preserve=true files should be backed up during uninstall
Shawn Walker <shawn.walker@oracle.com>
parents: 2287
diff changeset
  3563
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3564
        def test_file_preserve_renameold(self):
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3565
                """Make sure that file upgrade with preserve=renameold works."""
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3566
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3567
                install_cmd = "install"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3568
                plist = self.pkgsend_bulk(self.rurl, (self.renameold1,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3569
                    self.renameold2, self.renameold3))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3570
                self.image_create(self.rurl)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3571
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3572
                # If there are no local modifications, no preservation should be
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3573
                # done.  First with no content change ...
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3574
                self.pkg("%s renold@1" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3575
                self.pkg("%s renold@2" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3576
                self.file_contains("testme", "renold1")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3577
                self.file_doesnt_exist("testme.old")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3578
                self.file_doesnt_exist("testme.new")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3579
                self.pkg("verify renold")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3580
                self.pkg("uninstall renold")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3581
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3582
                # ... and again with content change.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3583
                self.pkg("%s renold@1" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3584
                self.pkg("%s renold@3" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3585
                self.file_contains("testme", "renold3")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3586
                self.file_doesnt_exist("testme.old")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3587
                self.file_doesnt_exist("testme.new")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3588
                self.pkg("verify renold")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3589
                self.pkg("uninstall renold")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3590
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3591
                # Modify the file locally and update to a version where the
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3592
                # content changes.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3593
                self.pkg("%s renold@1" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3594
                self.file_append("testme", "junk")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3595
                self.pkg("%s --parsable=0 renold@3" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3596
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3597
                    moved=[['testme', 'testme.old']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3598
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3599
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3600
                self.file_contains("testme.old", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3601
                self.file_doesnt_contain("testme", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3602
                self.file_contains("testme", "renold3")
1832
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  3603
                self.dest_file_valid(plist, "[email protected]", "testme", "testme")
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3604
                self.file_doesnt_exist("testme.new")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3605
                self.pkg("verify renold")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3606
                self.pkg("uninstall renold")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3607
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3608
                # Modify the file locally and update to a version where just the
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3609
                # mode changes.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3610
                self.pkg("%s renold@1" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3611
                self.file_append("testme", "junk")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3612
                self.pkg("%s --parsable=0 renold@2" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3613
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3614
                    moved=[['testme', 'testme.old']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3615
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3616
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3617
                self.file_contains("testme.old", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3618
                self.file_doesnt_contain("testme", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3619
                self.file_contains("testme", "renold1")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3620
                self.file_doesnt_exist("testme.new")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3621
                self.pkg("verify renold")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3622
                self.pkg("uninstall renold")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3623
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3624
                # Remove the file locally and update the package; this should
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3625
                # simply replace the missing file.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3626
                self.pkg("%s renold@1" % install_cmd)
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3627
                self.file_remove("testme")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3628
                self.pkg("%s --parsable=0 renold@2" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3629
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3630
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3631
                )
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3632
                self.pkg("verify renold")
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3633
                self.pkg("uninstall renold")
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3634
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3635
        def test_file_preserve_renamenew(self):
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3636
                """Make sure that file ugprade with preserve=renamenew works."""
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3637
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3638
                install_cmd = "install"
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3639
                plist = self.pkgsend_bulk(self.rurl, (self.renamenew1,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3640
                    self.renamenew2, self.renamenew3))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  3641
                self.image_create(self.rurl)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3642
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3643
                # If there are no local modifications, no preservation should be
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3644
                # done.  First with no content change ...
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3645
                self.pkg("%s rennew@1" % install_cmd)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3646
                self.pkg("%s --parsable=0 rennew@2" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3647
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3648
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3649
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3650
                self.file_contains("testme", "rennew1")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3651
                self.file_doesnt_exist("testme.new")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3652
                self.file_doesnt_exist("testme.old")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3653
                self.pkg("verify rennew")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3654
                self.pkg("uninstall rennew")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3655
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3656
                # ... and again with content change
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3657
                self.pkg("%s rennew@1" % install_cmd)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3658
                self.pkg("%s --parsable=0 rennew@3" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3659
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3660
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3661
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3662
                self.file_contains("testme", "rennew3")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3663
                self.file_doesnt_exist("testme.new")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3664
                self.file_doesnt_exist("testme.old")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3665
                self.pkg("verify rennew")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3666
                self.pkg("uninstall rennew")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3667
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3668
                # Modify the file locally and update to a version where the
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3669
                # content changes.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3670
                self.pkg("%s rennew@1" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3671
                self.file_append("testme", "junk")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3672
                self.pkg("%s --parsable=0 rennew@3" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3673
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3674
                    installed=['testme.new'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3675
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3676
                self.file_contains("testme", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3677
                self.file_doesnt_contain("testme.new", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3678
                self.file_contains("testme.new", "rennew3")
1832
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  3679
                self.dest_file_valid(plist, "[email protected]", "testme",
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  3680
                    "testme.new")
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3681
                self.file_doesnt_exist("testme.old")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3682
                self.pkg("verify rennew")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3683
                self.pkg("uninstall rennew")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3684
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3685
                # Modify the file locally and update to a version where just the
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3686
                # mode changes.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3687
                self.pkg("%s rennew@1" % install_cmd)
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3688
                self.file_append("testme", "junk")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3689
                self.pkg("%s --parsable=0 rennew@2" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3690
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3691
                    installed=['testme.new'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3692
                )
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3693
                self.file_contains("testme", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3694
                self.file_doesnt_contain("testme.new", "junk")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3695
                self.file_contains("testme.new", "rennew1")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3696
                self.file_doesnt_exist("testme.old")
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3697
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3698
                # The original file won't be touched on update, so verify fails.
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3699
                self.pkg("verify rennew", exit=1)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3700
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3701
                # Ensure that after fixing mode, verify passes.
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3702
                self.file_chmod("testme", 0640)
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3703
                self.pkg("verify rennew")
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3704
                self.pkg("uninstall rennew")
1832
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  3705
                self.file_remove("testme.new")
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3706
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3707
                # Remove the file locally and update the package; this should
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3708
                # simply replace the missing file.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3709
                self.pkg("%s rennew@1" % install_cmd)
1778
694fd825a62a 14702 file action removal fails if file is missing and original_name is set
Shawn Walker <srw@sun.com>
parents: 1767
diff changeset
  3710
                self.file_remove("testme")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3711
                self.pkg("%s --parsable=0 rennew@2" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3712
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3713
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3714
                )
1832
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  3715
                self.file_doesnt_exist("testme.new")
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  3716
                self.file_doesnt_exist("testme.old")
1767
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3717
                self.pkg("verify rennew")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3718
                self.pkg("uninstall rennew")
e8a100940a12 14570 file install logic discommoded by excessive cleverness if preserve=rename*
Danek Duvall <danek.duvall@sun.com>
parents: 1762
diff changeset
  3719
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3720
        def test_file_preserve_legacy(self):
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3721
                """Verify that preserve=legacy works as expected."""
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3722
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3723
                install_cmd = "install"
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3724
                self.pkgsend_bulk(self.rurl, (self.preslegacy,
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3725
                    self.renpreslegacy))
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3726
                self.image_create(self.rurl)
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3727
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3728
                # Ensure directory is empty before testing.
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3729
                api_inst = self.get_img_api_obj()
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3730
                img_inst = api_inst.img
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3731
                sroot = os.path.join(img_inst.imgdir, "lost+found")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3732
                shutil.rmtree(sroot)
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3733
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3734
                # Verify that unpackaged files will be salvaged on initial
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3735
                # install if a package being installed delivers the same file
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3736
                # and that the new file will be installed.
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3737
                self.file_append("testme", "unpackaged")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3738
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3739
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3740
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3741
                )
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3742
                self.file_contains("testme", "preserve1")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3743
                self.__salvage_file_contains(sroot, "testme", "unpackaged")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3744
                shutil.rmtree(sroot)
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3745
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3746
                # Verify that a package transitioning to preserve=legacy from
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3747
                # some other state will have the existing file renamed using
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3748
                # .legacy as an extension.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3749
                self.pkg("update --parsable=0 [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3750
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3751
                    moved=[['testme', 'testme.legacy']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3752
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3753
                )
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3754
                self.file_contains("testme.legacy", "preserve1")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3755
                self.file_contains("testme", "preserve2")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3756
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3757
                # Verify that if an action with preserve=legacy is upgraded
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3758
                # and its payload changes that the new payload is delivered
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3759
                # but the old .legacy file is not modified.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3760
                self.pkg("update --parsable=0 [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3761
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3762
                    updated=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3763
                )
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3764
                self.file_contains("testme.legacy", "preserve1")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3765
                self.file_contains("testme", "preserve3")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3766
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3767
                # Verify that if the file for an action marked with
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3768
                # preserve=legacy is removed that the package still
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3769
                # verifies.
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3770
                self.file_remove("testme")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3771
                self.pkg("verify -v preslegacy")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3772
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3773
                # Verify that a file removed for an action marked with
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3774
                # preserve=legacy can be reverted.
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3775
                self.pkg("revert testme")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3776
                self.file_contains("testme", "preserve3")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3777
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3778
                # Verify that an initial install of an action with
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3779
                # preserve=legacy will not install the payload of the action.
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3780
                self.pkg("uninstall preslegacy")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3781
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3782
                self._assertEditables()
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3783
                self.file_doesnt_exist("testme")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3784
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3785
                # Verify that if the original preserved file is missing during
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3786
                # a transition to preserve=legacy from some other state that
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3787
                # the new action is still delivered and the operation succeeds.
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3788
                self.pkg("uninstall preslegacy")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3789
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3790
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3791
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3792
                )
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3793
                self.file_remove("testme")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3794
                self.pkg("update --parsable=0")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3795
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3796
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3797
                )
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3798
                self.file_contains("testme", "preserve3")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3799
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3800
                # Verify that a preserved file can be moved from one package to
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3801
                # another and transition to preserve=legacy at the same time.
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3802
                self.pkg("uninstall preslegacy")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3803
                self.pkg("%s --parsable=0 [email protected]" % install_cmd)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3804
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3805
                    installed=['testme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3806
                )
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3807
                self.file_exists("testme")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3808
                self.pkg("update --parsable=0")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3809
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3810
                    moved=[['testme', 'newme.legacy']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3811
                    installed=['newme'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3812
                )
2294
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3813
                self.file_contains("testme.legacy", "preserve1")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3814
                self.file_contains("newme", "preserve2")
f0737e5aeae7 18080 need life-cycle transition support for editable files
Shawn Walker <shawn.walker@oracle.com>
parents: 2293
diff changeset
  3815
3429
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3816
        def test_file_preserve_abandon(self):
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3817
                """Verify that preserve=abandon works as expected."""
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3818
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3819
                install_cmd = "install"
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3820
                self.pkgsend_bulk(self.rurl, self.presabandon)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3821
                self.image_create(self.rurl)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3822
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3823
                # Ensure directory is empty before testing.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3824
                api_inst = self.get_img_api_obj()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3825
                img_inst = api_inst.img
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3826
                sroot = os.path.join(img_inst.imgdir, "lost+found")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3827
                shutil.rmtree(sroot)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3828
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3829
                # Verify that unpackaged files will not be salvaged on initial
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3830
                # install if a package being installed delivers the same file
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3831
                # and that the new file will not be installed.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3832
                self.file_append("testme", "unpackaged")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3833
                self.pkg("%s --parsable=0 presabandon@2" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3834
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3835
                self.file_contains("testme", "unpackaged")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3836
                self.assert_(not os.path.exists(os.path.join(sroot, "testme")))
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3837
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3838
                self.pkg("uninstall presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3839
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3840
                # Verify that an initial install of an action with
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3841
                # preserve=abandon will not install the payload of the action.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3842
                self.pkg("%s --parsable=0 presabandon@2" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3843
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3844
                self.file_doesnt_exist("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3845
                self.pkg("uninstall presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3846
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3847
                # If an action delivered by the upgraded version of the package
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3848
                # has a preserve=abandon, the new file will not be installed and
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3849
                # the existing file will not be modified.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3850
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3851
                # First with no content change ...
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3852
                self.pkg("%s --parsable=0 presabandon@1" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3853
                self._assertEditables(
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3854
                    installed=['testme'],
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3855
                )
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3856
                self.pkg("update --parsable=0 presabandon@2")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3857
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3858
                self.file_contains("testme", "preserve1")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3859
                # The currently installed version of the package has a preserve
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3860
                # value of abandon, so the file will not be removed.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3861
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3862
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3863
                self.file_exists("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3864
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3865
                # If an action delivered by the downgraded version of the package
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3866
                # has a preserve=abandon, the new file will not be installed and
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3867
                # the existing file will not be modified.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3868
                self.pkg("%s --parsable=0 presabandon@4" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3869
                self._assertEditables(
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3870
                    installed=['testme'],
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3871
                )
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3872
                self.file_contains("testme", "preserve3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3873
                self.pkg("verify presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3874
                self.pkg("update --parsable=0 presabandon@3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3875
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3876
                self.file_contains("testme", "preserve3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3877
                self.pkg("verify presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3878
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3879
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3880
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3881
                # ... and again with content change.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3882
                self.pkg("%s --parsable=0 presabandon@1" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3883
                self.pkg("%s --parsable=0 presabandon@3" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3884
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3885
                self.file_contains("testme", "preserve1")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3886
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3887
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3888
                self.pkg("install --parsable=0 presabandon@4")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3889
                self._assertEditables(
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3890
                    installed=['testme'],
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3891
                )
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3892
                self.file_contains("testme", "preserve3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3893
                self.pkg("update --parsable=0 presabandon@2")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3894
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3895
                self.file_contains("testme", "preserve3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3896
                self.pkg("verify presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3897
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3898
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3899
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3900
                # Modify the file locally and upgrade to a version where the
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3901
                # file has a preserve=abandon attribute and the content changes.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3902
                self.pkg("%s --parsable=0 presabandon@1" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3903
                self.file_append("testme", "junk")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3904
                self.pkg("%s --parsable=0 presabandon@3" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3905
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3906
                self.file_contains("testme", "preserve1")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3907
                self.file_contains("testme", "junk")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3908
                self.file_doesnt_exist("testme.old")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3909
                self.file_doesnt_exist("testme.new")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3910
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3911
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3912
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3913
                # Modify the file locally and downgrade to a version where the
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3914
                # file has a preserve=abandon attribute and the content changes.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3915
                self.pkg("%s --parsable=0 presabandon@4" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3916
                self.file_append("testme", "junk")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3917
                self.file_contains("testme", "preserve3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3918
                self.pkg("update --parsable=0 presabandon@2")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3919
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3920
                self.file_contains("testme", "preserve3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3921
                self.file_contains("testme", "junk")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3922
                self.file_doesnt_exist("testme.old")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3923
                self.file_doesnt_exist("testme.new")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3924
                self.file_doesnt_exist("testme.update")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3925
                self.pkg("verify presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3926
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3927
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3928
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3929
                # Modify the file locally and upgrade to a version where the
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3930
                # file has a preserve=abandon attribute and just the mode changes.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3931
                self.pkg("%s --parsable=0 presabandon@1" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3932
                self.file_append("testme", "junk")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3933
                self.pkg("%s --parsable=0 presabandon@2" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3934
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3935
                self.file_contains("testme", "preserve1")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3936
                self.file_contains("testme", "junk")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3937
                self.file_doesnt_exist("testme.old")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3938
                self.file_doesnt_exist("testme.new")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3939
                self.pkg("verify presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3940
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3941
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3942
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3943
                # Modify the file locally and downgrade to a version where the
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3944
                # file has a preserve=abandon attribute and just the mode changes.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3945
                self.pkg("%s --parsable=0 presabandon@4" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3946
                self.file_append("testme", "junk")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3947
                self.pkg("update --parsable=0 presabandon@3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3948
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3949
                self.file_contains("testme", "preserve3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3950
                self.file_contains("testme", "junk")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3951
                self.file_doesnt_exist("testme.old")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3952
                self.file_doesnt_exist("testme.new")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3953
                self.file_doesnt_exist("testme.update")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3954
                self.pkg("verify presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3955
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3956
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3957
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3958
                # Remove the file locally and update the package where the
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3959
                # file has a preserve=abandon attribute; this will not replace
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3960
                # the missing file.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3961
                self.pkg("%s --parsable=0 presabandon@1" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3962
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3963
                self.pkg("%s --parsable=0 presabandon@2" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3964
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3965
                self.file_doesnt_exist("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3966
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3967
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3968
                # Remove the file locally and downgrade the package where the
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3969
                # file has a preserve=abandon attribute; this will not replace
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3970
                # the missing file.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3971
                self.pkg("%s --parsable=0 presabandon@4" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3972
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3973
                self.pkg("update --parsable=0 presabandon@3")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3974
                self._assertEditables()
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3975
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3976
                # Verify that a package with a missing file that is marked with
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3977
                # the preserve=abandon won't cause uninstall failure.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3978
                self.file_doesnt_exist("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3979
                self.pkg("uninstall --parsable=0 presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3980
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3981
                # Verify that if the file for an action marked with
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3982
                # preserve=abandon is removed that the package still
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3983
                # verifies.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3984
                self.pkg("%s --parsable=0 presabandon@1" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3985
                self.pkg("%s --parsable=0 presabandon@2" % install_cmd)
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3986
                self.file_remove("testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3987
                self.pkg("verify -v presabandon")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3988
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3989
                # Verify that a file removed for an action marked with
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3990
                # preserve=abandon can be reverted.
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3991
                self.pkg("revert testme")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3992
                self.file_contains("testme", "preserve1")
c058b5293e7e 17938345 need an abandonment mechanism for editable files
saurabh.vyas@oracle.com
parents: 3428
diff changeset
  3993
2470
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  3994
        def test_directory_salvage(self):
2818
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  3995
                """Make sure basic directory salvage works as expected"""
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  3996
2470
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  3997
                self.pkgsend_bulk(self.rurl, self.salvage)
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  3998
                self.image_create(self.rurl)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  3999
                self.pkg("install [email protected]")
2470
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  4000
                self.file_append("var/mail/foo", "foo's mail")
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  4001
                self.file_append("var/mail/bar", "bar's mail")
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  4002
                self.file_append("var/mail/baz", "baz's mail")
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  4003
                self.pkg("update salvage")
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  4004
                self.file_exists("var/.migrate-to-shared/mail/foo")
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  4005
                self.file_exists("var/.migrate-to-shared/mail/bar")
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  4006
                self.file_exists("var/.migrate-to-shared/mail/baz")
94ef1a17ad4f 18427 Need a way of salvaging unpackaged contents of directories to support renaming directories containing such...
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2468
diff changeset
  4007
2818
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4008
        def test_directory_salvage_persistent(self):
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4009
                """Make sure directory salvage works as expected when salvaging
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4010
                content to an existing packaged directory."""
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4011
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4012
                # we salvage content from two directories,
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4013
                # var/noodles and var/spaghetti each of which disappear over
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4014
                # subsequent updates.
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4015
                self.pkgsend_bulk(self.rurl, self.salvage)
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4016
                self.image_create(self.rurl)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4017
                self.pkg("install [email protected]")
2818
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4018
                self.file_append("var/mail/foo", "foo's mail")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4019
                self.file_append("var/noodles/noodles.txt", "yum")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4020
                self.pkg("update [email protected]")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4021
                self.file_exists("var/.migrate-to-shared/mail/foo")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4022
                self.file_exists("var/persistent/noodles.txt")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4023
                self.file_append("var/spaghetti/spaghetti.txt", "yum")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4024
                self.pkg("update")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4025
                self.file_exists("var/persistent/noodles.txt")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4026
                self.file_exists("var/persistent/spaghetti.txt")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4027
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4028
                # ensure that we can jump from 1.0 to 3.0 directly.
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4029
                self.image_create(self.rurl)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4030
                self.pkg("install [email protected]")
2818
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4031
                self.file_append("var/noodles/noodles.txt", "yum")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4032
                self.pkg("update  [email protected]")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4033
                self.file_exists("var/persistent/noodles.txt")
9d99632a28fe 7198800 salavage-from should work with existing packaged directories
Tim Foster <tim.s.foster@oracle.com>
parents: 2808
diff changeset
  4034
2580
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4035
        def test_special_salvage(self):
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4036
                """Make sure salvaging directories with special files works as
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4037
                expected."""
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4038
2580
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4039
                self.pkgsend_bulk(self.rurl, self.salvage_special)
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4040
                self.image_create(self.rurl, destroy=True, fs=("var",))
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4041
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4042
                self.pkg("install salvage-special")
2580
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4043
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4044
                os.mkfifo(os.path.join(self.img_path(), "salvage", "fifo"))
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4045
                sock = socket.socket(socket.AF_UNIX)
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4046
                sock.bind(os.path.join(self.img_path(), "salvage", "socket"))
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4047
                sock.close()
2620
12fff26f76ad 7133778 zones p2v failing due to pkg error
Danek Duvall <danek.duvall@oracle.com>
parents: 2613
diff changeset
  4048
                # We also test block and character special files, but only if
12fff26f76ad 7133778 zones p2v failing due to pkg error
Danek Duvall <danek.duvall@oracle.com>
parents: 2613
diff changeset
  4049
                # os.mknod() is available, which it isn't always.
12fff26f76ad 7133778 zones p2v failing due to pkg error
Danek Duvall <danek.duvall@oracle.com>
parents: 2613
diff changeset
  4050
                if hasattr(os, "mknod"):
12fff26f76ad 7133778 zones p2v failing due to pkg error
Danek Duvall <danek.duvall@oracle.com>
parents: 2613
diff changeset
  4051
                        st = os.stat("/dev/null")
12fff26f76ad 7133778 zones p2v failing due to pkg error
Danek Duvall <danek.duvall@oracle.com>
parents: 2613
diff changeset
  4052
                        os.mknod(os.path.join(self.img_path(), "salvage",
12fff26f76ad 7133778 zones p2v failing due to pkg error
Danek Duvall <danek.duvall@oracle.com>
parents: 2613
diff changeset
  4053
                            "node"), st.st_mode, st.st_dev)
2580
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4054
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4055
                # This could hang reading fifo, or keel over reading socket.
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4056
                self.pkg("uninstall salvage-special")
92480b147363 2707 directory salvage doesn't deal with special files well
Danek Duvall <danek.duvall@oracle.com>
parents: 2563
diff changeset
  4057
1832
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4058
        def dest_file_valid(self, plist, pkg, src, dest):
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4059
                """Used to verify that the dest item's mode, attrs, timestamp,
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4060
                etc. match the src items's matching action as expected."""
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4061
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4062
                for p in plist:
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4063
                        pfmri = fmri.PkgFmri(p, "5.11")
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4064
                        pfmri.publisher = None
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4065
                        sfmri = pfmri.get_short_fmri().replace("pkg:/", "")
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4066
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4067
                        if pkg != sfmri:
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4068
                                continue
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4069
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4070
                        m = manifest.Manifest()
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4071
                        m.set_content(self.get_img_manifest(pfmri))
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4072
                        for a in m.gen_actions():
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4073
                                if a.name != "file":
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4074
                                        # Only want file actions that have
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4075
                                        # preserve attribute.
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4076
                                        continue
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4077
                                if a.attrs["path"] != src:
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4078
                                        # Only want actions with matching path.
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4079
                                        continue
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4080
                                self.validate_fsobj_attrs(a, target=dest)
df15686547e4 6795 pkg fix should fix file modes for some preserved files
Shawn Walker <shawn.walker@oracle.com>
parents: 1813
diff changeset
  4081
2869
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4082
        def test_link_preserve(self):
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4083
                """Ensure that files transitioning to a link still follow
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4084
                original_name preservation rules."""
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4085
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4086
                self.pkgsend_bulk(self.rurl, (self.linkpreserve))
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4087
                self.image_create(self.rurl, destroy=True, fs=("var",))
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4088
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4089
                # Install package with original config file location.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4090
                self.pkg("install --parsable=0 [email protected]")
2869
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4091
                cfg_path = os.path.join("etc", "ssh", "sshd_config")
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4092
                abs_path = os.path.join(self.get_img_path(), cfg_path)
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4093
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4094
                self.file_exists(cfg_path)
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4095
                self.assert_(not os.path.islink(abs_path))
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4096
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4097
                # Modify the file.
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4098
                self.file_append(cfg_path, "modified")
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4099
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4100
                # Install new package version, verify file replaced with link
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4101
                # and modified version was moved to new location.
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4102
                new_cfg_path = os.path.join("etc", "sunssh", "sshd_config")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4103
                self.pkg("update --parsable=0 [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4104
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4105
                    moved=[['etc/ssh/sshd_config', 'etc/sunssh/sshd_config']]
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4106
                )
2869
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4107
                self.assert_(os.path.islink(abs_path))
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4108
                self.file_exists(new_cfg_path)
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4109
                self.file_contains(new_cfg_path, "modified")
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4110
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4111
                # Uninstall, then install original version again.
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4112
                self.pkg("uninstall linkpreserve")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4113
                self.pkg("install [email protected]")
2869
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4114
                self.file_contains(cfg_path, "preserve1")
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4115
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4116
                # Install new package version and verify that unmodified file is
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4117
                # replaced with new configuration file.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4118
                self.pkg("update --parsable=0 [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4119
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4120
                    moved=[['etc/ssh/sshd_config', 'etc/sunssh/sshd_config']]
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4121
                )
2869
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4122
                self.file_contains(new_cfg_path, "preserve2")
1a53c1fce591 16390889 need test for original_name preservation for file to link
Shawn Walker <shawn.walker@oracle.com>
parents: 2830
diff changeset
  4123
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4124
        def test_many_hashalgs(self):
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4125
                """Test that when upgrading actions where the new action
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4126
                contains more hash attributes than the old action, that the
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4127
                upgrade works."""
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4128
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4129
                self.many_hashalgs_helper("install", "sha256")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4130
                self.many_hashalgs_helper("exact-install", "sha256")
3428
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
  4131
                if sha512_supported:
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
  4132
                        self.many_hashalgs_helper("install", "sha512_256")
e4c2116e8451 18673609 Test suite fail when SHA 512/t is not supported
saurabh.vyas@oracle.com
parents: 3288
diff changeset
  4133
                        self.many_hashalgs_helper("exact-install", "sha512_256")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4134
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4135
        def many_hashalgs_helper(self, install_cmd, hash_alg):
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4136
                self.pkgsend_bulk(self.rurl, (self.iron10))
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4137
                self.image_create(self.rurl, destroy=True)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4138
                self.pkg("install [email protected]")
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4139
                self.pkg("contents -m iron")
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4140
                # We have not enabled SHA2 hash publication yet.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4141
                self.assert_(("pkg.hash.%s" % hash_alg) not in self.output)
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4142
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4143
                # publish with SHA1 and SHA2 hashes
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4144
                self.pkgsend_bulk(self.rurl, self.iron20,
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4145
                    debug_hash="sha1+%s" % hash_alg)
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4146
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4147
                # verify that a non-SHA2 aware client can install these bits
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4148
                self.pkg("-D hash=sha1 update")
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4149
                self.image_create(self.rurl, destroy=True)
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4150
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4151
                # This also tests package retrieval: we always retrieve packages
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4152
                # with the least-preferred hash, but verify with the
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4153
                # most-preferred hash.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4154
                self.pkg("install [email protected]")
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4155
                self.pkg("contents -m iron")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4156
                self.assert_("pkg.hash.%s" % hash_alg in self.output)
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4157
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4158
                # publish with only SHA-2 hashes
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4159
                self.pkgsend_bulk(self.rurl, self.iron20,
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4160
                    debug_hash="%s" % hash_alg)
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4161
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4162
                # verify that a non-SHA2 aware client cannot install these bits
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4163
                # since there are no SHA1 hashes present
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4164
                self.pkg("-D hash=sha1 update", exit=1)
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4165
                self.assert_(
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4166
                    "No file could be found for the specified hash name: "
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4167
                    "'NOHASH'" in self.errout)
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4168
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4169
                # Make sure we've been publishing only with SHA2 by removing
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4170
                # those known attributes, then checking for the presence of
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4171
                # the SHA-1 attributes.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4172
                self.pkg("-D hash=%s update" % hash_alg)
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4173
                self.pkg("contents -m iron")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4174
                for attr in ["pkg.hash.%s" % hash_alg,
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4175
                    "pkg.chash.%s" % hash_alg]:
2966
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4176
                        self.output = self.output.replace(attr, "")
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4177
                self.assert_("hash" not in self.output)
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4178
                self.assert_("chash" not in self.output)
6a97d8a803d3 16297554 pkg history fails when time travelling
thejaswini.k@oracle.com
parents: 2944
diff changeset
  4179
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4180
        def test_content_hash_ignore(self):
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4181
                """Test that pkgs with content-hash attributes are ignored for
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4182
                install and verify by default."""
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4183
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4184
                elfpkg_1 = """
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4185
                    open [email protected]
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4186
                    add file %s mode=0755 owner=root group=bin path=/bin/true
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4187
                    close """
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4188
                elfpkg = elfpkg_1 % os.path.join("ro_data", "elftest.so.1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4189
                elf1 = self.pkgsend_bulk(self.rurl, (elfpkg,))[0]
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4190
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4191
                repo_dir = self.dcs[1].get_repodir()
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4192
                f = fmri.PkgFmri(elf1, None)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4193
                repo = self.get_repo(repo_dir)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4194
                mpath = repo.manifest(f)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4195
                # load manifest, add content-hash attr and store back to disk
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4196
                mani = manifest.Manifest()
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4197
                mani.set_content(pathname=mpath)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4198
                for a in mani.gen_actions():
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4199
                        if "bin/true" in str(a):
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4200
                                a.attrs["pkg.content-hash.sha256"] = "foo"
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4201
                mani.store(mpath)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4202
                # rebuild repo catalog since manifest digest changed
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4203
                repo.rebuild()
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4204
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4205
                # assert that the current pkg gate has the correct hash ranking
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4206
                self.assertTrue(len(digest.RANKED_CONTENT_HASH_ATTRS) > 0)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4207
                self.assertEqual(digest.RANKED_CONTENT_HASH_ATTRS[0], "elfhash")
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  4208
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4209
                # test that pkgrecv, pkgrepo verify, pkg install and pkg verify
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4210
                # do not complain about unknown hash
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4211
                self.pkgrecv("%s -a -d %s '*'" % (repo_dir,
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4212
                    os.path.join(self.test_root, "x.p5p")))
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4213
                self.pkgrepo("verify -s %s" % repo_dir)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4214
                self.image_create(self.rurl, destroy=True)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4215
                self.pkg("install -v %s" % elf1)
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4216
                # Note that we pass verification if any of the hashes match, but
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  4217
                # we require by default that the content hash matches.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4218
                self.pkg("verify")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  4219
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4220
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4221
class TestPkgInstallActions(pkg5unittest.SingleDepotTestCase):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4222
        # Only start/stop the depot once (instead of for every test)
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4223
        persistent_setup = True
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4224
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4225
        misc_files = {
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4226
                "ftpusers" :
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4227
"""# ident      "@(#)ftpusers   1.6     06/11/21 SMI"
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4228
#
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4229
# List of users denied access to the FTP server, see ftpusers(4).
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4230
#
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4231
root
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4232
bin
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4233
sys
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4234
adm
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4235
""",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4236
                "group" :
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4237
"""root::0:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4238
other::1:root
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4239
bin::2:root,daemon
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4240
sys::3:root,bin,adm
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4241
adm::4:root,daemon
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4242
+::::
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4243
""",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4244
                "passwd" :
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4245
"""root:x:0:0::/root:/usr/bin/bash
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4246
daemon:x:1:1::/:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4247
bin:x:2:2::/usr/bin:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4248
sys:x:3:3::/:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4249
adm:x:4:4:Admin:/var/adm:
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4250
+::::::
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4251
""",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4252
                "shadow" :
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4253
"""root:9EIfTNBp9elws:13817::::::
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4254
daemon:NP:6445::::::
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4255
bin:NP:6445::::::
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4256
sys:NP:6445::::::
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4257
adm:NP:6445::::::
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4258
+::::::::
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4259
""",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4260
                "cat" : " ",
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4261
                "empty" : ""
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4262
        }
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4263
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  4264
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4265
        foo10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4266
            open [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4267
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4268
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4269
        only_attr10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4270
            open [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4271
            add set name=foo value=bar
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4272
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4273
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4274
        only_depend10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4275
            open [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4276
            add depend type=require [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4277
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4278
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4279
        only_directory10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4280
            open [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4281
            add dir mode=0755 owner=root group=bin path=/bin
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4282
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4283
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4284
        only_driver10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4285
            open [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4286
            add driver name=zerg devlink="type=ddi_pseudo;name=zerg\\t\D"
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4287
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4288
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4289
        only_group10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4290
            open [email protected],5.11-0
784
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4291
            add group groupname=Kermit gid=28
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4292
            close """
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4293
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4294
        only_group_file10 = """
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4295
            open [email protected],5.11-0
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4296
            add dir mode=0755 owner=root group=Kermit path=/export/home/Kermit
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4297
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4298
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4299
        only_hardlink10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4300
            open [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4301
            add hardlink path=/cat.hardlink target=/cat
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4302
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4303
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4304
        only_legacy10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4305
            open [email protected],5.11-0
2687
89c38527746c 7173699 TestPkgInstallActions.test_legacy fails on SPARC
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2681
diff changeset
  4306
            add legacy category=system desc="GNU make - A utility used to build software (gmake) 3.81" hotline="Please contact your local service provider" name="gmake - GNU make" pkg=SUNWgmake vendor="Sun Microsystems, Inc." version=11.11.0,REV=2008.04.29.02.08
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4307
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4308
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4309
        only_link10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4310
            open [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4311
            add link path=/link target=/tmp/cat
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4312
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4313
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4314
        only_user10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4315
            open [email protected],5.11-0
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4316
            add user username=Kermit group=adm home-dir=/export/home/Kermit
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4317
            close """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4318
784
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4319
        only_user_file10 = """
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4320
            open [email protected],5.11-0
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4321
            add dir mode=0755 owner=Kermit group=adm path=/export/home/Kermit
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4322
            close """
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  4323
2589
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4324
        csu1 = """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4325
            open [email protected],5.11-0
2687
89c38527746c 7173699 TestPkgInstallActions.test_legacy fails on SPARC
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2681
diff changeset
  4326
            add legacy category=system desc="core software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris, (Usr)" pkg=SUNWcsu vendor="Oracle Corporation" version=11.11,REV=2009.11.11
2589
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4327
            close
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4328
        """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4329
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4330
        csu1_2 = """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4331
            open [email protected],5.11-0
2687
89c38527746c 7173699 TestPkgInstallActions.test_legacy fails on SPARC
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2681
diff changeset
  4332
            add legacy category=system desc="core software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris, (Usr)" pkg=SUNWcsu vendor="Oracle Corporation" version=11.11,REV=2010.11.11
2589
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4333
            close
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4334
        """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4335
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4336
        csu2 = """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4337
            open [email protected],5.11-0
2687
89c38527746c 7173699 TestPkgInstallActions.test_legacy fails on SPARC
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2681
diff changeset
  4338
            add legacy category=system desc="core software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris, (Usr)" pkg=SUNWcsu vendor="Oracle Corporation" version=11.11,REV=2009.11.11
2589
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4339
            close
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4340
        """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4341
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4342
        csu2_2 = """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4343
            open [email protected],5.11-0
2687
89c38527746c 7173699 TestPkgInstallActions.test_legacy fails on SPARC
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2681
diff changeset
  4344
            add legacy category=system desc="core software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris, (Usr)" pkg=SUNWcsu vendor="Oracle Corporation" version=11.11,REV=2010.11.11
2589
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4345
            close
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4346
        """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4347
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4348
        csu3 = """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4349
            open [email protected],5.11-0
2687
89c38527746c 7173699 TestPkgInstallActions.test_legacy fails on SPARC
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2681
diff changeset
  4350
            add legacy category=system desc="core software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris, (Usr)" pkg=SUNWcsu vendor="Oracle Corporation" version=11.11,REV=2009.11.11
2589
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4351
            close
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4352
        """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4353
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4354
        csu3_2 = """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4355
            open [email protected],5.11-0
2687
89c38527746c 7173699 TestPkgInstallActions.test_legacy fails on SPARC
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2681
diff changeset
  4356
            add legacy category=system desc="core software for a specific instruction-set architecture" hotline="Please contact your local service provider" name="Core Solaris, (Usr)" pkg=SUNWcsu vendor="Oracle Corporation" version=11.11,REV=2010.11.11
2589
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4357
            close
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4358
        """
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  4359
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4360
        # some of these are subsets-- "always" and "at-end"-- for performance;
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4361
        # we assume that e.g. if a and z work, that bcdef, etc. will too.
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4362
        pkg_name_valid_chars = {
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4363
            "never": " `~!@#$%^&*()=[{]}\\|;:\",<>?",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4364
            "always": "09azAZ",
2224
dba01788128c 17824 api install and update should allow specifying "latest" version of packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2211
diff changeset
  4365
            "after-first": "_-.+",
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4366
            "at-end": "09azAZ_-.+",
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4367
        }
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4368
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4369
        def setUp(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4370
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4371
                pkg5unittest.SingleDepotTestCase.setUp(self)
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4372
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4373
                self.only_file10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4374
                    open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4375
                    add file cat mode=0555 owner=root group=bin path=/cat
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4376
                    close """
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  4377
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4378
                self.only_license10 = """
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4379
                    open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4380
                    add license cat license=copyright
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  4381
                    close """
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  4382
2003
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4383
                self.baseuser = """
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4384
                    open system/action/user@0,5.11
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4385
                    add dir path=etc mode=0755 owner=root group=sys
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4386
                    add dir path=etc/ftpd mode=0755 owner=root group=sys
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4387
                    add user username=root password=9EIfTNBp9elws uid=0 group=root home-dir=/root gcos-field=Super-User login-shell=/usr/bin/bash ftpuser=false lastchg=13817 group-list=other group-list=bin group-list=sys group-list=adm
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4388
                    add group gid=0 groupname=root
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4389
                    add group gid=3 groupname=sys
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4390
                    add file empty path=etc/group mode=0644 owner=root group=sys preserve=true
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4391
                    add file empty path=etc/passwd mode=0644 owner=root group=sys preserve=true
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4392
                    add file empty path=etc/shadow mode=0400 owner=root group=sys preserve=true
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4393
                    add file empty path=etc/ftpd/ftpusers mode=0644 owner=root group=sys preserve=true
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4394
                    add file empty path=etc/user_attr mode=0644 owner=root group=sys preserve=true
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4395
                    close """
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4396
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4397
                self.singleuser = """
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4398
                    open singleuser@0,5.11
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4399
                    add user group=fozzie uid=16 username=fozzie
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4400
                    add group groupname=fozzie gid=16
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4401
                    close
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4402
                """
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4403
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4404
                self.basics0 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4405
                    open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4406
                    add file passwd mode=0644 owner=root group=sys path=etc/passwd preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4407
                    add file shadow mode=0400 owner=root group=sys path=etc/shadow preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4408
                    add file group mode=0644 owner=root group=sys path=etc/group preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4409
                    add file ftpusers mode=0644 owner=root group=sys path=etc/ftpd/ftpusers preserve=true
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4410
                    add dir mode=0755 owner=root group=sys path=etc
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4411
                    add dir mode=0755 owner=root group=sys path=etc/ftpd
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4412
                    close """
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4413
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4414
                self.basics1 = """
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4415
                    open [email protected],5.11-0
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4416
                    add dir mode=0755 owner=root group=bin path=lib
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4417
                    add dir mode=0755 owner=root group=sys path=var
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4418
                    add dir mode=0755 owner=root group=sys path=var/svc
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4419
                    add dir mode=0755 owner=root group=sys path=var/svc/manifest
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4420
                    add dir mode=0755 owner=root group=bin path=usr
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4421
                    add dir mode=0755 owner=root group=bin path=usr/local
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4422
                    close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4423
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4424
                self.grouptest = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4425
                    open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4426
                    add dir mode=0755 owner=root group=Kermit path=/usr/Kermit
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4427
                    add file empty mode=0755 owner=root group=Kermit path=/usr/local/bin/do_group_nothing
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4428
                    add group groupname=lp gid=8
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4429
                    add group groupname=staff gid=10
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4430
                    add group groupname=Kermit
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4431
                    add depend fmri=pkg:/[email protected] type=require
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4432
                    close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4433
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4434
                self.usertest10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4435
                    open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4436
                    add dir mode=0755 owner=Kermit group=Kermit path=/export/home/Kermit
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4437
                    add file empty mode=0755 owner=Kermit group=Kermit path=/usr/local/bin/do_user_nothing
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4438
                    add depend fmri=pkg:/[email protected] type=require
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4439
                    add user username=Kermit group=Kermit home-dir=/export/home/Kermit group-list=lp group-list=staff
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4440
                    add depend fmri=pkg:/[email protected] type=require
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4441
                    add depend fmri=pkg:/[email protected] type=require
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4442
                    close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4443
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4444
                self.usertest11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4445
                    open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4446
                    add dir mode=0755 owner=Kermit group=Kermit path=/export/home/Kermit
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4447
                    add file empty mode=0755 owner=Kermit group=Kermit path=/usr/local/bin/do_user_nothing
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4448
                    add depend fmri=pkg:/[email protected] type=require
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4449
                    add user username=Kermit group=Kermit home-dir=/export/home/Kermit2 group-list=lp group-list=staff group-list=root ftpuser=false
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4450
                    add depend fmri=pkg:/[email protected] type=require
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4451
                    add depend fmri=pkg:/[email protected] type=require
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4452
                    close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4453
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4454
                self.ugidtest = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4455
                    open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4456
                    add user username=dummy group=root
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4457
                    add group groupname=dummy
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4458
                    close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4459
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4460
                self.silver10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4461
                    open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4462
                    add file empty mode=0755 owner=root group=root path=/usr/local/bin/silver
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4463
                    add depend fmri=pkg:/[email protected] type=require
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4464
                    add depend fmri=pkg:/[email protected] type=require
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4465
                    close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4466
                self.silver20 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4467
                    open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4468
                    add file empty mode=0755 owner=Kermit group=Kermit path=/usr/local/bin/silver
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4469
                    add user username=Kermit group=Kermit home-dir=/export/home/Kermit group-list=lp group-list=staff
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4470
                    add depend fmri=pkg:/[email protected] type=require
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4471
                    add depend fmri=pkg:/[email protected] type=require
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4472
                    add depend fmri=pkg:/[email protected] type=require
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4473
                    close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4474
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4475
                self.devicebase = """
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4476
                    open [email protected],5.11-0
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  4477
                    add dir mode=0755 owner=root group=sys path=/var
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  4478
                    add dir mode=0755 owner=root group=sys path=/var/run
2200
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  4479
                    add dir mode=0755 owner=root group=root path=system
155eda704b2f 16279 Need a way to revert certain editable files to a as-installed state
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2199
diff changeset
  4480
                    add dir mode=0755 owner=root group=root path=system/volatile
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  4481
                    add dir mode=0755 owner=root group=sys path=/tmp
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  4482
                    add dir mode=0755 owner=root group=sys path=/etc
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  4483
                    add dir mode=0755 owner=root group=sys path=/etc/security
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  4484
                    add file empty mode=0600 owner=root group=sys path=/etc/devlink.tab preserve=true
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4485
                    add file empty mode=0644 owner=root group=sys path=/etc/name_to_major preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4486
                    add file empty mode=0644 owner=root group=sys path=/etc/driver_aliases preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4487
                    add file empty mode=0644 owner=root group=sys path=/etc/driver_classes preserve=true
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4488
                    add file empty mode=0644 owner=root group=sys path=/etc/minor_perm preserve=true
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  4489
                    add file empty mode=0644 owner=root group=sys path=/etc/security/device_policy preserve=true
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4490
                    add file empty mode=0644 owner=root group=sys path=/etc/security/extra_privs preserve=true
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4491
                    close
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4492
                """
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4493
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4494
                self.devlink10 = """
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4495
                    open [email protected],5.11-0
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4496
                    add driver name=zerg devlink="type=ddi_pseudo;name=zerg\\t\D"
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4497
                    add driver name=borg devlink="type=ddi_pseudo;name=borg\\t\D" devlink="type=ddi_pseudo;name=warg\\t\D"
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4498
                    add depend type=require fmri=devicebase
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4499
                    close
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4500
                """
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4501
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4502
                self.devlink20 = """
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4503
                    open [email protected],5.11-0
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4504
                    add driver name=zerg devlink="type=ddi_pseudo;name=zerg2\\t\D" devlink="type=ddi_pseudo;name=zorg\\t\D"
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4505
                    add driver name=borg devlink="type=ddi_pseudo;name=borg\\t\D" devlink="type=ddi_pseudo;name=zork\\t\D"
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4506
                    add depend type=require fmri=devicebase
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4507
                    close
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4508
                """
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  4509
2273
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4510
                self.devalias10 = """
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4511
                    open devalias@1,5.11
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4512
                    add driver name=zerg alias=pci8086,1234 alias=pci8086,4321
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4513
                    close
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4514
                """
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4515
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4516
                self.devalias20 = """
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4517
                    open devalias@2,5.11
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4518
                    add driver name=zerg alias=pci8086,5555
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4519
                    close
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4520
                """
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  4521
2563
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4522
                self.devaliasmove10 = """
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4523
                    open devaliasmove@1,5.11
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4524
                    add driver name=zerg alias=pci8086,5555
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4525
                    close
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4526
                """
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4527
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4528
                self.devaliasmove20 = """
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4529
                    open devaliasmove@2,5.11
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4530
                    add driver name=zerg
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4531
                    add driver name=borg alias=pci8086,5555
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4532
                    close
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4533
                """
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  4534
1050
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4535
                self.badhardlink1 = """
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4536
                    open [email protected],5.11-0
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4537
                    add hardlink path=foo target=bar
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4538
                    close
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4539
                """
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4540
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4541
                self.badhardlink2 = """
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4542
                    open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4543
                    add file cat mode=0555 owner=root group=bin path=/etc/motd
1050
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4544
                    add hardlink path=foo target=/etc/motd
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4545
                    close
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4546
                """
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  4547
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  4548
                self.make_misc_files(self.misc_files)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  4549
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4550
        def test_basics_0_install(self):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4551
                """Send basic infrastructure, install and uninstall."""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4552
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4553
                self.pkgsend_bulk(self.rurl, (self.basics0, self.basics1))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4554
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4555
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4556
                self.pkg("list -a")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4557
                self.pkg("list", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4558
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4559
                self.pkg("install basics")
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4560
                self.pkg("install basics1")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4561
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4562
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4563
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4564
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4565
                self.pkg("uninstall basics basics1")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4566
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4567
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4568
        def test_basics_0_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4569
                """Send basic infrastructure, exact-install and uninstall."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4570
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4571
                self.pkgsend_bulk(self.rurl, (self.basics0, self.basics1))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4572
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4573
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4574
                self.pkg("list -a")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4575
                self.pkg("list", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4576
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4577
                self.pkg("exact-install basics basics1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4578
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4579
                self.pkg("list")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4580
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4581
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4582
                self.pkg("uninstall basics basics1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4583
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4584
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4585
        def test_grouptest_install(self):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4586
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4587
                self.pkgsend_bulk(self.rurl, (self.basics0, self.basics1,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4588
                    self.grouptest))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4589
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4590
                self.pkg("install basics")
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4591
                self.pkg("install basics1")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4592
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4593
                self.pkg("install grouptest")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4594
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4595
                self.pkg("uninstall grouptest")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4596
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4597
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4598
        def test_grouptest_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4599
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4600
                self.pkgsend_bulk(self.rurl, (self.basics0, self.basics1,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4601
                    self.grouptest))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4602
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4603
                self.pkg("exact-install basics basics1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4604
                self.pkg("exact-install grouptest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4605
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4606
                self.pkg("list basics1", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4607
                self.pkg("uninstall grouptest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4608
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4609
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4610
        def test_usertest_install(self):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4611
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4612
                self.pkgsend_bulk(self.rurl, (self.basics0, self.basics1,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4613
                    self.grouptest, self.usertest10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4614
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4615
                self.pkg("install basics")
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  4616
                self.pkg("install basics1")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4617
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4618
                self.pkg("install usertest")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4619
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4620
                self.pkg("contents -m usertest")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4621
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4622
                self.pkgsend_bulk(self.rurl, self.usertest11)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  4623
                self.pkg("refresh")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4624
                self.pkg("install usertest")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4625
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4626
                self.pkg("contents -m usertest")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4627
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4628
                self.pkg("uninstall usertest")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4629
                self.pkg("verify")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  4630
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4631
        def test_usertest_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4632
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4633
                self.pkgsend_bulk(self.rurl, (self.basics0, self.basics1,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4634
                    self.grouptest, self.usertest10))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4635
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4636
                self.pkg("exact-install basics basics1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4637
                self.pkg("exact-install usertest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4638
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4639
                self.pkg("list basics1", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4640
                self.pkg("contents -m usertest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4641
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4642
                self.pkgsend_bulk(self.rurl, self.usertest11)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4643
                self.pkg("refresh")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4644
                self.pkg("exact-install usertest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4645
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4646
                self.pkg("contents -m usertest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4647
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4648
                self.pkg("uninstall usertest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4649
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4650
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4651
        def test_primordial_usergroup_install(self):
2003
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4652
                """Ensure that we can install user and group actions in the same
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4653
                transaction as /etc/passwd, /etc/group, etc."""
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4654
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4655
                self.pkgsend_bulk(self.rurl, [self.baseuser, self.singleuser])
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4656
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4657
                self.image_create(self.rurl)
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4658
                self.pkg("install system/action/user")
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4659
                self.pkg("verify")
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4660
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4661
                self.image_destroy()
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4662
                self.image_create(self.rurl)
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4663
                self.pkg("install singleuser", exit=1)
16461c9acfee 1637 user action should be more robust against missing ftpusers file (and others)
Danek Duvall <danek.duvall@oracle.com>
parents: 1970
diff changeset
  4664
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4665
        def test_primordial_usergroup_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4666
                """Ensure that we can exact-install user and group actions in
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4667
                the same transaction as /etc/passwd, /etc/group, etc."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4668
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4669
                self.pkgsend_bulk(self.rurl, [self.basics0, self.singleuser])
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4670
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4671
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4672
                self.pkg("exact-install basics")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4673
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4674
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4675
                self.image_destroy()
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4676
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4677
                self.pkg("exact-install  basics singleuser")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4678
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4679
        def test_ftpuser_install(self):
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4680
                """Make sure we correctly handle /etc/ftpd/ftpusers."""
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4681
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4682
                notftpuser = """
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4683
                open notftpuser@1
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4684
                add user username=animal group=root ftpuser=false
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4685
                close"""
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4686
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4687
                ftpuserexp = """
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4688
                open ftpuserexp@1
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4689
                add user username=fozzie group=root ftpuser=true
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4690
                close"""
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4691
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4692
                ftpuserimp = """
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4693
                open ftpuserimp@1
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4694
                add user username=gonzo group=root
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4695
                close"""
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4696
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4697
                self.pkgsend_bulk(self.rurl, (self.basics0, notftpuser,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4698
                    ftpuserexp, ftpuserimp))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4699
                self.image_create(self.rurl)
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4700
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4701
                self.pkg("install basics")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4702
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4703
                # Add a user with ftpuser=false.  Make sure the user is added to
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4704
                # the file, and that the user verifies.
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4705
                self.pkg("install notftpuser")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4706
                fpath = self.get_img_path() + "/etc/ftpd/ftpusers"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4707
                self.assert_("animal\n" in file(fpath).readlines())
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4708
                self.pkg("verify notftpuser")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4709
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4710
                # Add a user with an explicit ftpuser=true.  Make sure the user
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4711
                # is not added to the file, and that the user verifies.
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4712
                self.pkg("install ftpuserexp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4713
                self.assert_("fozzie\n" not in file(fpath).readlines())
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4714
                self.pkg("verify ftpuserexp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4715
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4716
                # Add a user with an implicit ftpuser=true.  Make sure the user
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4717
                # is not added to the file, and that the user verifies.
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4718
                self.pkg("install ftpuserimp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4719
                self.assert_("gonzo\n" not in file(fpath).readlines())
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4720
                self.pkg("verify ftpuserimp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4721
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4722
                # Put a user into the ftpusers file as shipped, then add that
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4723
                # user, with ftpuser=false.  Make sure the user remains in the
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4724
                # file, and that the user verifies.
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4725
                self.pkg("uninstall notftpuser")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4726
                file(fpath, "a").write("animal\n")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4727
                self.pkg("install notftpuser")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4728
                self.assert_("animal\n" in file(fpath).readlines())
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4729
                self.pkg("verify notftpuser")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4730
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4731
                # Put a user into the ftpusers file as shipped, then add that
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4732
                # user, with an explicit ftpuser=true.  Make sure the user is
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4733
                # stripped from the file, and that the user verifies.
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4734
                self.pkg("uninstall ftpuserexp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4735
                file(fpath, "a").write("fozzie\n")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4736
                self.pkg("install ftpuserexp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4737
                self.assert_("fozzie\n" not in file(fpath).readlines())
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4738
                self.pkg("verify ftpuserexp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4739
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4740
                # Put a user into the ftpusers file as shipped, then add that
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4741
                # user, with an implicit ftpuser=true.  Make sure the user is
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4742
                # stripped from the file, and that the user verifies.
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4743
                self.pkg("uninstall ftpuserimp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4744
                file(fpath, "a").write("gonzo\n")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4745
                self.pkg("install ftpuserimp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4746
                self.assert_("gonzo\n" not in file(fpath).readlines())
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4747
                self.pkg("verify ftpuserimp")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4748
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4749
        def test_groupverify_install(self):
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4750
                """Make sure we correctly verify group actions when users have
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4751
                been added."""
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4752
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4753
                simplegroups = """
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4754
                open simplegroup@1
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4755
                add group groupname=muppets gid=100
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4756
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4757
                open simplegroup2@1
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4758
                add group groupname=muppets2 gid=101
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4759
                close"""
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4760
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4761
                self.pkgsend_bulk(self.rurl, (self.basics0, simplegroups))
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4762
                self.image_create(self.rurl)
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4763
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4764
                self.pkg("install basics")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4765
                self.pkg("install simplegroup")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4766
                self.pkg("verify simplegroup")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4767
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4768
                # add additional members to group & verify
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4769
                gpath = self.get_img_file_path("etc/group")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4770
                gdata = file(gpath).readlines()
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4771
                gdata[-1] = gdata[-1].rstrip() + "kermit,misspiggy\n"
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4772
                file(gpath, "w").writelines(gdata)
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4773
                self.pkg("verify simplegroup")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4774
                self.pkg("uninstall simplegroup")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4775
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4776
                # verify that groups appear in gid order.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4777
                self.pkg("install simplegroup simplegroup2")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4778
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4779
                gdata = file(gpath).readlines()
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4780
                self.assert_(gdata[-1].find("muppets2") == 0)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4781
                self.pkg("uninstall simple*")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4782
                self.pkg("install simplegroup2 simplegroup")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4783
                gdata = file(gpath).readlines()
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4784
                self.assert_(gdata[-1].find("muppets2") == 0)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4785
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4786
        def test_preexisting_group_install(self):
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4787
                """Make sure we correct any errors in pre-existing group actions"""
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4788
                simplegroup = """
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4789
                open simplegroup@1
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4790
                add group groupname=muppets gid=70
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4791
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4792
                open simplegroup@2
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4793
                add dir path=/etc/muppet owner=root group=muppets mode=755
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4794
                add group groupname=muppets gid=70
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4795
                close"""
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4796
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4797
                self.pkgsend_bulk(self.rurl, (self.basics0, simplegroup))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4798
                self.image_create(self.rurl)
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4799
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4800
                self.pkg("install basics")
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4801
                gpath = self.get_img_file_path("etc/group")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4802
                gdata = file(gpath).readlines()
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4803
                gdata = ["muppets::1010:\n"] + gdata
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4804
                file(gpath, "w").writelines(gdata)
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4805
                self.pkg("verify")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4806
                self.pkg("install simplegroup@1")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4807
                self.pkg("verify simplegroup")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4808
                # check # lines beginning w/ 'muppets' in group file
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4809
                gdata = file(gpath).readlines()
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4810
                self.assert_(
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4811
                    len([a for a in gdata if a.find("muppets") == 0]) == 1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4812
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4813
                # make sure we can add new version of same package
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4814
                self.pkg("update simplegroup")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4815
                self.pkg("verify simplegroup")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4816
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4817
        def test_missing_ownergroup_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4818
                """test what happens when a owner or group is missing"""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4819
                missing = """
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4820
                open missing_group@1
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4821
                add dir path=etc/muppet1 owner=root group=muppets mode=755
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4822
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4823
                open missing_owner@1
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4824
                add dir path=etc/muppet2 owner=muppets group=root mode=755
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4825
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4826
                open muppetsuser@1
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4827
                add user username=muppets group=bozomuppets uid=777
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4828
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4829
                open muppetsuser@2
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4830
                add user username=muppets group=muppets uid=777
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4831
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4832
                 open muppetsgroup@1
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4833
                add group groupname=muppets gid=777
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4834
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4835
                """
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4836
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4837
                self.pkgsend_bulk(self.rurl, (self.basics0, missing))
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4838
                self.image_create(self.rurl)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4839
                self.pkg("install basics")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4840
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4841
                # try installing directory w/ a non-existing group
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4842
                self.pkg("install missing_group@1", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4843
                # try installing directory w/ a non-existing owner
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4844
                self.pkg("install missing_owner@1", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4845
                # try installing user w/ unknown group
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4846
                self.pkg("install muppetsuser@1", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4847
                # install group
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4848
                self.pkg("install muppetsgroup")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4849
                # install working user & see if it all works.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4850
                self.pkg("install muppetsuser@2")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4851
                self.pkg("install missing_group@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4852
                self.pkg("install missing_owner@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4853
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4854
                # edit group file to remove muppets group
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4855
                gpath = self.get_img_file_path("etc/group")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4856
                gdata = file(gpath).readlines()
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4857
                file(gpath, "w").writelines(gdata[0:-1])
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4858
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4859
                # verify that we catch missing group
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4860
                # in both group and user actions
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4861
                self.pkg("verify muppetsgroup", 1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4862
                self.pkg("verify muppetsuser", 1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4863
                self.pkg("fix muppetsgroup", 0)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4864
                self.pkg("verify muppetsgroup muppetsuser missing*")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4865
                self.pkg("uninstall missing*")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4866
                # try installing w/ broken group
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4867
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4868
                file(gpath, "w").writelines(gdata[0:-1])
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4869
                self.pkg("install missing_group@1", 1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4870
                self.pkg("fix muppetsgroup")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4871
                self.pkg("install missing_group@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4872
                self.pkg("install missing_owner@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4873
                self.pkg("verify muppetsgroup muppetsuser missing*")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4874
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  4875
        def test_userverify_install(self):
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4876
                """Make sure we correctly verify user actions when the on-disk
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4877
                databases have been modified."""
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4878
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4879
                simpleusers = """
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4880
                open simpleuser@1
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4881
                add user username=misspiggy group=root gcos-field="& loves Kermie" login-shell=/bin/sh uid=5
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4882
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4883
                open simpleuser2@1
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4884
                add user username=kermit group=root gcos-field="& loves mspiggy" login-shell=/bin/sh password=UP uid=6
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4885
                close
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4886
                open simpleuser2@2
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4887
                add user username=kermit group=root gcos-field="& loves mspiggy" login-shell=/bin/sh uid=6
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4888
                close"""
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4889
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4890
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4891
                self.pkgsend_bulk(self.rurl, (self.basics0, simpleusers))
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4892
                self.image_create(self.rurl)
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4893
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4894
                self.pkg("install basics")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4895
                self.pkg("install simpleuser")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4896
                self.pkg("verify simpleuser")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4897
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4898
                ppath = self.get_img_path() + "/etc/passwd"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4899
                pdata = file(ppath).readlines()
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4900
                spath = self.get_img_path() + "/etc/shadow"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4901
                sdata = file(spath).readlines()
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4902
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4903
                def finderr(err):
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  4904
                        self.assert_("\t\tERROR: " + err in self.output)
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4905
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4906
                # change a provided, empty-default field to something else
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4907
                pdata[-1] = "misspiggy:x:5:0:& loves Kermie:/:/bin/zsh"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4908
                file(ppath, "w").writelines(pdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4909
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4910
                finderr("login-shell: '/bin/zsh' should be '/bin/sh'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4911
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4912
                self.pkg("verify simpleuser")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4913
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4914
                # change a provided, non-empty-default field to the default
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4915
                pdata[-1] = "misspiggy:x:5:0:& User:/:/bin/sh"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4916
                file(ppath, "w").writelines(pdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4917
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4918
                finderr("gcos-field: '& User' should be '& loves Kermie'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4919
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4920
                self.pkg("verify simpleuser")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4921
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4922
                # change a non-provided, non-empty-default field to something
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4923
                # other than the default
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4924
                pdata[-1] = "misspiggy:x:5:0:& loves Kermie:/misspiggy:/bin/sh"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4925
                file(ppath, "w").writelines(pdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4926
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4927
                finderr("home-dir: '/misspiggy' should be '/'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4928
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4929
                self.pkg("verify simpleuser")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4930
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4931
                # add a non-provided, empty-default field
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4932
                pdata[-1] = "misspiggy:x:5:0:& loves Kermie:/:/bin/sh"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4933
                sdata[-1] = "misspiggy:*LK*:14579:7:::::"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4934
                file(ppath, "w").writelines(pdata)
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4935
                os.chmod(spath,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  4936
                    stat.S_IMODE(os.stat(spath).st_mode)|stat.S_IWUSR)
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4937
                file(spath, "w").writelines(sdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4938
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4939
                finderr("min: '7' should be '<empty>'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4940
                # fails fix since we don't repair shadow entries on purpose
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4941
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4942
                self.pkg("verify simpleuser", exit=1)
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4943
                finderr("min: '7' should be '<empty>'")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4944
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4945
                # remove a non-provided, non-empty-default field
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4946
                pdata[-1] = "misspiggy:x:5:0:& loves Kermie::/bin/sh"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4947
                sdata[-1] = "misspiggy:*LK*:14579::::::"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4948
                file(ppath, "w").writelines(pdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4949
                file(spath, "w").writelines(sdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4950
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4951
                finderr("home-dir: '' should be '/'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4952
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4953
                self.pkg("verify simpleuser")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4954
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4955
                # remove a provided, non-empty-default field
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4956
                pdata[-1] = "misspiggy:x:5:0::/:/bin/sh"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4957
                file(ppath, "w").writelines(pdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4958
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4959
                finderr("gcos-field: '' should be '& loves Kermie'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4960
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4961
                self.pkg("verify simpleuser")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4962
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4963
                # remove a provided, empty-default field
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4964
                pdata[-1] = "misspiggy:x:5:0:& loves Kermie:/:"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4965
                file(ppath, "w").writelines(pdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4966
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4967
                finderr("login-shell: '' should be '/bin/sh'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4968
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4969
                self.pkg("verify simpleuser")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4970
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4971
                # remove the user from /etc/passwd
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4972
                pdata[-1] = "misswiggy:x:5:0:& loves Kermie:/:"
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4973
                file(ppath, "w").writelines(pdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4974
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4975
                finderr("login-shell: '<missing>' should be '/bin/sh'")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4976
                finderr("gcos-field: '<missing>' should be '& loves Kermie'")
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4977
                finderr("group: '<missing>' should be 'root'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4978
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4979
                self.pkg("verify simpleuser")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4980
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4981
                # remove the user completely
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4982
                pdata[-1] = "misswiggy:x:5:0:& loves Kermie:/:"
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4983
                sdata[-1] = "misswiggy:*LK*:14579::::::"
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4984
                file(ppath, "w").writelines(pdata)
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4985
                file(spath, "w").writelines(sdata)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4986
                self.pkg("verify simpleuser", exit=1)
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4987
                finderr("username: '<missing>' should be 'misspiggy'")
1739
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4988
                self.pkg("fix simpleuser")
fbfe791925f4 9755 user action doesn't cause change if home directory changes
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1736
diff changeset
  4989
                self.pkg("verify simpleuser")
1552
ae0653294c32 5149 ftpuser part of user actions seems broken
Danek Duvall <danek.duvall@sun.com>
parents: 1538
diff changeset
  4990
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4991
                # change the password and show an error
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4992
                self.pkg("verify simpleuser")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4993
                sdata[-1] = "misspiggy:NP:14579::::::"
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4994
                file(spath, "w").writelines(sdata)
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4995
                self.pkg("verify simpleuser", exit=1)
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4996
                finderr("password: 'NP' should be '*LK*'")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4997
                self.pkg("fix simpleuser")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4998
                self.pkg("verify simpleuser")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  4999
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5000
                # verify that passwords set to anything
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5001
                # other than '*LK*" or 'NP' in manifest
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5002
                # do not cause verify errors if changed.
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5003
                self.pkg("install --reject simpleuser simpleuser2@1")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5004
                self.pkg("verify simpleuser2")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5005
                pdata = file(ppath).readlines()
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5006
                sdata = file(spath).readlines()
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5007
                sdata[-1] = "kermit:$5$pWPEsjm2$GXjBRTjGeeWmJ81ytw3q1ah7QTaI7yJeRYZeyvB.Rp1:14579::::::"
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5008
                file(spath, "w").writelines(sdata)
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5009
                self.pkg("verify simpleuser2")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5010
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5011
                # verify that upgrading package to version that implicitly
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5012
                # uses *LK* default causes password to change and that it
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5013
                # verifies correctly
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5014
                self.pkg("update simpleuser2@2")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5015
                self.pkg("verify simpleuser2")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5016
                sdata = file(spath).readlines()
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5017
                sdata[-1].index("*LK*")
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  5018
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5019
                # ascertain that users are added in uid order when
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5020
                # installed at the same time.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5021
                self.pkg("uninstall simpleuser2")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5022
                self.pkg("install simpleuser simpleuser2")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5023
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5024
                pdata = file(ppath).readlines()
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5025
                pdata[-1].index("kermit")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5026
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5027
                self.pkg("uninstall simpleuser simpleuser2")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5028
                self.pkg("install simpleuser2 simpleuser")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5029
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5030
                pdata = file(ppath).readlines()
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5031
                pdata[-1].index("kermit")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5032
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5033
        def test_minugid(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5034
                """Ensure that an unspecified uid/gid results in the first
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5035
                unused."""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5036
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5037
                self.minugid_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5038
                self.minugid_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5039
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5040
        def minugid_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5041
                self.pkgsend_bulk(self.rurl, (self.basics0, self.ugidtest))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5042
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5043
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5044
                # This will lay down the sample passwd file, group file, etc.
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5045
                self.pkg("install basics")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5046
                if install_cmd == "install":
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5047
                        self.pkg("install ugidtest")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5048
                else:
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5049
                        self.pkg("exact-install basics ugidtest")
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5050
                passwd_file = file(os.path.join(self.get_img_path(),
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5051
                    "/etc/passwd"))
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5052
                for line in passwd_file:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5053
                        if line.startswith("dummy"):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5054
                                self.assert_(line.startswith("dummy:x:5:"))
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5055
                passwd_file.close()
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5056
                group_file = file(os.path.join(self.get_img_path(),
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5057
                    "/etc/group"))
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5058
                for line in group_file:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5059
                        if line.startswith("dummy"):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5060
                                self.assert_(line.startswith("dummy::5:"))
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5061
                group_file.close()
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5062
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5063
        def test_upgrade_with_user(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5064
                """Ensure that we can add a user and change file ownership to
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5065
                that user in the same delta (mysql tripped over this early on
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5066
                in IPS development)."""
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5067
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5068
                self.upgrade_with_user_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5069
                self.upgrade_with_user_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5070
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5071
        def upgrade_with_user_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5072
                self.pkgsend_bulk(self.rurl, (self.basics0, self.basics1,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5073
                    self.silver10, self.silver20, self.grouptest))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5074
                self.image_create(self.rurl)
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5075
                self.pkg("install [email protected]")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5076
                self.pkg("%s [email protected]" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5077
                self.pkg("%s [email protected]" % install_cmd)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5078
                self.pkg("list [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5079
                self.pkg("verify -v")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5080
                self.pkg("%s [email protected]" % install_cmd)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5081
                self.pkg("verify -v")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5082
2602
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5083
        def test_upgrade_garbage_passwd(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5084
                self.upgrade_garbage_passwd_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5085
                self.upgrade_garbage_passwd_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5086
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5087
        def upgrade_garbage_passwd_helper(self, install_cmd):
2602
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5088
                self.pkgsend_bulk(self.rurl, (self.basics0, self.singleuser))
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5089
                self.image_create(self.rurl)
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5090
                pwd_path = os.path.join(self.get_img_path(), "etc/passwd")
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5091
                # Put a garbage line in /etc/passwd, and make sure we can
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5092
                # install or exact-install, uninstall a user, and preserve the
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5093
                # garbage line.  Once with a blank line in the middle, once
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5094
                # with a non-blank line with too few fields, once with a
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5095
                # non-blank line with too many fields, and once with a blank
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5096
                # line at the end.
2602
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5097
                for lineno, garbage in ((3, ""), (3, "garbage"),
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5098
                    (3, ":::::::::"), (100, "")):
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5099
                        garbage += "\n"
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5100
                        self.pkg("install basics")
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5101
                        with file(pwd_path, "r+") as pwd_file:
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5102
                                lines = pwd_file.readlines()
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5103
                                lines[lineno:lineno] = garbage
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5104
                                pwd_file.truncate(0)
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5105
                                pwd_file.seek(0)
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5106
                                pwd_file.writelines(lines)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5107
                        if install_cmd == "install":
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5108
                                self.pkg("%s singleuser" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5109
                        else:
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5110
                                self.pkg("%s basics singleuser" % install_cmd)
2602
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5111
                        with file(pwd_path) as pwd_file:
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5112
                                lines = pwd_file.readlines()
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5113
                                self.assert_(garbage in lines)
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5114
                        self.pkg("uninstall singleuser")
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5115
                        with file(pwd_path) as pwd_file:
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5116
                                lines = pwd_file.readlines()
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5117
                                self.assert_(garbage in lines)
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5118
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5119
                        self.pkg("uninstall '*'")
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5120
1855
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5121
        def test_user_in_grouplist(self):
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5122
                """If a user is present in a secondary group list when the user
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5123
                is installed, the client shouldn't crash."""
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5124
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5125
                self.user_in_grouplist_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5126
                self.user_in_grouplist_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5127
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5128
        def user_in_grouplist_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5129
                self.pkgsend_bulk(self.rurl, (self.basics0, self.only_user10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5130
                self.image_create(self.rurl)
1855
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5131
                self.pkg("install [email protected]")
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5132
                group_path = os.path.join(self.get_img_path(), "etc/group")
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5133
                with file(group_path, "r+") as group_file:
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5134
                        lines = group_file.readlines()
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5135
                        lines[0] = lines[0][:-1] + "Kermit" + "\n"
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5136
                        group_file.truncate(0)
2602
f658c881a2c5 10674 ill-formed shadow entry derailed install
Danek Duvall <danek.duvall@oracle.com>
parents: 2589
diff changeset
  5137
                        group_file.seek(0)
1855
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5138
                        group_file.writelines(lines)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5139
                if install_cmd == "install":
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5140
                        self.pkg("install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5141
                else:
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5142
                        self.pkg("exact-install [email protected] [email protected]")
1855
a0fa096913f8 9447 unknown secondary group membership causes user action installation to fail
Danek Duvall <danek.duvall@oracle.com>
parents: 1832
diff changeset
  5143
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5144
        def test_invalid_open(self):
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5145
                """Send invalid package definitions (invalid fmris); expect
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5146
                failure."""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5147
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5148
                for char in self.pkg_name_valid_chars["never"]:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5149
                        invalid_name = "invalid%[email protected],5.11-0" % char
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5150
                        self.pkgsend(self.rurl, "open '%s'" % invalid_name,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5151
                            exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5152
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5153
                for char in self.pkg_name_valid_chars["after-first"]:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5154
                        invalid_name = "%[email protected],5.11-0" % char
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5155
                        if char == "-":
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5156
                                cmd = "open -- '%s'" % invalid_name
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5157
                        else:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5158
                                cmd = "open '%s'" % invalid_name
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5159
                        self.pkgsend(self.rurl, cmd, exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5160
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5161
                        invalid_name = "invalid/%[email protected],5.11-0" % char
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5162
                        cmd = "open '%s'" % invalid_name
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5163
                        self.pkgsend(self.rurl, cmd, exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5164
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5165
        def test_valid_open(self):
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5166
                """Send a series of valid packages; expect success."""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5167
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5168
                for char in self.pkg_name_valid_chars["always"]:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5169
                        valid_name = "%svalid%s/%spkg%[email protected],5.11-0" % (char,
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5170
                            char, char, char)
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5171
                        self.pkgsend(self.rurl, "open '%s'" % valid_name)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5172
                        self.pkgsend(self.rurl, "close -A")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5173
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5174
                for char in self.pkg_name_valid_chars["after-first"]:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5175
                        valid_name = "v%salid%[email protected],5.11-0" % (char, char)
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5176
                        self.pkgsend(self.rurl, "open '%s'" % valid_name)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5177
                        self.pkgsend(self.rurl, "close -A")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5178
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5179
                for char in self.pkg_name_valid_chars["at-end"]:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5180
                        valid_name = "validpkg%[email protected],5.11-0" % char
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5181
                        self.pkgsend(self.rurl, "open '%s'" % valid_name)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5182
                        self.pkgsend(self.rurl, "close -A")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5183
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5184
        def test_devlink(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5185
                self.devlink_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5186
                self.devlink_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5187
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5188
        def devlink_helper(self, install_cmd):
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5189
                # driver actions are not valid except on OpenSolaris
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5190
                if portable.util.get_canonical_os_name() != "sunos":
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5191
                        return
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5192
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5193
                self.pkgsend_bulk(self.rurl, (self.devicebase, self.devlink10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5194
                    self.devlink20))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5195
                self.image_create(self.rurl)
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5196
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5197
                def readfile():
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5198
                        dlf = file(os.path.join(self.get_img_path(),
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5199
                            "etc/devlink.tab"))
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5200
                        dllines = dlf.readlines()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5201
                        dlf.close()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5202
                        return dllines
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5203
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5204
                def writefile(dllines):
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5205
                        dlf = file(os.path.join(self.get_img_path(),
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5206
                            "etc/devlink.tab"), "w")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5207
                        dlf.writelines(dllines)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5208
                        dlf.close()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5209
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5210
                def assertContents(dllines, contents):
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5211
                        actual = re.findall("name=([^\t;]*)",
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5212
                            "\n".join(dllines), re.M)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5213
                        self.assert_(set(actual) == set(contents))
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5214
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5215
                # Install
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5216
                self.pkg("install [email protected]")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5217
                self.pkg("verify -v")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5218
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5219
                dllines = readfile()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5220
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5221
                # Verify that three entries got added
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5222
                self.assert_(len(dllines) == 3)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5223
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5224
                # Verify that the tab character got written correctly
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5225
                self.assert_(dllines[0].find("\t") > 0)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5226
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5227
                # Upgrade
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5228
                self.pkg("%s [email protected]" % install_cmd)
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5229
                self.pkg("verify -v")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5230
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5231
                dllines = readfile()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5232
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5233
                # Verify that there are four entries now
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5234
                self.assert_(len(dllines) == 4)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5235
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5236
                # Verify they are what they should be
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5237
                assertContents(dllines, ["zerg2", "zorg", "borg", "zork"])
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5238
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5239
                # Remove
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5240
                self.pkg("uninstall devlinktest")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5241
                self.pkg("verify -v")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5242
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5243
                # Install again
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5244
                self.pkg("install [email protected]")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5245
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5246
                # Diddle with it
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5247
                dllines = readfile()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5248
                for i, line in enumerate(dllines):
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5249
                        if line.find("zerg") != -1:
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5250
                                dllines[i] = "type=ddi_pseudo;name=zippy\t\D\n"
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5251
                writefile(dllines)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5252
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5253
                # Upgrade
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5254
                self.pkg("%s [email protected]" % install_cmd)
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5255
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5256
                # Verify that we spewed a message on upgrade
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5257
                self.assert_(self.output.find("not found") != -1)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5258
                self.assert_(self.output.find("name=zerg") != -1)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5259
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5260
                # Verify the new set
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5261
                dllines = readfile()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5262
                self.assert_(len(dllines) == 5)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5263
                assertContents(dllines,
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5264
                    ["zerg2", "zorg", "borg", "zork", "zippy"])
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5265
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5266
                self.pkg("uninstall devlinktest")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5267
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5268
                # Null out the "zippy" entry
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5269
                writefile([])
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5270
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5271
                # Install again
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5272
                self.pkg("install [email protected]")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5273
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5274
                # Diddle with it
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5275
                dllines = readfile()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5276
                for i, line in enumerate(dllines):
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5277
                        if line.find("zerg") != -1:
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5278
                                dllines[i] = "type=ddi_pseudo;name=zippy\t\D\n"
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5279
                writefile(dllines)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5280
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5281
                # Remove
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5282
                self.pkg("uninstall devlinktest")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5283
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5284
                # Verify that we spewed a message on removal
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5285
                self.assert_(self.output.find("not found") != -1)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5286
                self.assert_(self.output.find("name=zerg") != -1)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5287
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5288
                # Verify that the one left behind was the one we overwrote.
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5289
                dllines = readfile()
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5290
                self.assert_(len(dllines) == 1)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5291
                assertContents(dllines, ["zippy"])
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5292
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5293
                # Null out the "zippy" entry, but add the "zerg" entry
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5294
                writefile(["type=ddi_pseudo;name=zerg\t\D\n"])
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5295
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5296
                # Install ... again
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5297
                self.pkg("install [email protected]")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5298
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5299
                # Make sure we didn't get a second zerg line
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5300
                dllines = readfile()
3230
30355eee0c43 18735378 pkg should also deliver python 2.7 versions of modules
saurabh.vyas@oracle.com
parents: 3221
diff changeset
  5301
                self.assertTrue(len(dllines) == 3, msg=dllines)
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5302
                assertContents(dllines, ["zerg", "borg", "warg"])
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5303
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5304
                # Now for the same test on upgrade
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5305
                dllines.append("type=ddi_pseudo;name=zorg\t\D\n")
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5306
                writefile(dllines)
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5307
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5308
                self.pkg("%s [email protected]" % install_cmd)
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5309
                dllines = readfile()
3230
30355eee0c43 18735378 pkg should also deliver python 2.7 versions of modules
saurabh.vyas@oracle.com
parents: 3221
diff changeset
  5310
                self.assertTrue(len(dllines) == 4, msg=dllines)
590
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5311
                assertContents(dllines, ["zerg2", "zorg", "borg", "zork"])
d002a5deff03 2349 import of 86 fails on kernel/drv/sd.conf
Danek Duvall <danek.duvall@sun.com>
parents: 581
diff changeset
  5312
2273
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5313
        def test_driver_aliases_upgrade(self):
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5314
                """Make sure that aliases properly appear and disappear on
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5315
                upgrade.  This is the result of a bug in update_drv, but it's
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5316
                not a bad idea to test some of this ourselves."""
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5317
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5318
                self.driver_aliases_upgrade_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5319
                self.driver_aliases_upgrade_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5320
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5321
        def driver_aliases_upgrade_helper(self, install_cmd):
2273
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5322
                # driver actions are not valid except on OpenSolaris
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5323
                if portable.util.get_canonical_os_name() != "sunos":
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5324
                        return
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5325
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5326
                self.pkgsend_bulk(self.rurl, [self.devicebase, self.devalias10,
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5327
                    self.devalias20])
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5328
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5329
                self.image_create(self.rurl)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5330
                self.pkg("%s devicebase devalias@1" % install_cmd)
2273
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5331
                self.pkg("update devalias")
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5332
                self.pkg("verify devalias")
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5333
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5334
                daf = open(os.path.join(self.get_img_path(),
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5335
                    "etc/driver_aliases"))
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5336
                dalines = daf.readlines()
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5337
                daf.close()
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5338
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5339
                self.assert_(len(dalines) == 1, msg=dalines)
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5340
                self.assert_(",1234" not in dalines[0])
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5341
                self.assert_(",4321" not in dalines[0])
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5342
                self.assert_(",5555" in dalines[0])
78f75ad858b7 17941 driver actions can't seem to shake their aliases
Danek Duvall <danek.duvall@oracle.com>
parents: 2270
diff changeset
  5343
2563
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5344
        def test_driver_aliases_move(self):
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5345
                """Make sure that an alias can be moved from one driver action
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5346
                to another."""
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5347
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5348
                self.driver_aliases_move_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5349
                self.driver_aliases_move_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5350
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5351
        def driver_aliases_move_helper(self, install_cmd):
2563
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5352
                self.pkgsend_bulk(self.rurl, [self.devicebase,
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5353
                    self.devaliasmove10, self.devaliasmove20])
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5354
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5355
                self.image_create(self.rurl)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5356
                self.pkg("%s devicebase devaliasmove@1" % install_cmd)
2563
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5357
                self.pkg("update devaliasmove")
2654
e47181db432e 7091514 moving driver_alias from 'hermon' to 'mcxnex' fails with 'onu'
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2642
diff changeset
  5358
                self.assert_("pci8086,5555" not in self.output)
2563
294a870f0cd6 18947 driver alias moving to a brand new driver action causes an error message about sharing
Danek Duvall <danek.duvall@oracle.com>
parents: 2518
diff changeset
  5359
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5360
        def test_uninstall_without_perms(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5361
                """Verify uninstall fails as expected for unprivileged users."""
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5362
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5363
                pkg_list = [self.foo10, self.only_attr10, self.only_depend10,
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5364
                    self.only_directory10, self.only_file10,
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5365
                    self.only_group10, self.only_hardlink10, self.only_legacy10,
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5366
                    self.only_license10, self.only_link10, self.only_user10]
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5367
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5368
                # driver actions are not valid except on OpenSolaris
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5369
                if portable.util.get_canonical_os_name() == 'sunos':
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5370
                        pkg_list += [self.only_driver10]
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  5371
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5372
                self.pkgsend_bulk(self.rurl, pkg_list + [
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5373
                    self.devicebase + self.basics0 + self.basics1])
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5374
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5375
                self.image_create(self.rurl)
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5376
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5377
                name_pat = re.compile("^\s+open\s+(\S+)\@.*$")
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5378
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5379
                def __manually_check_deps(name, install=True, exit=0):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5380
                        cmd = ["install", "--no-refresh"]
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5381
                        if not install:
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5382
                                cmd = ["uninstall"]
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5383
                        if name == "only_depend" and not install:
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5384
                                self.pkg(cmd + ["foo"], exit=exit)
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5385
                        elif name == "only_driver":
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5386
                                self.pkg(cmd + ["devicebase"], exit=exit)
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5387
                        elif name == "only_group":
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5388
                                self.pkg(cmd + ["basics"], exit=exit)
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5389
                        elif name == "only_hardlink":
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5390
                                self.pkg(cmd + ["only_file"], exit=exit)
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5391
                        elif name == "only_user":
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5392
                                if install:
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5393
                                        self.pkg(cmd + ["basics"], exit=exit)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5394
                                        self.pkg(cmd + ["only_group"],
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5395
                                            exit=exit)
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5396
                                else:
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5397
                                        self.pkg(cmd + ["only_group"],
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5398
                                            exit=exit)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5399
                                        self.pkg(cmd + ["basics"], exit=exit)
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5400
                for p in pkg_list:
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5401
                        name_mat = name_pat.match(p.splitlines()[1])
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5402
                        pname = name_mat.group(1)
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
  5403
                        __manually_check_deps(pname, exit=[0, 4])
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5404
                        self.pkg(["install", "--no-refresh", pname],
834
f8b3396500b3 4883 import failure for non-sunos platforms due to missing pspawn
Tom Mueller <Tom.Mueller@sun.com>
parents: 784
diff changeset
  5405
                            su_wrap=True, exit=1)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5406
                        self.pkg(["install", pname], su_wrap=True,
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5407
                            exit=1)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5408
                        self.pkg(["install", "--no-refresh", pname])
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5409
                        self.pkg(["uninstall", pname], su_wrap=True,
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5410
                            exit=1)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5411
                        self.pkg(["uninstall", pname])
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5412
                        __manually_check_deps(pname, install=False)
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5413
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5414
                for p in pkg_list:
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5415
                        name_mat = name_pat.match(p.splitlines()[1])
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5416
                        pname = name_mat.group(1)
2073
9fcacc9e5eaa 16998 transport should support publisher-specific write and read caches
Shawn Walker <shawn.walker@oracle.com>
parents: 2064
diff changeset
  5417
                        __manually_check_deps(pname, exit=[0, 4])
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5418
                        self.pkg(["install", "--no-refresh", pname])
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5419
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5420
                for p in pkg_list:
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5421
                        self.pkgsend_bulk(self.rurl, p)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5422
                self.pkgsend_bulk(self.rurl, (self.devicebase, self.basics0,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5423
                    self.basics1))
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5424
1710
139720e2e756 1668 image locking needed to prevent race conditions
Shawn Walker <srw@sun.com>
parents: 1618
diff changeset
  5425
                # Modifying operations require permissions needed to create and
139720e2e756 1668 image locking needed to prevent race conditions
Shawn Walker <srw@sun.com>
parents: 1618
diff changeset
  5426
                # manage lock files.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5427
                self.pkg(["update", "--no-refresh"], su_wrap=True, exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5428
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5429
                self.pkg(["refresh"])
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5430
                self.pkg(["update"], su_wrap=True, exit=1)
996
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 988
diff changeset
  5431
                # Should fail since user doesn't have permission to refresh
31d152a5212b 7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 988
diff changeset
  5432
                # publisher metadata.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5433
                self.pkg(["refresh", "--full"], su_wrap=True, exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5434
                self.pkg(["refresh", "--full"])
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5435
                self.pkg(["update", "--no-refresh"], su_wrap=True,
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5436
                    exit=1)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5437
                self.pkg(["update"])
717
c40259b4ce98 4569 pkg uninstall tracesback when lacking permissions
Brock Pytlik <bpytlik@sun.com>
parents: 676
diff changeset
  5438
784
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5439
        def test_bug_3222(self):
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5440
                """ Verify that a timestamp of '0' for a passwd file will not
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5441
                    cause further package operations to fail.  This can happen
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5442
                    when there are time synchronization issues within a virtual
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5443
                    environment or in other cases. """
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5444
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5445
                self.pkgsend_bulk(self.rurl, (self.basics0, self.only_user10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5446
                    self.only_user_file10, self.only_group10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5447
                    self.only_group_file10, self.grouptest, self.usertest10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5448
                self.image_create(self.rurl)
784
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5449
                fname = os.path.join(self.get_img_path(), "etc", "passwd")
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5450
                self.pkg("install basics")
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5451
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5452
                # This should work regardless of whether a user is installed
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5453
                # at the same time as the file in a package, or if the user is
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5454
                # installed first and then files owned by that user are
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5455
                # installed.
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5456
                plists = [["grouptest", "usertest"],
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5457
                    ["only_user", "only_user_file"],
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5458
                    ["only_group", "only_group_file"]]
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5459
                for plist in plists:
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5460
                        for pname in plist:
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5461
                                os.utime(fname, (0, 0))
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5462
                                self.pkg("install %s" % pname)
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5463
                                self.pkg("verify")
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5464
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5465
                        for pname in reversed(plist):
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5466
                                os.utime(fname, (0, 0))
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5467
                                self.pkg("uninstall %s" % pname)
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5468
                                self.pkg("verify")
ace946092e04 3222 passwd and group cache need more robustness in face of zero timestamp
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 717
diff changeset
  5469
1050
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5470
        def test_bad_hardlinks(self):
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5471
                """A couple of bogus hard link target tests."""
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5472
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5473
                self.bad_hardlinks_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5474
                self.bad_hardlinks_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5475
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5476
        def bad_hardlinks_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5477
                self.pkgsend_bulk(self.rurl, (self.badhardlink1,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5478
                    self.badhardlink2))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5479
                self.image_create(self.rurl)
1050
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5480
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5481
                # A package which tries to install a hard link to a target that
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5482
                # doesn't exist shouldn't stack trace, but exit sanely.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5483
                self.pkg("%s badhardlink1" % install_cmd, exit=1)
1050
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5484
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5485
                # A package which tries to install a hard link to a target
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5486
                # specified as an absolute path should install that link
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5487
                # relative to the image root.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5488
                self.pkg("%s badhardlink2" % install_cmd)
1050
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5489
                ino1 = os.stat(os.path.join(self.get_img_path(), "foo")).st_ino
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5490
                ino2 = os.stat(os.path.join(self.get_img_path(), "etc/motd")).st_ino
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5491
                self.assert_(ino1 == ino2)
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5492
2589
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5493
        def test_legacy(self):
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5494
                self.pkgsend_bulk(self.rurl,
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5495
                    (self.csu1, self.csu1_2, self.csu2, self.csu2_2,
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5496
                    self.csu3, self.csu3_2))
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5497
                self.image_create(self.rurl)
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5498
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5499
                self.pkg("install csu1@1 csu2@1 csu3@1")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5500
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5501
                # Make sure we installed one and only one pkginfo file, and with
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5502
                # the correct information.
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5503
                vsp = self.get_img_file_path("var/sadm/pkg")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5504
                pi = os.path.join(vsp, "SUNWcsu/pkginfo")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5505
                pi2 = os.path.join(vsp, "SUNWcsu/pkginfo.2")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5506
                pi3 = os.path.join(vsp, "SUNWcsu/pkginfo.3")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5507
                self.assert_(os.path.exists(pi), "pkginfo doesn't exist")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5508
                self.file_contains(pi, "VERSION=11.11,REV=2009.11.11")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5509
                self.assert_(not os.path.exists(pi2), "pkginfo.2 exists")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5510
                self.assert_(not os.path.exists(pi3), "pkginfo.3 exists")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5511
                # Create the hardlinks as we'd have for the old refcounting
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5512
                # system.
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5513
                os.link(pi, pi2)
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5514
                os.link(pi, pi3)
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5515
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5516
                # Make sure that upgrading the actions modifies the pkginfo file
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5517
                # correctly, and that the hardlinks go away.
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5518
                self.pkg("update")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5519
                self.file_contains(pi, "VERSION=11.11,REV=2010.11.11")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5520
                self.assert_(not os.path.exists(pi2), "pkginfo.2 exists")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5521
                self.assert_(not os.path.exists(pi3), "pkginfo.3 exists")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5522
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5523
                # Start over, but this time "break" the hardlinks.
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5524
                self.pkg("uninstall -vvv \*")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5525
                self.pkg("install csu1@1 csu2@1 csu3@1")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5526
                shutil.copy(pi, pi2)
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5527
                shutil.copy(pi, pi3)
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5528
                self.pkg("update")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5529
                self.file_contains(pi, "VERSION=11.11,REV=2010.11.11")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5530
                self.assert_(not os.path.exists(pi2), "pkginfo.2 exists")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5531
                self.assert_(not os.path.exists(pi3), "pkginfo.3 exists")
b3f4f3409d28 6147 legacy action can cause traceback if pkginfo files have been corrupted
Danek Duvall <danek.duvall@oracle.com>
parents: 2580
diff changeset
  5532
1050
54c841d1fad9 1770 Invalid "Not owner" error when path is delivered as both directory and symlink
Danek Duvall <danek.duvall@sun.com>
parents: 1025
diff changeset
  5533
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5534
class TestDependencies(pkg5unittest.SingleDepotTestCase):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5535
        # Only start/stop the depot once (instead of for every test)
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  5536
        persistent_setup = True
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5537
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5538
        pkg10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5539
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5540
            add depend type=optional fmri=pkg:/pkg2
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5541
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5542
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5543
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5544
        pkg20 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5545
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5546
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5547
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5548
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5549
        pkg11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5550
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5551
            add depend type=optional fmri=pkg:/[email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5552
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5553
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5554
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5555
        pkg21 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5556
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5557
            close
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5558
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5559
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5560
        pkg30 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5561
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5562
            add depend type=require fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5563
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5564
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5565
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5566
        pkg40 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5567
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5568
            add depend type=exclude fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5569
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5570
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5571
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5572
        pkg50 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5573
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5574
            add depend type=exclude fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5575
            add depend type=require fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5576
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5577
        """
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5578
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5579
        pkg505 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5580
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5581
            add depend type=exclude fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5582
            add depend type=require fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5583
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5584
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5585
        pkg51 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5586
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5587
            add depend type=exclude fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5588
            add depend type=exclude fmri=pkg:/pkg2
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5589
            add depend type=require fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5590
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5591
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5592
        pkg60 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5593
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5594
            add depend type=exclude fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5595
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5596
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5597
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5598
        pkg61 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5599
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5600
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5601
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5602
2468
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5603
        bug_18653 = """
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5604
            open [email protected],5.11-0
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5605
            add depend type=incorporate [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5606
            close
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5607
            open [email protected],5.11-0
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5608
            add depend type=incorporate [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5609
            close
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5610
            open [email protected],5.11-0
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5611
            add depend type=incorporate [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5612
            add depend type=incorporate [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5613
            close
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5614
            open [email protected],5.11-0
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5615
            add depend type=incorporate [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5616
            add depend type=incorporate [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5617
            close
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5618
            open [email protected],5.11-0
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5619
            add depend type=require fmri=osnet-incorporation
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5620
            add depend type=conditional predicate=perl-510 [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5621
            close
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5622
            open [email protected],5.11-0
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5623
            add depend type=require fmri=osnet-incorporation
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5624
            add depend type=conditional predicate=perl-510 [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5625
            close
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5626
            open [email protected],5.11-0
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5627
            add depend type=require fmri=osnet-incorporation
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5628
            add depend type=require [email protected]
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5629
            close
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5630
            open [email protected],5.11-0
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5631
            close
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5632
            open [email protected],5.11-0
2461
555e8b858d35 18653 conditional deps and uninstall: two great tastes that don't taste great together?
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2445
diff changeset
  5633
            close
555e8b858d35 18653 conditional deps and uninstall: two great tastes that don't taste great together?
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2445
diff changeset
  5634
        """
555e8b858d35 18653 conditional deps and uninstall: two great tastes that don't taste great together?
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2445
diff changeset
  5635
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5636
        pkg70 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5637
            open [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5638
            add depend type=conditional predicate=pkg:/[email protected] fmri=pkg:/[email protected]
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5639
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5640
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5641
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5642
        pkg80 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5643
            open [email protected],5.11-0
2267
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5644
            add depend type=require-any fmri=pkg:/[email protected] fmri=pkg:/[email protected] fmri=pkg:/nonsuch
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5645
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5646
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5647
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5648
        pkg81 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5649
            open [email protected],5.11-0
2267
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5650
            add depend type=require-any fmri=pkg:/[email protected] fmri=pkg:/[email protected] fmri=pkg:/nonsuch
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5651
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5652
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5653
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5654
        pkg90 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5655
            open [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5656
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5657
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5658
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5659
        pkg91 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5660
            open [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5661
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5662
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5663
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5664
        pkg100 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5665
            open [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5666
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5667
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5668
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5669
        pkg101 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5670
            open [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5671
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5672
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5673
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5674
        pkg102 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5675
            open [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5676
            add depend type=origin [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5677
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5678
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5679
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5680
        pkg110 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5681
            open [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5682
            add depend type=origin root-image=true [email protected]
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5683
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5684
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5685
        pkg111 = """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5686
            open [email protected],5.11-0
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5687
            add depend type=origin root-image=true [email protected]
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5688
            close
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5689
        """
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  5690
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5691
        pkg121 = """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5692
            open [email protected],5.11-0
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5693
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5694
        pkg121 += "add depend type=parent fmri=%s" % \
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5695
            pkg.actions.depend.DEPEND_SELF
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5696
        pkg121 += """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5697
            close
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5698
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5699
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5700
        pkg122 = """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5701
            open [email protected],5.11-0
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5702
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5703
        pkg122 += "add depend type=parent fmri=%s" % \
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5704
            pkg.actions.depend.DEPEND_SELF
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5705
        pkg122 += """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5706
            close
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5707
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5708
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5709
        pkg123 = """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5710
            open [email protected],5.11-0
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5711
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5712
        pkg123 += "add depend type=parent fmri=%s" % \
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5713
            pkg.actions.depend.DEPEND_SELF
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5714
        pkg123 += """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5715
            close
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5716
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5717
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5718
        pkg132 = """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5719
            open [email protected],5.11-0
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5720
            add depend type=parent [email protected],5.11-0
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5721
            close
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5722
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5723
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5724
        pkg142 = """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5725
            open [email protected],5.11-0
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5726
            add depend type=parent [email protected],5.11-0
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5727
            add depend type=parent [email protected],5.11-0
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5728
            close
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5729
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5730
2347
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5731
        pkg_nosol = """
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5732
            open [email protected],5.11-0
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5733
            add depend type=require-any fmri=pkg:/pkg-nosol-B fmri=pkg:/pkg-nosol-C
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5734
            add depend type=require fmri=pkg:/pkg-nosol-D
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5735
            close
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5736
            open [email protected],5.11-0
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5737
            add depend type=incorporate fmri=pkg:/[email protected]
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5738
            close
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5739
            open [email protected],5.11-0
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5740
            add depend type=incorporate fmri=pkg:/[email protected]
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5741
            close
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5742
            open [email protected],5.11-0
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5743
            add depend type=incorporate fmri=pkg:/[email protected]
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5744
            close
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5745
            open [email protected],5.11-0
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5746
            close
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5747
            open [email protected],5.11-0
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5748
            close
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5749
        """
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5750
2267
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5751
        pkg_renames = """
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5752
            open [email protected],5.11-0
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5753
            add depend type=require fmri=pkg_rename
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5754
            close
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5755
            open [email protected],5.11-0
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5756
            add set name=pkg.renamed value=true
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5757
            add depend type=require fmri=pkg:/pkg_bar
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5758
            close
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5759
            open [email protected],5.11-0
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5760
            close
2287
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5761
            open [email protected],5.11-0
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5762
            add set name=pkg.renamed value=true
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5763
            add depend type=require fmri=system/[email protected]
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5764
            close
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5765
            open system/[email protected],5.11-0
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5766
            close
2267
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5767
        """
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  5768
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5769
        pkgSUNWcs075 = """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5770
            open [email protected]
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5771
            close
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5772
        """
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5773
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5774
        leaf_template = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5775
            open pkg%s%s@%s,5.11-0
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5776
            add depend type=require fmri=pkg:/%s_incorp%s
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5777
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5778
        """
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5779
        install_hold = "add set name=pkg.depend.install-hold value=test"
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5780
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5781
        leaf_expansion = [
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5782
                ("A","_0", "1.0", "A", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5783
                ("A","_1", "1.0", "A", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5784
                ("A","_2", "1.0", "A", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5785
                ("A","_3", "1.0", "A", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5786
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5787
                ("B","_0", "1.0", "B", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5788
                ("B","_1", "1.0", "B", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5789
                ("B","_2", "1.0", "B", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5790
                ("B","_3", "1.0", "B", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5791
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5792
                ("A","_0", "1.1", "A", "@1.1"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5793
                ("A","_1", "1.1", "A", "@1.1"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5794
                ("A","_2", "1.1", "A", "@1.1"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5795
                ("A","_3", "1.1", "A", "@1.1"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5796
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5797
                ("B","_0", "1.1", "B", "@1.1"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5798
                ("B","_1", "1.1", "B", "@1.1"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5799
                ("B","_2", "1.1", "B", "@1.1"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5800
                ("B","_3", "1.1", "B", "@1.1"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5801
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5802
                ("A","_0", "1.2", "A", "@1.2"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5803
                ("A","_1", "1.2", "A", "@1.2"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5804
                ("A","_2", "1.2", "A", "@1.2"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5805
                ("A","_3", "1.2", "A", "@1.2"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5806
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5807
                ("B","_0", "1.2", "B", "@1.2"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5808
                ("B","_1", "1.2", "B", "@1.2"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5809
                ("B","_2", "1.2", "B", "@1.2"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5810
                ("B","_3", "1.2", "B", "@1.2"),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5811
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5812
                ("A","_0", "1.3", "A", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5813
                ("A","_1", "1.3", "A", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5814
                ("A","_2", "1.3", "A", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5815
                ("A","_3", "1.3", "A", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5816
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5817
                ("B","_0", "1.3", "B", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5818
                ("B","_1", "1.3", "B", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5819
                ("B","_2", "1.3", "B", ""),
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5820
                ("B","_3", "1.3", "B", "")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5821
                ]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5822
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5823
        incorps = [ """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5824
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5825
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5826
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5827
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5828
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5829
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5830
        """,
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5831
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5832
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5833
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5834
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5835
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5836
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5837
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5838
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5839
        """,
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5840
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5841
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5842
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5843
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5844
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5845
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5846
            add depend type=incorporate fmri=pkg:/[email protected]
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5847
            add set name=pkg.depend.install-hold value=test
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5848
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5849
        """,
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5850
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5851
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5852
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5853
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5854
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5855
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5856
            add depend type=incorporate fmri=pkg:/[email protected]
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5857
            add set name=pkg.depend.install-hold value=test
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5858
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5859
        """,
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5860
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5861
        """
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5862
            open [email protected],5.11-0
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5863
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5864
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5865
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5866
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5867
            add set name=pkg.depend.install-hold value=test.A
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5868
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5869
        """,
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5870
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5871
        """
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5872
            open [email protected],5.11-0
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5873
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5874
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5875
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5876
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5877
            add set name=pkg.depend.install-hold value=test.B
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5878
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5879
        """,
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5880
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5881
        """
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5882
            open [email protected],5.11-0
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5883
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5884
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5885
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5886
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5887
            add set name=pkg.depend.install-hold value=test.A
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5888
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5889
        """,
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5890
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5891
        """
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5892
            open [email protected],5.11-0
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5893
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5894
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5895
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5896
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5897
            add set name=pkg.depend.install-hold value=test.B
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5898
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5899
        """,
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5900
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5901
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5902
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5903
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5904
            add depend type=incorporate fmri=pkg:/[email protected]
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5905
            add set name=pkg.depend.install-hold value=test
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5906
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5907
        """,
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5908
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5909
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5910
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5911
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5912
            add depend type=incorporate fmri=pkg:/[email protected]
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5913
            add set name=pkg.depend.install-hold value=test
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5914
            close
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5915
        """,
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5916
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5917
        """
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5918
            open [email protected],5.11-0
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5919
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5920
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5921
            add set name=pkg.depend.install-hold value=test
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5922
            close
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5923
        """,
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5924
        """
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5925
            open [email protected],5.11-0
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5926
            add depend type=incorporate fmri=pkg:/[email protected]
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5927
            add depend type=exclude fmri=pkg:/pkgB_0
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5928
            add set name=pkg.depend.install-hold value=test
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5929
            close
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5930
        """
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  5931
        ]
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  5932
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5933
        bug_7394_incorp = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5934
            open [email protected],5.11-0
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5935
            add depend type=incorporate fmri=pkg:/[email protected]
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5936
            close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5937
        """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5938
3134
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5939
        exclude_group = """
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5940
            open network/[email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5941
            close
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5942
            open [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5943
            add depend type=group fmri=network/rsync
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5944
            close
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5945
            open utility/[email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5946
            add depend type=exclude fmri=network/rsync
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5947
            close
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5948
        """
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5949
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  5950
        def setUp(self):
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5951
                pkg5unittest.SingleDepotTestCase.setUp(self, image_count=2)
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5952
                self.pkgsend_bulk(self.rurl, (self.pkg10, self.pkg20,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5953
                    self.pkg11, self.pkg21, self.pkg30, self.pkg40, self.pkg50,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5954
                    self.pkg505, self.pkg51, self.pkg60, self.pkg61,
2468
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  5955
                    self.bug_18653, self.pkg70, self.pkg80, self.pkg81,
3134
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5956
                    self.pkg90, self.pkg91, self.bug_7394_incorp, self.pkg100,
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5957
                    self.pkg101, self.pkg102, self.pkg110, self.pkg111,
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  5958
                    self.pkg121, self.pkg122, self.pkg123, self.pkg132,
2347
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  5959
                    self.pkg142, self.pkg_nosol, self.pkg_renames,
3134
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5960
                    self.pkgSUNWcs075, self.exclude_group))
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5961
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  5962
                self.leaf_pkgs = []
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5963
                for t in self.leaf_expansion:
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  5964
                        self.leaf_pkgs.extend(self.pkgsend_bulk(self.rurl,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  5965
                            self.leaf_template % t))
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  5966
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  5967
                self.incorp_pkgs = []
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5968
                for i in self.incorps:
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  5969
                        self.incorp_pkgs.extend(self.pkgsend_bulk(self.rurl, i))
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5970
2287
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5971
        def test_rename_matching(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5972
                """Verify install or exact-install won't fail with a multiple
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5973
                match error for a renamed package that shares a common
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5974
                basename."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5975
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5976
                self.rename_matching("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5977
                self.rename_matching("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5978
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5979
        def rename_matching(self, install_cmd):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5980
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5981
                self.pkg("%s trusted" % install_cmd)
2287
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5982
                self.pkg("info system/trusted")
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  5983
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5984
        def test_require_dependencies(self):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5985
                """ exercise require dependencies """
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5986
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5987
                self.require_dependencies_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5988
                self.require_dependencies_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5989
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5990
        def require_dependencies_helper(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  5991
                self.image_create(self.rurl)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5992
                self.pkg("install [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5993
                self.pkg("verify  [email protected]")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  5994
                self.pkg("%s [email protected]" % install_cmd)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5995
                self.pkg("verify  [email protected] [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  5996
3134
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5997
        def test_exclude_group_install(self):
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5998
                """Verify that a simultaneous exclude and group dependency on
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  5999
                the same package is handled gracefully."""
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6000
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6001
                self.image_create(self.rurl)
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6002
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6003
                # These should fail (gracefully) because my-rsync packages
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6004
                # excludes network/rsync which is a group dependency of
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6005
                # gold-server package.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6006
                self.pkg("install network/rsync gold-server my-rsync", exit=1)
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6007
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6008
                self.pkg("install network/rsync")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6009
                self.pkg("install gold-server my-rsync", exit=1)
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6010
                self.pkg("uninstall '*'")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6011
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6012
                # This should succeed because network/rsync dependency is not
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6013
                # installed.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6014
                self.pkg("avoid network/rsync")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6015
                self.pkg("install -nv gold-server my-rsync")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6016
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6017
                # This will install network/rsync and remove it from the avoid
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6018
                # list.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6019
                self.pkg("install network/rsync")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6020
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6021
                # This should succeed because network/rsync will be removed and
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6022
                # placed on avoid list as part of operation.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6023
                self.pkg("install --reject network/rsync gold-server my-rsync")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6024
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6025
                # Now remove gold-server and then verify install will fail.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6026
                self.pkg("uninstall gold-server")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6027
                self.pkg("unavoid network/rsync")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6028
                # No solution as there's no installed constraining package and
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6029
                # user didn't provide sufficient input.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6030
                self.pkg("install gold-server", assert_solution=False, exit=1)
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6031
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6032
        def test_exclude_dependencies_install(self):
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6033
                """ exercise exclude dependencies """
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6034
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6035
                self.image_create(self.rurl)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6036
                # install pkg w/ exclude dep.
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6037
                self.pkg("install [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6038
                self.pkg("verify  [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6039
                # install pkg that is allowed by dep
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6040
                self.pkg("install [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6041
                self.pkg("verify  [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6042
                # try to install disallowed pkg
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6043
                self.pkg("install [email protected]", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6044
                self.pkg("uninstall '*'")
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6045
                # install pkg
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6046
                self.pkg("install [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6047
                # try to install pkg exclude dep on already
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6048
                # installed pkg
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6049
                self.pkg("install [email protected]", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6050
                self.pkg("uninstall '*'")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6051
                # install a package w/ both exclude
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6052
                # and require dependencies
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6053
                self.pkg("install pkg5")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6054
                self.pkg("verify [email protected] [email protected] ")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6055
                self.pkg("uninstall '*'")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6056
                # pick pkg to install that fits constraint
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6057
                # of already installed pkg
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6058
                self.pkg("install pkg2")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6059
                self.pkg("install pkg5")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6060
                self.pkg("verify [email protected] [email protected] pkg2")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6061
                self.pkg("uninstall '*'")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6062
                # install a package that requires updating
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6063
                # existing package to avoid exclude
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6064
                # dependency
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6065
                self.pkg("install [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6066
                self.pkg("install [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6067
                self.pkg("verify [email protected] [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6068
                self.pkg("uninstall '*'")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6069
                # try to install two incompatible pkgs
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6070
                self.pkg("install [email protected] [email protected]", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6071
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6072
        def test_exclude_dependencies_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6073
                """ exercise exclude dependencies """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6074
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6075
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6076
                # Install pkg w/ exclude dep.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6077
                self.pkg("install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6078
                self.pkg("verify  [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6079
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6080
                # Exact-install should ignore exclude dependencies,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6081
                # except user specifies both pkg name in command line.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6082
                self.pkg("exact-install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6083
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6084
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6085
                # Exact-install a package w/ both exclude
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6086
                # and require dependencies.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6087
                self.pkg("exact-install pkg5")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6088
                self.pkg("verify [email protected] [email protected] ")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6089
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6090
                # pick pkg to exact-install that fits constraint.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6091
                self.pkg("exact-install pkg2 pkg5")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6092
                self.pkg("verify [email protected] [email protected] pkg2")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6093
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6094
                # Exact- install two packages with proper version selected for
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6095
                # one package based on the version of the other package.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6096
                self.pkg("exact-install pkg6 [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6097
                self.pkg("verify [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6098
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6099
                # try to exact-install two incompatible pkgs
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6100
                self.pkg("exact-install [email protected] [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6101
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6102
        def test_optional_dependencies_install(self):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6103
                """ check to make sure that optional dependencies are enforced
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6104
                """
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6105
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6106
                self.image_create(self.rurl)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6107
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6108
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6109
                # pkg2 is optional, it should not have been installed
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6110
                self.pkg("list pkg2", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6111
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6112
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6113
1085
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  6114
                # this should install [email protected] and upgrade pkg2 to [email protected]
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6115
                self.pkg("install pkg1")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6116
                self.pkg("list [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6117
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6118
                self.pkg("uninstall pkg2")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6119
                self.pkg("list pkg2", exit=1)
1085
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  6120
                # this should not install [email protected] because of the optional
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6121
                # dependency in pkg1
1085
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  6122
                self.pkg("list [email protected]")
aa3274c0fe55 8392 backpublishing variant-aware SUNWipkg to 101 will break zones on those builds
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1068
diff changeset
  6123
                self.pkg("install [email protected]", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6124
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6125
        def test_optional_dependencies_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6126
                """ check to make sure that optional dependencies are enforced
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6127
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6128
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6129
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6130
                self.pkg("exact-install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6131
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6132
                # pkg2 is optional, it should not have been installed
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6133
                self.pkg("list pkg2", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6134
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6135
                self.pkg("install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6136
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6137
                # Verify with exact-install, the optional dependency package
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6138
                # should be removed.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6139
                self.pkg("exact-install pkg1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6140
                self.pkg("list [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6141
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6142
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6143
                # Verify exact-install [email protected] should succeed and pkg1 should
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6144
                # be removed.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6145
                self.pkg("exact-install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6146
                self.pkg("list pkg1", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6147
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6148
        def test_incorporation_dependencies_install(self):
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6149
                """ shake out incorporation dependencies """
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6150
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6151
                self.image_create(self.rurl)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6152
                # simple pkg requiring controlling incorp
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6153
                # should control pkgA_1 as well
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6154
                self.pkg("install -v [email protected] pkgA_1")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6155
                self.pkg("list")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6156
                self.pkg("verify [email protected] [email protected] [email protected]")
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6157
                self.pkg("install [email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6158
                self.pkg("list [email protected] [email protected] [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6159
                self.pkg("uninstall '*'")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6160
                # try nested incorporations
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6161
                self.pkg("install -v [email protected] pkgA_0 pkgB_0")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6162
                self.pkg("list")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6163
                self.pkg("list [email protected] [email protected] [email protected] [email protected] [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6164
                # try to break incorporation
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6165
                self.pkg("install -v [email protected]", exit=1) # fixed by [email protected]
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6166
                # try update (using '*' which also checks that the update all
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6167
                # path is used when '*' is specified)
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6168
                self.pkg("update -v '*'")
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6169
                self.pkg("list [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6170
                self.pkg("list [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6171
                self.pkg("list [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6172
                self.pkg("list [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6173
                self.pkg("list [email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6174
                self.pkg("uninstall '*'")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6175
                # what happens when incorporation specified
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6176
                # a package that isn't in the catalog
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6177
                self.pkg("install bug_7394_incorp")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6178
                self.pkg("install pkg1", exit=1)
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6179
                self.pkg("uninstall '*'")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6180
                # test pkg.depend.install-hold feature
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6181
                self.pkg("install -v [email protected]  pkgA_1")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6182
                self.pkg("list [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6183
                self.pkg("list [email protected]")
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6184
                # next attempt will fail because incorporations prevent motion
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6185
                # even though explicit dependency exists from pkg to
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6186
                # incorporation.
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6187
                self.pkg("install [email protected]", exit=1)
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6188
                # test to see if we could install both; presence of incorp
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6189
                # causes relaxation of pkg.depend.install-hold and also test
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6190
                # that parsable output works when -n is used
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6191
                self.pkg("install -n --parsable=0 [email protected] [email protected]")
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6192
                self.assertEqualParsable(self.output, change_packages=[
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6193
                    [self.incorp_pkgs[2], self.incorp_pkgs[4]],
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6194
                    [self.leaf_pkgs[9], self.leaf_pkgs[17]]])
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6195
                # this attempt also succeeds because pkg.depend.install-hold is
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  6196
                # relaxed since A_incorp is on command line
1731
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6197
                self.pkg("install [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6198
                self.pkg("list [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6199
                self.pkg("list [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6200
                # now demonstrate w/ version 1.2 subincorps that master incorp
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6201
                # prevents upgrade since pkg.depend.install-hold of master != other incorps
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6202
                self.pkg("install [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6203
                self.pkg("install [email protected]", exit=1)
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6204
                self.pkg("install [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6205
                self.pkg("list [email protected]")
a76f8a1fc049 13241 pkg install triggers system incorporation update
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1715
diff changeset
  6206
                self.pkg("list [email protected]")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6207
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6208
        def test_incorporation_dependencies_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6209
                """ shake out incorporation dependencies """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6210
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6211
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6212
                # Simple pkg requiring controlling incorp
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6213
                # should control pkgA_1 as well.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6214
                self.pkg("exact-install -v [email protected] pkgA_1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6215
                self.pkg("list")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6216
                self.pkg("verify [email protected] [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6217
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6218
                # Verify exact-install will upgrade pkgA_0 and A_incorp to 1.1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6219
                #, and uninstall pkgA_1.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6220
                self.pkg("exact-install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6221
                self.pkg("list [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6222
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6223
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6224
                # Try nested incorporations.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6225
                self.pkg("exact-install -v [email protected] pkgA_0 pkgB_0")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6226
                self.pkg("list [email protected] [email protected] [email protected] [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6227
                # Try to break incorporation.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6228
                self.pkg("exact-install -v [email protected] [email protected]", exit=1) # fixed by [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6229
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6230
                # Only specify [email protected] should succeed. install holds
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6231
                # should be ignored.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6232
                self.pkg("exact-install -v [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6233
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6234
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6235
                # what happens when incorporation specified
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6236
                # a package that isn't in the catalog.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6237
                self.pkg("exact-install pkg1 bug_7394_incorp", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6238
                # test pkg.depend.install-hold feature.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6239
                self.pkg("exact-install -v [email protected]  pkgA_1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6240
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6241
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6242
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6243
        def test_conditional_dependencies_install(self):
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6244
                """Get conditional dependencies working"""
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6245
                self.image_create(self.rurl)
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6246
                self.pkg("install [email protected]")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6247
                self.pkg("verify")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6248
                self.pkg("list [email protected]", exit=1) # should not be here
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6249
                self.pkg("install -v [email protected]")      # older version...
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6250
                self.pkg("verify")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6251
                self.pkg("list [email protected]", exit=1)
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6252
                self.pkg("install -v [email protected]")      # this triggers conditional dependency
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6253
                self.pkg("verify")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6254
                self.pkg("list [email protected] [email protected] [email protected]") # everyone is present
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6255
                self.pkg("uninstall '*'")
2144
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  6256
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6257
                self.pkg("install [email protected]")  # install trigger
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6258
                self.pkg("verify")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6259
                self.pkg("install [email protected]")  # install pkg
2144
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  6260
                self.pkg("list [email protected] [email protected] [email protected]") # all here again
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6261
                self.pkg("verify")
2468
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6262
                self.pkg("uninstall '*'")
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6263
2461
555e8b858d35 18653 conditional deps and uninstall: two great tastes that don't taste great together?
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2445
diff changeset
  6264
                # Test bug 18653
2468
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6265
                self.pkg("install [email protected] sun-solaris "
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6266
                    "perl-510 sun-solaris-510")
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6267
                # Uninstall should fail because sun-solaris conditional
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6268
                # dependency requires sun-solaris-510.
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6269
                self.pkg("uninstall sun-solaris-510", exit=1)
2461
555e8b858d35 18653 conditional deps and uninstall: two great tastes that don't taste great together?
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2445
diff changeset
  6270
                # Uninstalling both the predicate and the target of the
555e8b858d35 18653 conditional deps and uninstall: two great tastes that don't taste great together?
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2445
diff changeset
  6271
                # conditional dependency should work.
2468
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6272
                self.pkg("uninstall perl-510 sun-solaris-510")
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6273
                self.pkg("install perl-510")
2461
555e8b858d35 18653 conditional deps and uninstall: two great tastes that don't taste great together?
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2445
diff changeset
  6274
                # Check that reject also works.
2468
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6275
                self.pkg("update --reject perl-510 --reject sun-solaris-510")
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6276
                self.pkg("uninstall '*'")
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6277
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6278
                # Verify that if the predicate of a conditional can be
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6279
                # installed, but the consequent cannot, the package delivering
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6280
                # the conditional dependency can still be installed.
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6281
                self.pkg("install -v entire [email protected] "
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6282
                    "sun-solaris")
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6283
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6284
                # Verify that the package incorporating a package that delivers
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6285
                # a conditional for a consequent that cannot be installed can be
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6286
                # removed.
ce77b64883c4 18710 conditional dependencies can cause install and uninstall failure when dependency cannot be installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2461
diff changeset
  6287
                self.pkg("uninstall -v entire")
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6288
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6289
        def test_conditional_dependencies_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6290
                """Get conditional dependencies working."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6291
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6292
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6293
                # Presenting [email protected] and [email protected] in the command line should
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6294
                # trigger conditional dependency.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6295
                self.pkg("exact-install -v [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6296
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6297
                self.pkg("list [email protected] [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6298
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6299
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6300
                # If  only [email protected] present in the command line, [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6301
                # should be removed and [email protected] should not be installed.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6302
                self.pkg("install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6303
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6304
                self.pkg("exact-install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6305
                self.pkg("list [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6306
                self.pkg("list [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6307
                self.pkg("list [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6308
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6309
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6310
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6311
        def test_require_any_dependencies_install(self):
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6312
                """Get require-any dependencies working"""
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6313
                self.image_create(self.rurl)
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6314
2347
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  6315
                # test to see if solver will fail gracefully when no solution is
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  6316
                # possible and a require-any dependency is involved
3134
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6317
                self.pkg("install -vvv pkg-nosol-A pkg-nosol-E",
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6318
                    assert_solution=False, exit=1)
2347
d65d04108db1 18308 solver can traceback if no solution is found and require-any dependency was parsed
Shawn Walker <shawn.walker@oracle.com>
parents: 2339
diff changeset
  6319
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6320
                # test to see if solver will pick one
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6321
                self.pkg("install [email protected]")  # install pkg
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6322
                self.pkg("verify")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6323
                self.pkg("list [email protected] [email protected] [email protected]", exit=3)
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6324
                self.pkg("uninstall '*'")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6325
2267
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6326
                # test to see if solver will be happy w/ renamed packages,
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6327
                # already installed dependencies.
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6328
                self.pkg("install pkg:/[email protected]")
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6329
                self.pkg("install pkg_need_rename")
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6330
                self.pkg("install [email protected]")
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6331
                self.pkg("verify")
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6332
                self.pkg("list [email protected] [email protected]")
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6333
                self.pkg("uninstall '*'")
d8b8d0f7afab 18043 renamed packages in an image cause problems with require-any dependencies
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2261
diff changeset
  6334
2144
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  6335
                # test to see if solver will install new verion of existing
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6336
                # package rather than add new package
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6337
                self.pkg("install [email protected] [email protected]")  # install pkg
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6338
                self.pkg("verify")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6339
                self.pkg("list [email protected] [email protected]")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6340
                self.pkg("list [email protected]", exit=1)
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6341
                self.pkg("install pkg8 pkg9") # will fail w/o pkg9 on list
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6342
                self.pkg("verify")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6343
                self.pkg("list [email protected] [email protected]")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6344
                self.pkg("uninstall '*'")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6345
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6346
                # see if update works the same way
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6347
                self.pkg("install [email protected] [email protected]")  # install pkg
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6348
                self.pkg("image-update")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6349
                self.pkg("list [email protected] [email protected]")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6350
                self.pkg("uninstall '*'")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6351
2228
5319ee47781d 2774 new depend action behavior: follow if possible
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2224
diff changeset
  6352
                # test to see if uninstall is clever enough
5319ee47781d 2774 new depend action behavior: follow if possible
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2224
diff changeset
  6353
                self.pkg("install [email protected] [email protected]")  # install pkg
5319ee47781d 2774 new depend action behavior: follow if possible
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2224
diff changeset
  6354
                self.pkg("verify")
5319ee47781d 2774 new depend action behavior: follow if possible
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2224
diff changeset
  6355
                self.pkg("list [email protected] [email protected]")
5319ee47781d 2774 new depend action behavior: follow if possible
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2224
diff changeset
  6356
                self.pkg("uninstall [email protected]")
5319ee47781d 2774 new depend action behavior: follow if possible
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2224
diff changeset
  6357
                self.pkg("list [email protected]")
5319ee47781d 2774 new depend action behavior: follow if possible
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2224
diff changeset
  6358
                self.pkg("verify")
2287
4d6a36f6402d 18114 pkg install should resolve conflicting names automatically when one is renamed
Shawn Walker <shawn.walker@oracle.com>
parents: 2277
diff changeset
  6359
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6360
        def test_require_any_dependencies_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6361
                """Get require-any dependencies working"""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6362
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6363
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6364
                # Test to see if solver will fail gracefully when no solution is
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6365
                # possible and a require-any dependency is involved.
3134
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6366
                self.pkg("exact-install -v pkg-nosol-A pkg-nosol-E",
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  6367
                    assert_solution=False, exit=1)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6368
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6369
                # Test to see if solver will pick one.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6370
                self.pkg("exact-install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6371
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6372
                self.pkg("list [email protected] [email protected] [email protected]", exit=3)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6373
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6374
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6375
                # Test to see if solver will be happy w/ renamed packages,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6376
                # already installed dependencies.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6377
                self.pkg("exact-install pkg:/[email protected] pkg_need_rename "
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6378
                    "[email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6379
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6380
                self.pkg("list [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6381
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6382
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6383
                # test to see if solver will install new verion of existing
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6384
                # package rather than add new package
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6385
                self.pkg("exact-install [email protected] [email protected]")  # install pkg
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6386
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6387
                self.pkg("list [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6388
                self.pkg("list [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6389
                self.pkg("exact-install pkg8 pkg9")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6390
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6391
                self.pkg("list [email protected] [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6392
                self.pkg("list [email protected]", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6393
                self.pkg("uninstall '*'")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6394
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6395
        def test_origin_dependencies(self):
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6396
                """Get origin dependencies working"""
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6397
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6398
                self.origin_dependencies_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6399
                self.origin_dependencies_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6400
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6401
        def origin_dependencies_helper(self, install_cmd):
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6402
                self.set_image(0)
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6403
                self.image_create(self.rurl)
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6404
                self.set_image(1)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6405
                self.image_create(self.rurl)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6406
                self.set_image(0)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6407
                # check install or exact-install behavior
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6408
                self.pkg("%s [email protected]" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6409
                self.pkg("%s pkg10" % install_cmd)
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6410
                self.pkg("list [email protected]")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6411
                self.pkg("%s pkg10" % install_cmd)
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6412
                self.pkg("list [email protected]")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6413
                self.pkg("uninstall '*'")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6414
                # check image-update behavior
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6415
                self.pkg("install [email protected]")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6416
                self.pkg("image-update")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6417
                self.pkg("list [email protected]")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6418
                self.pkg("image-update")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6419
                self.pkg("list [email protected]")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6420
                self.pkg("uninstall '*'")
2144
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  6421
                # check that dependencies are ignored if
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6422
                # dependency not present
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6423
                self.pkg("%s [email protected]" % install_cmd)
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6424
                self.pkg("uninstall '*'")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6425
                # make sure attempts to force install don't work
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6426
                self.pkg("%s [email protected]" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6427
                self.pkg("%s [email protected]" % install_cmd, exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6428
                self.pkg("%s [email protected]" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6429
                self.pkg("%s [email protected]" % install_cmd)
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6430
                self.pkg("uninstall '*'")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6431
                # check origin root-image=true dependencies
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6432
                # relies on SUNWcs in root image; make image 1 the root image
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6433
                self.set_image(1)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6434
                self.pkg("%s [email protected]" % install_cmd)
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6435
                self.set_image(0)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6436
                live_root = self.img_path(1)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6437
                self.pkg("-D simulate_live_root=%s %s [email protected]" % \
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6438
                    (live_root, install_cmd))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6439
                self.pkg("-D simulate_live_root=%s %s [email protected]" %
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6440
                    (live_root, install_cmd), exit=1)
2084
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6441
                self.pkg("uninstall '*'")
d591b4ed5cf3 16327 New dependency types desired
Bart Smaalders <Bart.Smaalders@Oracle.COM>
parents: 2073
diff changeset
  6442
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6443
        def test_parent_dependencies(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6444
                self.parent_dependencies_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6445
                self.parent_dependencies_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6446
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6447
        def parent_dependencies_helper(self, install_cmd):
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6448
                self.set_image(0)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6449
                self.image_create(self.rurl)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6450
                self.set_image(1)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6451
                self.image_create(self.rurl)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6452
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6453
                # attach c2p 1 -> 0.
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6454
                self.pkg("attach-linked -p system:img1 %s" % self.img_path(0))
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6455
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6456
                # try to install or exact-instal packages that have unmet
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6457
                # parent dependencies.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6458
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6459
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6460
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6461
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6462
                # install or exact-install packages in parent.
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6463
                self.set_image(0)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6464
                self.pkg("install [email protected]")
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6465
                self.set_image(1)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6466
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6467
                # try to install or exact-install packages that have unmet
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6468
                # parent dependencies.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6469
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6470
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6471
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6472
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6473
                # install or exact-install packages in parent.
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6474
                self.set_image(0)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6475
                self.pkg("%s [email protected]" % install_cmd)
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6476
                self.set_image(1)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6477
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6478
                # try to install or exact-install packages that have unmet
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6479
                # parent dependencies.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6480
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6481
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6482
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6483
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6484
                # install packages in parent
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6485
                self.set_image(0)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6486
                self.pkg("update [email protected]")
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6487
                self.set_image(1)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6488
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6489
                # try to install or exact-install packages that have unmet parent dependencies.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6490
                self.pkg("%s [email protected]" % install_cmd, exit=EXIT_OOPS)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6491
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6492
                # try to install or exact-install packages that have satisfied parent deps.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6493
                self.pkg("%s [email protected]" % install_cmd)
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6494
                self.pkg("verify")
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6495
                self.pkg("uninstall [email protected]")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6496
                self.pkg("%s [email protected]" % install_cmd)
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6497
                self.pkg("verify")
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6498
                self.pkg("uninstall [email protected]")
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6499
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6500
                # install or exact-install packages in parent.
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6501
                self.set_image(0)
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6502
                if install_cmd == "install":
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6503
                        self.pkg("install [email protected]")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6504
                else:
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6505
                        self.pkg("exact-install [email protected] [email protected]")
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6506
                self.set_image(1)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6507
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6508
                # try to install or exact-install packages that have satisfied.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6509
                # parent deps.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  6510
                self.pkg("%s [email protected]" % install_cmd)
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6511
                self.pkg("verify")
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6512
                self.pkg("uninstall [email protected]")
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  6513
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6514
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  6515
class TestMultipleDepots(pkg5unittest.ManyDepotTestCase):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6516
        # Only start/stop the depot once (instead of for every test)
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  6517
        persistent_setup = True
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6518
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6519
        foo10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6520
            open [email protected],5.11-0
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6521
            close"""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6522
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6523
        bar10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6524
            open [email protected],5.11-0
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6525
            close"""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6526
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6527
        moo10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6528
            open [email protected],5.11-0
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6529
            close"""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6530
596
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6531
        quux10 = """
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6532
            open [email protected],5.11-0
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6533
            add depend type=optional [email protected]
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6534
            close"""
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6535
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6536
        baz10 = """
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6537
            open [email protected],5.11-0
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6538
            add depend type=require [email protected]
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6539
            close"""
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6540
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6541
        corge10 = """
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6542
            open [email protected],5.11-0
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6543
            close"""
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6544
596
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6545
        optional10 = """
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6546
            open [email protected],5.11-0
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6547
            close"""
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6548
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6549
        upgrade_p10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6550
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6551
            close"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6552
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6553
        upgrade_p11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6554
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6555
            close"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6556
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6557
        upgrade_np10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6558
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6559
            close"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6560
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6561
        upgrade_np11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6562
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6563
            close"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6564
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6565
        incorp_p10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6566
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6567
            add depend type=incorporate [email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6568
            close"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6569
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6570
        incorp_p11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6571
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6572
            add depend type=incorporate [email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6573
            close"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6574
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6575
        incorp_np10 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6576
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6577
            add depend type=incorporate [email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6578
            close"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6579
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6580
        incorp_np11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6581
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6582
            add depend type=incorporate [email protected]
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6583
            close"""
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6584
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6585
        def setUp(self):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6586
                """ depot 1 gets foo and moo, depot 2 gets foo and bar,
1431
62b6033670e4 10416 server catalog v1 support desired
Shawn Walker <srw@sun.com>
parents: 1423
diff changeset
  6587
                    depot 3 is empty, depot 4 gets [email protected]
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6588
                    depot 5 gets corge10, depot6 is empty
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6589
                    depot7 is a copy of test1's repository for test3
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6590
                    depot1 is mapped to publisher test1 (preferred)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6591
                    depot2 is mapped to publisher test2
1431
62b6033670e4 10416 server catalog v1 support desired
Shawn Walker <srw@sun.com>
parents: 1423
diff changeset
  6592
                    depot3 is not mapped during setUp
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6593
                    depot4 is not mapped during setUp
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6594
                    depot5 is not mapped during setUp
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6595
                    depot6 is not mapped during setUp"""
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6596
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6597
                # Two depots are intentionally started for some publishers.
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  6598
                pkg5unittest.ManyDepotTestCase.setUp(self, ["test1", "test2",
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6599
                    "test3", "test2", "test4", "test1", "test3"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6600
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6601
                self.rurl1 = self.dcs[1].get_repo_url()
2701
55bf0cb749ae 7136244 granular configuration of http_proxy option
Tim Foster <tim.s.foster@oracle.com>
parents: 2700
diff changeset
  6602
                self.durl1 = self.dcs[1].get_depot_url()
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6603
                self.pkgsend_bulk(self.rurl1, (self.foo10, self.moo10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6604
                    self.quux10, self.optional10, self.upgrade_p10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6605
                    self.upgrade_np11, self.incorp_p10, self.incorp_p11,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6606
                    self.incorp_np10, self.incorp_np11, self.baz10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6607
                    self.corge10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6608
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6609
                self.rurl2 = self.dcs[2].get_repo_url()
2701
55bf0cb749ae 7136244 granular configuration of http_proxy option
Tim Foster <tim.s.foster@oracle.com>
parents: 2700
diff changeset
  6610
                self.durl2 = self.dcs[2].get_depot_url()
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6611
                self.pkgsend_bulk(self.rurl2, (self.foo10, self.bar10,
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6612
                    self.upgrade_p11, self.upgrade_np10, self.corge10))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6613
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6614
                self.rurl3 = self.dcs[3].get_repo_url()
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6615
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6616
                self.rurl4 = self.dcs[4].get_repo_url()
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6617
                self.pkgsend_bulk(self.rurl4, self.upgrade_np11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6618
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6619
                self.rurl5 = self.dcs[5].get_repo_url()
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6620
                self.pkgsend_bulk(self.rurl5, self.corge10)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6621
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6622
                self.rurl6 = self.dcs[6].get_repo_url()
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6623
                self.rurl7 = self.dcs[7].get_repo_url()
1601
e0922fa5b56b 12817 Traceback installing a package which depends(?) on an installed package from a disabled publisher
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1564
diff changeset
  6624
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6625
                # Copy contents of test1's repo to a repo for test3.
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6626
                d1dir = self.dcs[1].get_repodir()
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6627
                d2dir = self.dcs[7].get_repodir()
2028
b2c674e6ee28 16744 repository multi-publisher on-disk format should be formalized and implemented
Shawn Walker <shawn.walker@oracle.com>
parents: 2026
diff changeset
  6628
                self.copy_repository(d1dir, d2dir, { "test1": "test3" })
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6629
                self.dcs[7].get_repo(auto_create=True).rebuild()
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6630
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6631
                # Create image and hence primary publisher
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6632
                self.image_create(self.rurl1, prefix="test1")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6633
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6634
                # Create second publisher using depot #2
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6635
                self.pkg("set-publisher -O " + self.rurl2 + " test2")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6636
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6637
        def test_01_basics(self):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6638
                self.pkg("list -a")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6639
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6640
                # Install and uninstall moo (which is unique to depot 1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6641
                self.pkg("install moo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6642
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6643
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6644
                self.pkg("uninstall moo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6645
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6646
                # Install and uninstall bar (which is unique to depot 2)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6647
                self.pkg("install bar")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6648
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6649
                self.pkg("list")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6650
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6651
                self.pkg("uninstall bar")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6652
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6653
                # Install and uninstall foo (which is in both depots)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6654
                # In this case, we should select foo from depot 1, since
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6655
                # it is preferred.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6656
                self.pkg("install foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6657
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6658
                self.pkg("list pkg://test1/foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6659
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6660
                self.pkg("uninstall foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6661
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6662
        def test_02_basics(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6663
                """ Test install from an explicit preferred publisher """
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6664
                self.pkg("install pkg://test1/foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6665
                self.pkg("list foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6666
                self.pkg("list pkg://test1/foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6667
                self.pkg("uninstall foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6668
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6669
        def test_03_basics(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6670
                """ Test install from an explicit non-preferred publisher """
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6671
                self.pkg("install pkg://test2/foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6672
                self.pkg("list foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6673
                self.pkg("list pkg://test2/foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6674
                self.pkg("uninstall foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6675
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6676
        def test_04_upgrade_preferred_to_non_preferred(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6677
                """Install a package from the preferred publisher, and then
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6678
                upgrade it, failing to implicitly switching to a non-preferred
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6679
                publisher and then managing it explicitly"""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6680
                self.pkg("list -a upgrade-p")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6681
                self.pkg("install [email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6682
                self.pkg("install [email protected]", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6683
                self.pkg("install pkg://test2/[email protected]")
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  6684
                self.pkg("uninstall upgrade-p")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6685
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6686
        def test_05_upgrade_non_preferred_to_preferred(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6687
                """Install a package from a non-preferred publisher, and then
2164
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  6688
                try to upgrade it, failing to implicitly switch to the preferred
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6689
                publisher and then succeed doing it explicitly."""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6690
                self.pkg("list -a upgrade-np")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6691
                self.pkg("install [email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6692
                self.pkg("install [email protected]", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6693
                self.pkg("install pkg://test1/[email protected]")
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  6694
                self.pkg("uninstall upgrade-np")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6695
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6696
        def test_06_upgrade_preferred_to_non_preferred_incorporated(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6697
                """Install a package from the preferred publisher, and then
2164
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  6698
                upgrade it, failing to implicitly switch to a non-preferred
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6699
                publisher, when the package is constrained by an
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6700
                incorporation, and then succeed when doing so explicitly"""
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6701
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6702
                self.pkg("list -a upgrade-p incorp-p")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6703
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6704
                self.pkg("install upgrade-p")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6705
                self.pkg("install [email protected]", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6706
                self.pkg("install [email protected] pkg://test2/[email protected]")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6707
                self.pkg("list [email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6708
                self.pkg("uninstall '*'")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6709
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6710
        def test_07_upgrade_non_preferred_to_preferred_incorporated(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6711
                """Install a package from the preferred publisher, and then
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6712
                upgrade it, implicitly switching to a non-preferred
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6713
                publisher, when the package is constrained by an
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6714
                incorporation."""
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6715
                self.pkg("list", exit=1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6716
                self.pkg("list -a upgrade-np incorp-np")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6717
                self.pkg("install [email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6718
                self.pkg("install upgrade-np", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6719
                self.pkg("uninstall '*'")
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6720
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6721
        def test_08_install_repository_access(self):
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6722
                """Verify that packages can still be installed from a repository
1538
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6723
                even when any of the other repositories are not reachable and
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6724
                --no-refresh is used."""
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6725
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6726
                # Change the second publisher to point to an unreachable URI.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6727
                self.pkg("set-publisher --no-refresh -O http://test.invalid7 "
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6728
                    "test2")
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6729
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6730
                # Verify that no packages are installed.
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6731
                self.pkg("list", exit=1)
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6732
1538
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6733
                # Verify moo can not be installed (as only depot1 has it) since
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  6734
                # test2 cannot be reached (and needs a refresh).
1538
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6735
                self.pkg("install moo", exit=1)
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6736
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6737
                # Verify moo can be installed (as only depot1 has it) even
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6738
                # though test2 cannot be reached (and needs a refresh) if
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6739
                # --no-refresh is used.
1538
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6740
                self.pkg("install --no-refresh moo")
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6741
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6742
                self.pkg("uninstall moo")
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6743
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6744
                # Reset the test2 publisher.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6745
                self.pkg("set-publisher -O %s test2" % self.rurl2)
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6746
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6747
                # Install v1.0 of upgrade-np from test2 to prepare for
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6748
                # update.
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6749
                self.pkg("install [email protected]")
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6750
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6751
                # Set test1 to point to an unreachable URI.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6752
                self.pkg("set-publisher --no-refresh -O http://test.invalid7 "
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6753
                    "test1")
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6754
1431
62b6033670e4 10416 server catalog v1 support desired
Shawn Walker <srw@sun.com>
parents: 1423
diff changeset
  6755
                # Set test2 so that upgrade-np has a new version available
62b6033670e4 10416 server catalog v1 support desired
Shawn Walker <srw@sun.com>
parents: 1423
diff changeset
  6756
                # even though test1's repository is not accessible.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6757
                self.pkg("set-publisher -O %s test2" % self.rurl4)
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6758
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6759
                # Verify update does not work since test1 is unreachable
1538
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6760
                # even though [email protected] is available from test2.
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6761
                self.pkg("update", exit=1)
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6762
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6763
                # Verify update works even though test1 is unreachable
1538
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6764
                # since [email protected] is available from test2 if --no-refresh
78ac66abc186 12130 install/update operations should always refresh publisher metadata (when allowed)
Shawn Walker <srw@sun.com>
parents: 1505
diff changeset
  6765
                # is used.
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6766
                self.pkg("update --no-refresh")
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6767
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6768
                # Now reset everything for the next test.
655
6eef82185057 2325 optional dependency enforcement can't handle fmris disappearing from the catalog
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 633
diff changeset
  6769
                self.pkg("uninstall upgrade-np")
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6770
                self.pkg("set-publisher --no-refresh -O %s test1" % self.rurl1)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6771
                self.pkg("set-publisher -O %s test2" % self.rurl2)
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6772
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6773
        def test_09_uninstall_from_wrong_publisher(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6774
                """Install a package from a publisher and try to remove it
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6775
                using a different publisher name; this should fail."""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6776
                self.pkg("install foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6777
                self.pkg("uninstall pkg://test2/foo", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6778
                # Check to make sure that uninstalling using the explicit
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6779
                # publisher works
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6780
                self.pkg("uninstall pkg://test1/foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6781
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6782
        def test_10_install_after_publisher_removal(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6783
                """Install a package from a publisher that has an optional
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6784
                dependency; then change the preferred publisher and remove the
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6785
                original publisher and then verify that installing the package
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6786
                again succeeds since it is essentially a no-op."""
596
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6787
                self.pkg("install [email protected]")
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6788
                self.pkg("set-publisher -P test2")
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6789
                self.pkg("unset-publisher test1")
1786
14c232a5a4a0 14788 sometimes upgrade from osol 133 to onips 133 (with renames) doesn't work
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1784
diff changeset
  6790
                self.pkg("list -avf")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6791
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6792
                # Attempting to install an already installed package should
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6793
                # be a no-op even if the corresponding publisher no longer
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6794
                # exists.
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6795
                self.pkg("install [email protected]", exit=4)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6796
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6797
                # Update should work if we don't see the optional
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6798
                # dependency.
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6799
                self.pkg("update", exit=4)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6800
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6801
                # Add back the installed package's publisher, but using a
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6802
                # a repository with an empty catalog.  After that, attempt to
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6803
                # install the package again, which should succeed even though
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6804
                # the fmri is no longer in the publisher's catalog.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6805
                self.pkg("set-publisher -O %s test1" % self.rurl6)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6806
                self.pkg("install [email protected]", exit=4)
1431
62b6033670e4 10416 server catalog v1 support desired
Shawn Walker <srw@sun.com>
parents: 1423
diff changeset
  6807
                self.pkg("info [email protected]")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6808
                self.pkg("unset-publisher test1")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6809
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6810
                # Add a new publisher, with the same packages as the installed
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6811
                # publisher.  Then, add back the installed package's publisher,
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6812
                # but using an empty repository.  After that, attempt to install
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6813
                # the package again, which should succeed since at least one
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6814
                # publisher has the package in its catalog.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6815
                self.pkg("set-publisher -O %s test3" % self.rurl7)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6816
                self.pkg("set-publisher -O %s test1" % self.rurl6)
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6817
                self.pkg("info -r pkg://test3/[email protected]")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6818
                self.pkg("install [email protected]", exit=4)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6819
                self.pkg("unset-publisher test1")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6820
                self.pkg("unset-publisher test3")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6821
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6822
                self.pkg("set-publisher -O %s test1" % self.rurl1)
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6823
                self.pkg("info -r pkg://test1/[email protected]")
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6824
                self.pkg("unset-publisher test1")
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6825
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6826
                # Add a new publisher, using the installed package publisher's
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6827
                # repository.  After that, attempt to install the package again,
2038
4093d448f54f 16785 install planning can fail if a different, higher-ranked publisher offers only older versions of installed package
Shawn Walker <shawn.walker@oracle.com>
parents: 2034
diff changeset
  6828
                # which should simply result in a 'no updates necessary' exit
4093d448f54f 16785 install planning can fail if a different, higher-ranked publisher offers only older versions of installed package
Shawn Walker <shawn.walker@oracle.com>
parents: 2034
diff changeset
  6829
                # code since the removed publisher's package is already the
4093d448f54f 16785 install planning can fail if a different, higher-ranked publisher offers only older versions of installed package
Shawn Walker <shawn.walker@oracle.com>
parents: 2034
diff changeset
  6830
                # newest version available.
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  6831
                #
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6832
                self.pkg("set-publisher -O %s test3" % self.rurl7)
2038
4093d448f54f 16785 install planning can fail if a different, higher-ranked publisher offers only older versions of installed package
Shawn Walker <shawn.walker@oracle.com>
parents: 2034
diff changeset
  6833
                self.pkg("install [email protected]", exit=4)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6834
                self.pkg("unset-publisher test3")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6835
596
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6836
                # Change the image metadata back to where it was, in preparation
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6837
                # for subsequent tests.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6838
                self.pkg("set-publisher -O %s -P test1" % self.rurl1)
596
f4519e2a99bc 3704 InventoryException raised if optional dependencies not in catalog
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 595
diff changeset
  6839
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6840
                # Remove the installed packages.
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6841
                self.pkg("uninstall quux")
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6842
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6843
        def test_11_uninstall_after_preferred_publisher_change(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6844
                """Install a package from the preferred publisher, change the
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6845
                preferred publisher, and attempt to remove the package."""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6846
                self.pkg("install [email protected]")
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6847
                self.pkg("set-publisher -P test2")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6848
                self.pkg("uninstall foo")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6849
                # Change the image metadata back to where it was, in preparation
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6850
                # for the next test.
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6851
                self.pkg("set-publisher -P test1")
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6852
1102
5ea5cdb4360d 5014 api sets successful result for image-create with failed catalog refresh
Shawn Walker <srw@sun.com>
parents: 1085
diff changeset
  6853
        def test_12_uninstall_after_publisher_removal(self):
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6854
                """Install a package from the preferred publisher, remove the
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6855
                preferred publisher, and then evaluate whether an uninstall
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6856
                would succeed regardless of whether its publisher still exists
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6857
                or another publisher has the same fmri in its catalog."""
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6858
                self.pkg("install [email protected]")
926
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6859
                self.pkg("set-publisher -P test2")
6ee411c9026a 5871 publisher apis desired
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 922
diff changeset
  6860
                self.pkg("unset-publisher test1")
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6861
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6862
                # Attempting to uninstall should work even if the corresponding
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6863
                # publisher no longer exists.
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6864
                self.pkg("uninstall -nv foo")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6865
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6866
                # Add back the installed package's publisher, but using a
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6867
                # a repository with an empty catalog.  After that, attempt to
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6868
                # uninstall the package again, which should succeed even though
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6869
                # the fmri is no longer in the publisher's catalog.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6870
                self.pkg("set-publisher -O %s test1" % self.rurl6)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6871
                self.pkg("uninstall -nv foo")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6872
                self.pkg("unset-publisher test1")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6873
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6874
                # Add a new publisher, with a repository with the same packages
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6875
                # as the installed publisher.  Then, add back the installed
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6876
                # package's publisher using an empty repository.  After that,
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6877
                # attempt to uninstall the package again, which should succeed
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6878
                # even though the package's installed publisher is known, but
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6879
                # doesn't have the package's fmri in its catalog, but the
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6880
                # package's fmri is in a different publisher's catalog.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6881
                self.pkg("set-publisher -O %s test3" % self.rurl7)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6882
                self.pkg("set-publisher -O %s test1" % self.rurl6)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6883
                self.pkg("uninstall -nv foo")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6884
                self.pkg("unset-publisher test1")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6885
                self.pkg("unset-publisher test3")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6886
1736
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6887
                # Add a new publisher, with a repository with the same packages
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6888
                # as the installed publisher.  After that, attempt to uninstall
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6889
                # the package again, which should succeed even though the fmri
727dda1e7968 11522 pkg should require publisher prefix to match repository information
Shawn Walker <srw@sun.com>
parents: 1731
diff changeset
  6890
                # is only in a different publisher's catalog.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6891
                self.pkg("set-publisher -O %s test3" % self.rurl7)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6892
                self.pkg("uninstall -nv foo")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6893
                self.pkg("unset-publisher test3")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6894
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6895
                # Finally, actually remove the package.
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6896
                self.pkg("uninstall -v foo")
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6897
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6898
                # Change the image metadata back to where it was, in preparation
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  6899
                # for subsequent tests.
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6900
                self.pkg("set-publisher -O %s -P test1" % self.rurl1)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  6901
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6902
        def test_13_non_preferred_multimatch(self):
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6903
                """Verify that when multiple non-preferred publishers offer the
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6904
                same package that the expected install behaviour occurs."""
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6905
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  6906
                self.pkg("set-publisher -P -O %s test3" % self.rurl3)
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6907
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6908
                # make sure we look here first; tests rely on that
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6909
                self.pkg("set-publisher --search-before=test2 test1")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6910
                self.pkg("publisher")
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6911
                # First, verify that installing a package from a non-preferred
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6912
                # publisher will cause its dependencies to be installed from the
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6913
                # same publisher if the preferred publisher does not offer them.
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6914
                self.pkg("list -a")
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6915
                self.pkg("install pkg://test1/baz")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6916
                self.pkg("list")
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6917
                self.pkg("info baz | grep test1")
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6918
                self.pkg("info corge | grep test1")
2382
b91a97e46434 18413 recursive uninstall functionality should be removed
Shawn Walker <shawn.walker@oracle.com>
parents: 2347
diff changeset
  6919
                self.pkg("uninstall baz corge")
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6920
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6921
                # Next, verify that naming the specific publishers for a package
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6922
                # and all of its dependencies will install the package from the
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6923
                # specified sources instead of the same publisher the package is a
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6924
                # dependency of.
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6925
                self.pkg("install pkg://test1/baz pkg://test2/corge")
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6926
                self.pkg("info baz | grep test1")
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6927
                self.pkg("info corge | grep test2")
2382
b91a97e46434 18413 recursive uninstall functionality should be removed
Shawn Walker <shawn.walker@oracle.com>
parents: 2347
diff changeset
  6928
                self.pkg("uninstall baz corge")
1158
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6929
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6930
                # Finally, cleanup for the next test.
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6931
                self.pkg("set-publisher -P test1")
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6932
                self.pkg("unset-publisher test3")
78582c4403a9 8616 operations should use same publisher when only non-preferred has package
Shawn Walker <srw@sun.com>
parents: 1102
diff changeset
  6933
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6934
        def test_14_nonsticky_publisher(self):
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6935
                """Test various aspects of the stick/non-sticky
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6936
                behavior of publishers"""
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6937
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6938
                # For ease of debugging
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6939
                self.pkg("list -a")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6940
                # install from non-preferred repo explicitly
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6941
                self.pkg("install pkg://test2/[email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6942
                # Demonstrate that perferred publisher is not
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6943
                # acceptable, since test2 is sticky by default
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6944
                self.pkg("install [email protected]", exit=1) # not right repo
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6945
                # Check that we can proceed once test2 is not sticky
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6946
                self.pkg("set-publisher --non-sticky test2")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6947
                self.pkg("install [email protected]") # should work now
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6948
                # Restore to pristine
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6949
                self.pkg("set-publisher --sticky test2")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6950
                self.pkg("uninstall upgrade-np")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6951
                # Repeat the test w/ preferred
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6952
                self.pkg("install upgrade-p")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6953
                self.pkg("set-publisher -P test2")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6954
                self.pkg("install [email protected]", exit=1) #orig pub is sticky
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6955
                self.pkg("set-publisher --non-sticky test1")  #not anymore
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6956
                self.pkg("install [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6957
                self.pkg("set-publisher -P --sticky test1") # restore
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6958
                self.pkg("uninstall '*'")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6959
                # Check  that search order can be overridden w/ explicit
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6960
                # version specification...
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6961
                self.pkg("install upgrade-p")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6962
                self.pkg("install [email protected]", exit=1)
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6963
                self.pkg("set-publisher --non-sticky test1")
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6964
                self.pkg("install [email protected]") # find match later on
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6965
                self.pkg("set-publisher --sticky test1")
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6966
                self.pkg("uninstall '*'")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6967
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6968
        def test_15_nonsticky_update(self):
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6969
                """Test to make sure update follows the same
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6970
                publisher selection mechanisms as pkg install"""
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6971
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6972
                # try update
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6973
                self.pkg("install pkg://test2/[email protected]")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6974
                self.pkg("update", exit=4)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6975
                self.pkg("list [email protected]")
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6976
                self.pkg("set-publisher --non-sticky test2")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6977
                self.pkg("publisher")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6978
                self.pkg("list -a upgrade-np")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  6979
                self.pkg("update '*@*'")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6980
                self.pkg("list [email protected]")
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6981
                self.pkg("set-publisher --sticky test2")
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6982
                self.pkg("uninstall '*'")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6983
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6984
        def test_16_disabled_nonsticky(self):
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6985
                """Test to make sure disabled publishers are
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  6986
                automatically made non-sticky, and after
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6987
                being enabled keep their previous value
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6988
                of stickiness"""
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6989
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6990
                # For ease of debugging
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6991
                self.pkg("list -a")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6992
                # install from non-preferred repo explicitly
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6993
                self.pkg("install pkg://test2/[email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6994
                # Demonstrate that perferred publisher is not
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6995
                # acceptable, since test2 is sticky by default
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6996
                self.pkg("install [email protected]", exit=1) # not right repo
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6997
                # Disable test2 and then we should be able to proceed
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6998
                self.pkg("set-publisher --disable test2")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  6999
                self.pkg("install [email protected]")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7000
                self.pkg("publisher")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7001
                self.pkg("set-publisher --enable test2")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7002
                self.pkg("publisher")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7003
                self.pkg("publisher | egrep sticky", exit=1 )
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  7004
1601
e0922fa5b56b 12817 Traceback installing a package which depends(?) on an installed package from a disabled publisher
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1564
diff changeset
  7005
        def test_17_dependency_is_from_deleted_publisher(self):
2164
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7006
                """Verify that packages installed from a publisher that has
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7007
                been removed can still satisfy dependencies."""
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7008
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7009
                self.pkg("set-publisher -O %s test4" % self.rurl5)
1601
e0922fa5b56b 12817 Traceback installing a package which depends(?) on an installed package from a disabled publisher
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1564
diff changeset
  7010
                self.pkg("install pkg://test4/corge")
e0922fa5b56b 12817 Traceback installing a package which depends(?) on an installed package from a disabled publisher
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1564
diff changeset
  7011
                self.pkg("set-publisher --disable test2")
e0922fa5b56b 12817 Traceback installing a package which depends(?) on an installed package from a disabled publisher
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1564
diff changeset
  7012
                self.pkg("set-publisher --disable test4")
e0922fa5b56b 12817 Traceback installing a package which depends(?) on an installed package from a disabled publisher
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1564
diff changeset
  7013
                self.pkg("list -af")
e0922fa5b56b 12817 Traceback installing a package which depends(?) on an installed package from a disabled publisher
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1564
diff changeset
  7014
                self.pkg("publisher")
1786
14c232a5a4a0 14788 sometimes upgrade from osol 133 to onips 133 (with renames) doesn't work
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1784
diff changeset
  7015
                # this should work, since dependency is already installed
14c232a5a4a0 14788 sometimes upgrade from osol 133 to onips 133 (with renames) doesn't work
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1784
diff changeset
  7016
                # even though it is from a disabled publisher
14c232a5a4a0 14788 sometimes upgrade from osol 133 to onips 133 (with renames) doesn't work
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1784
diff changeset
  7017
                self.pkg("install [email protected]")
1755
8e1ed1373f93 9123 client traceback during install for bad file mode
Shawn Walker <srw@sun.com>
parents: 1739
diff changeset
  7018
2164
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7019
        def test_18_upgrade_across_publishers(self):
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7020
                """Verify that an install/update of specific packages when
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7021
                there is a newer package version available works as expected.
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7022
                """
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7023
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7024
                # Ensure a new image is created.
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7025
                self.image_create(self.rurl1, prefix="test1", destroy=True)
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7026
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7027
                # Add second publisher using repository #2.
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7028
                self.pkg("set-publisher -O " + self.rurl2 + " test2")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7029
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7030
                # Install older version of package from test1.
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7031
                self.pkg("install pkg://test1/[email protected]")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7032
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7033
                # Verify update of all packages results in nothing to do even
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7034
                # after test2 is set as preferred.
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7035
                self.pkg("set-publisher -P test2")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7036
                self.pkg("update -v", exit=4)
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7037
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7038
                # Verify setting test1 as non-sticky would result in update.
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7039
                self.pkg("set-publisher --non-sticky test1")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7040
                self.pkg("update -n")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7041
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7042
                # Verify update of 'upgrade-p' package will result in upgrade
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7043
                # from 1.0 -> 1.1.
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7044
                self.pkg("update upgrade-p")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7045
                self.pkg("info pkg://test2/[email protected]")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7046
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7047
                # Revert to 1.0 and verify install behaves the same.
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7048
                self.pkg("update pkg://test1/[email protected]")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7049
                self.pkg("install upgrade-p")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7050
                self.pkg("info pkg://test2/[email protected]")
a84726bfb9fc 17489 pkg install/update ignores package versions from publishers other than installed if installed publisher allowed by pattern
Shawn Walker <shawn.walker@oracle.com>
parents: 2158
diff changeset
  7051
2700
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7052
        def test_19_refresh_failure(self):
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  7053
                """Test that pkg client returns with exit code 1 when only one
2700
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7054
                publisher is specified and it's not reachable (bug 7176158)."""
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7055
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7056
                # Create private image for this test.
2944
37303fe0ae2b 17035644 pkg user action for fixed password
Nishchaya Bahuguna <nishchaya.bahuguna@oracle.com>
parents: 2938
diff changeset
  7057
                self.image_create(self.rurl1, prefix="test1")
2700
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7058
                # Set origin to an invalid repo.
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7059
                self.pkg("set-publisher --no-refresh -O http://test.invalid7 "
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7060
                    "test1")
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7061
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7062
                # Check if install -n returns with exit code 1
d1876b136396 7178155 proxy example in pkg gate needs update
Erik Trauschke <Erik.Trauschke@oracle.com>
parents: 2687
diff changeset
  7063
                self.pkg("install -n moo", exit=1)
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7064
2701
55bf0cb749ae 7136244 granular configuration of http_proxy option
Tim Foster <tim.s.foster@oracle.com>
parents: 2700
diff changeset
  7065
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7066
class TestImageCreateCorruptImage(pkg5unittest.SingleDepotTestCaseCorruptImage):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7067
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7068
        If a new essential directory is added to the format of an image it will
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7069
        be necessary to update this test suite. To update this test suite,
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7070
        decide in what ways it is necessary to corrupt the image (removing the
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7071
        new directory or file, or removing the some or all of contents of the
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7072
        new directory for example). Make the necessary changes in
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7073
        pkg5unittest.SingleDepotTestCaseCorruptImage to allow the needed
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7074
        corruptions, then add new tests to the suite below. Be sure to add
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7075
        tests for both Full and User images, and perhaps Partial images if
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7076
        situations are found where these behave differently than Full or User
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7077
        images.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7078
        """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7079
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7080
        # Only start/stop the depot once (instead of for every test)
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7081
        persistent_setup = True
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7082
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7083
        foo11 = """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7084
            open [email protected],5.11-0
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7085
            add dir mode=0755 owner=root group=bin path=/lib
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7086
            add file tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7087
            close """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7088
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7089
        misc_files = [ "tmp/libc.so.1" ]
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7090
1968
c0540b1e4f7e 8722 advanced repository metadata store needed
Shawn Walker <shawn.walker@oracle.com>
parents: 1956
diff changeset
  7091
        PREFIX = "unset PKG_IMAGE; cd %s;"
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  7092
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7093
        def setUp(self):
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7094
                pkg5unittest.SingleDepotTestCaseCorruptImage.setUp(self)
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7095
                self.make_misc_files(self.misc_files)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7096
2158
5a688b5b92a3 15864 inferring image location from current working directory can be harmful
Shawn Walker <shawn.walker@oracle.com>
parents: 2151
diff changeset
  7097
        def pkg(self, command, exit=0, comment="", use_img_root=True):
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7098
                pkg5unittest.SingleDepotTestCaseCorruptImage.pkg(self, command,
2158
5a688b5b92a3 15864 inferring image location from current working directory can be harmful
Shawn Walker <shawn.walker@oracle.com>
parents: 2151
diff changeset
  7099
                    exit=exit, comment=comment, prefix=self.PREFIX % self.dir,
5a688b5b92a3 15864 inferring image location from current working directory can be harmful
Shawn Walker <shawn.walker@oracle.com>
parents: 2151
diff changeset
  7100
                    use_img_root=use_img_root)
988
a851ba83a5aa 6654 pkg list state incorrect after publisher removal when another publisher has it
Shawn Walker <Shawn.Walker@Sun.COM>
parents: 941
diff changeset
  7101
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7102
        # For each test:
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7103
        # A good image is created at $basedir/image
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7104
        # A corrupted image is created at $basedir/image/bad (called bad_dir
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7105
        #     in subsequent notes) in verious ways
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7106
        # The $basedir/image/bad/final directory is created and PKG_IMAGE
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7107
        #     is set to that dirctory.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7108
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7109
        # Tests simulating a corrupted Full Image
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7110
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7111
        def test_empty_var_pkg(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7112
                """ Creates an empty bad_dir. """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7113
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7114
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7115
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7116
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7117
                self.dir = self.corrupt_image_create(self.rurl,
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7118
                    set(["publisher", "cfg_cache", "file", "pkg", "index"]),
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7119
                    ["var/pkg"])
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7120
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7121
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7122
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7123
        def test_var_pkg_missing_publisher(self):
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7124
                """ Creates bad_dir with only the publisher and known/state
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7125
                dir missing. """
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7126
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7127
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7128
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7129
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7130
                self.dir = self.corrupt_image_create(self.rurl,
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7131
                    set(["publisher_absent", "known_absent"]),
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7132
                    ["var/pkg"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7133
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7134
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7135
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7136
        def test_var_pkg_missing_cfg_cache(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7137
                """ Creates bad_dir with only the cfg_cache file missing. """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7138
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7139
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7140
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7141
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7142
                self.dir = self.corrupt_image_create(self.rurl,
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7143
                    set(["cfg_cache_absent"]), ["var/pkg"])
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7144
2158
5a688b5b92a3 15864 inferring image location from current working directory can be harmful
Shawn Walker <shawn.walker@oracle.com>
parents: 2151
diff changeset
  7145
                self.pkg("-D simulate_live_root=%s install [email protected]" %
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  7146
                    self.backup_img_path(), use_img_root=False)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7147
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7148
        def test_var_pkg_missing_index(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7149
                """ Creates bad_dir with only the index dir missing. """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7150
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7151
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7152
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7153
2144
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  7154
                self.dir = self.corrupt_image_create(self.rurl, set(
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  7155
                    ["index_absent"]), ["var/pkg"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7156
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7157
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7158
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7159
        def test_var_pkg_missing_publisher_empty(self):
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7160
                """ Creates bad_dir with all dirs and files present, but
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7161
                with an empty publisher and state/known dir.
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7162
                """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7163
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7164
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7165
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7166
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7167
                self.dir = self.corrupt_image_create(self.rurl,
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7168
                    set(["publisher_empty", "known_empty"]), ["var/pkg"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7169
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7170
                # This is expected to fail because it will see an empty
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7171
                # publisher directory and not rebuild the files as needed
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7172
                self.pkg("install --no-refresh [email protected]", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7173
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7174
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7175
        def test_var_pkg_missing_publisher_empty_hit_then_refreshed_then_hit(
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7176
            self):
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7177
                """ Creates bad_dir with all dirs and files present, but with an
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7178
                with an empty publisher and state/known dir. This is to ensure
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7179
                that refresh will work, and that an install after the refresh
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7180
                also works.
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7181
                """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7182
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7183
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7184
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7185
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7186
                self.dir = self.corrupt_image_create(self.rurl,
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7187
                    set(["publisher_empty", "known_empty"]), ["var/pkg"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7188
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7189
                self.pkg("install --no-refresh [email protected]", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7190
                self.pkg("refresh")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7191
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7192
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7193
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7194
        def test_var_pkg_left_alone(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7195
                """ Sanity check to ensure that the code for creating
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7196
                a bad_dir creates a good copy other than what's specified
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7197
                to be wrong. """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7198
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7199
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7200
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7201
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7202
                self.dir = self.corrupt_image_create(self.rurl, set(), ["var/pkg"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7203
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7204
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7205
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7206
        # Tests simulating a corrupted User Image
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7207
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7208
        # These tests are duplicates of those above but instead of creating
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7209
        # a corrupt full image, they create a corrupt User image.
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7210
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7211
        def test_empty_ospkg(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7212
                """ Creates a corrupted image at bad_dir by creating empty
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7213
                bad_dir.  """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7214
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7215
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7216
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7217
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7218
                self.dir = self.corrupt_image_create(self.rurl,
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7219
                    set(["publisher", "cfg_cache", "file", "pkg", "index"]),
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7220
                    [".org.opensolaris,pkg"])
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7221
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7222
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7223
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7224
        def test_ospkg_missing_publisher(self):
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7225
                """ Creates a corrupted image at bad_dir by creating bad_dir
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7226
                with only the publisher and known/state dir missing. """
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7227
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7228
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7229
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7230
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7231
                self.dir = self.corrupt_image_create(self.rurl,
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7232
                    set(["publisher_absent", "known_absent"]),
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7233
                        [".org.opensolaris,pkg"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7234
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7235
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7236
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7237
        def test_ospkg_missing_cfg_cache(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7238
                """ Creates a corrupted image at bad_dir by creating
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7239
                bad_dir with only the cfg_cache file missing.  """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7240
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7241
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7242
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7243
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7244
                self.dir = self.corrupt_image_create(self.rurl,
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7245
                    set(["cfg_cache_absent"]), [".org.opensolaris,pkg"])
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7246
2158
5a688b5b92a3 15864 inferring image location from current working directory can be harmful
Shawn Walker <shawn.walker@oracle.com>
parents: 2151
diff changeset
  7247
                self.pkg("-D simulate_live_root=%s install [email protected]" %
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  7248
                    self.backup_img_path(), use_img_root=False)
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7249
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7250
        def test_ospkg_missing_index(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7251
                """ Creates a corrupted image at bad_dir by creating
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7252
                bad_dir with only the index dir missing. """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7253
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7254
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7255
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7256
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7257
                self.dir = self.corrupt_image_create(self.rurl, set(["index_absent"]),
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7258
                    [".org.opensolaris,pkg"])
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7259
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7260
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7261
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7262
        def test_ospkg_missing_publisher_empty(self):
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7263
                """ Creates a corrupted image at bad_dir by creating bad_dir
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7264
                with all dirs and files present, but with an empty publisher
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7265
                and known/state dir. """
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7266
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7267
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7268
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7269
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7270
                self.dir = self.corrupt_image_create(self.rurl,
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7271
                    set(["publisher_empty", "known_empty"]),
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7272
                    [".org.opensolaris,pkg"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7273
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7274
                self.pkg("install --no-refresh [email protected]", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7275
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7276
        def test_ospkg_missing_publisher_empty_hit_then_refreshed_then_hit(self):
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7277
                """ Creates bad_dir with all dirs and files present, but with
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7278
                an empty publisher and known/state dir. This is to ensure that
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7279
                refresh will work, and that an install after the refresh also
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7280
                works.
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7281
                """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7282
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7283
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7284
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7285
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7286
                self.dir = self.corrupt_image_create(self.rurl,
1352
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7287
                    set(["publisher_empty", "known_empty"]),
5c92c9d342ef 11065 client v1 catalog support for v0 catalogs
Shawn Walker <srw@sun.com>
parents: 1340
diff changeset
  7288
                    [".org.opensolaris,pkg"])
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7289
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7290
                self.pkg("install --no-refresh [email protected]", exit=1)
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7291
                self.pkg("refresh")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7292
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7293
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7294
        def test_ospkg_left_alone(self):
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7295
                """ Sanity check to ensure that the code for creating
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7296
                a bad_dir creates a good copy other than what's specified
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7297
                to be wrong. """
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7298
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7299
                self.pkgsend_bulk(self.rurl, self.foo11)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7300
                self.image_create(self.rurl)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7301
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7302
                self.dir = self.corrupt_image_create(self.rurl, set(),
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7303
                    [".org.opensolaris,pkg"])
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7304
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7305
                self.pkg("install [email protected]")
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7306
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
  7307
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7308
class TestPkgInstallObsolete(pkg5unittest.SingleDepotTestCase):
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7309
        """Test cases for obsolete packages."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7310
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  7311
        persistent_setup = True
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7312
        def test_basic_install(self):
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7313
                foo1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7314
                    open foo@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7315
                    add dir path=usr mode=0755 owner=root group=root
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7316
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7317
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7318
                # Obsolete packages can have metadata
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7319
                foo2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7320
                    open foo@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7321
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7322
                    add set name=pkg.summary value="A test package"
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7323
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7324
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7325
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7326
                fbar = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7327
                    open fbar@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7328
                    add depend type=require fmri=foo@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7329
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7330
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7331
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7332
                qbar = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7333
                    open qbar@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7334
                    add depend type=require fmri=qux@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7335
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7336
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7337
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7338
                qux1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7339
                    open qux@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7340
                    add dir path=usr mode=0755 owner=root group=root
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7341
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7342
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7343
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7344
                qux2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7345
                    open qux@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7346
                    add set name=pkg.renamed value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7347
                    add depend type=require fmri=foo@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7348
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7349
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7350
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7351
                fred1 = """
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7352
                    open fred@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7353
                    add depend type=require fmri=foo
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7354
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7355
                """
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7356
                fred2 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7357
                    open fred@2
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7358
                    close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7359
                """
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7360
2144
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  7361
                self.pkgsend_bulk(self.rurl, (foo1, foo2, fbar, qbar, qux1,
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  7362
                    qux2, fred1))
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7363
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7364
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7365
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7366
                # First install the non-obsolete version of foo
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7367
                self.pkg("install foo@1")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7368
                self.pkg("list foo@1")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7369
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7370
                # Now install the obsolete version, and ensure it disappears (5)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7371
                self.pkg("install foo")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7372
                self.pkg("list foo", exit=1)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7373
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7374
                # Explicitly installing an obsolete package succeeds, but
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7375
                # results in nothing on the system. (1)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7376
                self.pkg("install foo@2", exit=4)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7377
                self.pkg("list foo", exit=1)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7378
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7379
                # Installing a package with a dependency on an obsolete package
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7380
                # fails. (2)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7381
                self.pkg("install fbar", exit=1)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7382
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7383
                # Installing a package with a dependency on a renamed package
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7384
                # succeeds, leaving the first package and the renamed package on
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7385
                # the system, as well as the empty, pre-renamed package. (3)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7386
                self.pkg("install qbar")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7387
                self.pkg("list qbar")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7388
                self.pkg("list foo@1")
2336
b318adf82ae0 18125 we don't like 'u' anymore or your 'x'-friend from that other 'state'
Shawn Walker <shawn.walker@oracle.com>
parents: 2333
diff changeset
  7389
                self.pkg("list qux | grep -- i-r")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7390
                self.pkg("uninstall '*'") #clean up for next test
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7391
                # A simple rename test: First install the pre-renamed version of
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7392
                # qux.  Then install the renamed version, and see that the new
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7393
                # package is installed, and the renamed package is installed,
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7394
                # but marked renamed.  (4)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7395
                self.pkg("install qux@1")
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7396
                self.pkg("install qux") # upgrades qux
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7397
                self.pkg("list foo@1")
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7398
                self.pkg("list qux", exit=1)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7399
                self.pkg("uninstall '*'") #clean up for next test
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7400
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7401
                # Install a package that's going to be obsoleted and a package
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7402
                # that depends on it.  Update the package to its obsolete
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7403
                # version and see that it fails.  (6, sorta)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7404
                self.pkg("install foo@1 fred@1")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7405
                self.pkg("install foo@2", exit=1)
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7406
                # now add a version of fred that doesn't require foo, and
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7407
                # show that update works
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7408
                self.pkgsend_bulk(self.rurl, fred2)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7409
                self.pkg("refresh")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7410
                self.pkg("install foo@2")
1813
75dd7cb4911e 15007 pkg install downloads new developer/sunstudio12u1
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1786
diff changeset
  7411
                self.pkg("uninstall '*'") #clean up for next test
75dd7cb4911e 15007 pkg install downloads new developer/sunstudio12u1
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1786
diff changeset
  7412
                # test fix for bug 12898
75dd7cb4911e 15007 pkg install downloads new developer/sunstudio12u1
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1786
diff changeset
  7413
                self.pkg("install qux@1")
75dd7cb4911e 15007 pkg install downloads new developer/sunstudio12u1
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1786
diff changeset
  7414
                self.pkg("install fred@2")
75dd7cb4911e 15007 pkg install downloads new developer/sunstudio12u1
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1786
diff changeset
  7415
                self.pkg("list foo@1", exit=1) # should not be installed
75dd7cb4911e 15007 pkg install downloads new developer/sunstudio12u1
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1786
diff changeset
  7416
                self.pkg("install qux") #update
75dd7cb4911e 15007 pkg install downloads new developer/sunstudio12u1
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1786
diff changeset
  7417
                self.pkg("list foo@1")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7418
                self.pkgrepo("remove -s %s fred@2" % self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7419
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7420
        def test_basic_exact_install(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7421
                foo1 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7422
                    open foo@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7423
                    add dir path=usr mode=0755 owner=root group=root
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7424
                    close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7425
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7426
                # Obsolete packages can have metadata
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7427
                foo2 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7428
                    open foo@2
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7429
                    add set name=pkg.obsolete value=true
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7430
                    add set name=pkg.summary value="A test package"
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7431
                    close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7432
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7433
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7434
                fbar = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7435
                    open fbar@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7436
                    add depend type=require fmri=foo@2
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7437
                    close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7438
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7439
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7440
                qbar = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7441
                    open qbar@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7442
                    add depend type=require fmri=qux@2
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7443
                    close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7444
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7445
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7446
                qux1 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7447
                    open qux@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7448
                    add dir path=usr mode=0755 owner=root group=root
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7449
                    close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7450
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7451
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7452
                qux2 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7453
                    open qux@2
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7454
                    add set name=pkg.renamed value=true
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7455
                    add depend type=require fmri=foo@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7456
                    close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7457
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7458
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7459
                fred1 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7460
                    open fred@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7461
                    add depend type=require fmri=foo
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7462
                    close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7463
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7464
                fred2 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7465
                    open fred@2
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7466
                    close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7467
                """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7468
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7469
                self.pkgsend_bulk(self.rurl, (foo1, foo2, fbar, qbar, qux1,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7470
                    qux2, fred1))
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7471
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7472
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7473
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7474
                # First exact-install the non-obsolete version of foo
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7475
                self.pkg("exact-install foo@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7476
                self.pkg("list foo@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7477
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7478
                # Now exact-install the obsolete version, and ensure it disappears
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7479
                # (5).
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7480
                self.pkg("exact-install foo")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7481
                self.pkg("list foo", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7482
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7483
                # Explicitly exact-installing an obsolete package succeeds, but
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7484
                # results in nothing on the system. (1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7485
                self.pkg("exact-install foo@2", exit=4)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7486
                self.pkg("list foo", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7487
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7488
                # Exact-nstalling a package with a dependency on an obsolete package
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7489
                # fails. (2)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7490
                self.pkg("exact-install fbar", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7491
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7492
                # Exact-installing a package with a dependency on a renamed
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7493
                # package succeeds, leaving the first package and the renamed
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7494
                # package on the system, as well as the empty, pre-renamed
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7495
                # package. (3)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7496
                self.pkg("exact-install qbar")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7497
                self.pkg("list qbar")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7498
                self.pkg("list foo@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7499
                self.pkg("list qux | grep -- i-r")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7500
                self.pkg("uninstall '*'") #clean up for next test
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7501
                # A simple rename test: First exact-install the pre-renamed
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7502
                # version of qux.  Then install the renamed version, and see
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7503
                # that the new package is installed, and the renamed package
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7504
                # is installed, but marked renamed.  (4)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7505
                self.pkg("exact-install qux@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7506
                self.pkg("exact-install qux") # upgrades qux
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7507
                self.pkg("list foo@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7508
                self.pkg("list qux", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7509
                self.pkg("uninstall '*'") #clean up for next test
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7510
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7511
                # Exact-install a package that's going to be obsoleted and a
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7512
                # package that depends on it.  Update the package to its
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7513
                # obsolete version and see that it fails.  (6, sorta)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7514
                self.pkg("exact-install foo@1 fred@1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7515
                self.pkg("exact-install foo@2 fred@1", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7516
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7517
                # If fred is not in the command line, we should ignore its
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7518
                # restriction and install foo@2.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7519
                self.pkg("exact-install foo@2")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7520
                # now add a version of fred that doesn't require foo, and
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7521
                # show that update works
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7522
                self.pkgsend_bulk(self.rurl, fred2)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7523
                self.pkg("refresh")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7524
                self.pkg("exact-install foo@2 fred")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7525
                self.pkg("uninstall '*'") #clean up for next test
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7526
                self.pkgrepo("remove -s %s fred@2" % self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7527
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7528
        def test_basic_7a(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7529
                """Upgrade a package to a version with a dependency on a renamed
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7530
                package.  A => A' (-> Br (-> C))"""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7531
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7532
                t7ap1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7533
                    open t7ap1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7534
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7535
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7536
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7537
                t7ap1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7538
                    open t7ap1@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7539
                    add depend type=require fmri=t7ap2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7540
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7541
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7542
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7543
                t7ap2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7544
                    open t7ap2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7545
                    add set name=pkg.renamed value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7546
                    add depend type=require fmri=t7ap3
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7547
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7548
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7549
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7550
                t7ap3_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7551
                    open t7ap3@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7552
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7553
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7554
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7555
                self.pkgsend_bulk(self.rurl, t7ap1_1)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7556
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7557
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7558
                self.pkg("install t7ap1")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7559
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7560
                self.pkgsend_bulk(self.rurl, (t7ap1_2, t7ap2_1, t7ap3_1))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7561
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7562
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7563
                self.pkg("update")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7564
                self.pkg("list -af")
2336
b318adf82ae0 18125 we don't like 'u' anymore or your 'x'-friend from that other 'state'
Shawn Walker <shawn.walker@oracle.com>
parents: 2333
diff changeset
  7565
                self.pkg("list t7ap2 | grep -- i-r")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7566
                self.pkg("list t7ap3")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7567
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7568
        def test_basic_7b(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7569
                """Upgrade a package to a version with a dependency on a renamed
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7570
                package.  Like 7a except package A starts off depending on B.
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7571
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7572
                A (-> B) => A' (-> Br (-> C))"""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7573
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7574
                t7bp1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7575
                    open t7bp1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7576
                    add depend type=require fmri=t7bp2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7577
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7578
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7579
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7580
                t7bp1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7581
                    open t7bp1@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7582
                    add depend type=require fmri=t7bp2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7583
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7584
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7585
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7586
                t7bp2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7587
                    open t7bp2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7588
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7589
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7590
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7591
                t7bp2_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7592
                    open t7bp2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7593
                    add set name=pkg.renamed value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7594
                    add depend type=require fmri=t7bp3
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7595
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7596
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7597
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7598
                t7bp3_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7599
                    open t7bp3@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7600
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7601
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7602
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7603
                self.pkgsend_bulk(self.rurl, (t7bp1_1, t7bp2_1))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7604
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7605
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7606
                self.pkg("install t7bp1")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7607
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7608
                self.pkgsend_bulk(self.rurl, (t7bp1_2, t7bp2_2, t7bp3_1))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7609
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7610
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7611
                self.pkg("update")
2336
b318adf82ae0 18125 we don't like 'u' anymore or your 'x'-friend from that other 'state'
Shawn Walker <shawn.walker@oracle.com>
parents: 2333
diff changeset
  7612
                self.pkg("list t7bp2 | grep -- i-r")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7613
                self.pkg("list t7bp3")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7614
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7615
        def test_basic_7c(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7616
                """Upgrade a package to a version with a dependency on a renamed
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7617
                package.  Like 7b, except package A doesn't change.
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7618
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7619
                A (-> B) => A (-> Br (-> C))"""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7620
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7621
                t7cp1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7622
                    open t7cp1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7623
                    add depend type=require fmri=t7cp2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7624
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7625
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7626
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7627
                t7cp2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7628
                    open t7cp2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7629
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7630
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7631
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7632
                t7cp2_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7633
                    open t7cp2@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7634
                    add set name=pkg.renamed value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7635
                    add depend type=require fmri=t7cp3
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7636
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7637
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7638
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7639
                t7cp3_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7640
                    open t7cp3@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7641
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7642
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7643
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7644
                self.pkgsend_bulk(self.rurl, (t7cp1_1, t7cp2_1))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7645
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7646
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7647
                self.pkg("install t7cp1")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7648
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7649
                self.pkgsend_bulk(self.rurl, (t7cp2_2, t7cp3_1))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7650
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7651
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7652
                self.pkg("update")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7653
2336
b318adf82ae0 18125 we don't like 'u' anymore or your 'x'-friend from that other 'state'
Shawn Walker <shawn.walker@oracle.com>
parents: 2333
diff changeset
  7654
                self.pkg("list t7cp2 | grep -- i-r")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7655
                self.pkg("list t7cp3")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7656
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7657
        def test_basic_6a(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7658
                """Upgrade a package to a version with a dependency on an
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7659
                obsolete package.  This version is unlikely to happen in real
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7660
                life."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7661
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7662
                t6ap1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7663
                    open t6ap1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7664
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7665
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7666
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7667
                t6ap1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7668
                    open t6ap1@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7669
                    add depend type=require fmri=t6ap2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7670
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7671
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7672
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7673
                t6ap2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7674
                    open t6ap2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7675
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7676
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7677
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7678
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7679
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7680
                self.pkgsend_bulk(self.rurl, t6ap1_1)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7681
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7682
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7683
                self.pkg("install t6ap1")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7684
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7685
                self.pkgsend_bulk(self.rurl, (t6ap1_2, t6ap2_1))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7686
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7687
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7688
                self.pkg("update", exit=4) # does nothing
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7689
                self.pkg("list t6ap1")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7690
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7691
        def test_basic_6b(self):
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7692
                """Install a package with a dependency, and update after
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7693
                publishing updated packages for both, but where the dependency
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7694
                has become obsolete."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7695
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7696
                t6ap1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7697
                    open t6ap1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7698
                    add depend type=require fmri=t6ap2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7699
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7700
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7701
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7702
                t6ap1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7703
                    open t6ap1@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7704
                    add depend type=require fmri=t6ap2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7705
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7706
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7707
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7708
                t6ap2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7709
                    open t6ap2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7710
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7711
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7712
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7713
                t6ap2_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7714
                    open t6ap2@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7715
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7716
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7717
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7718
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7719
                self.pkgsend_bulk(self.rurl, (t6ap1_1, t6ap2_1))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7720
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7721
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7722
                self.pkg("install t6ap1")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7723
                self.pkg("list")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7724
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7725
                self.pkgsend_bulk(self.rurl, (t6ap1_2, t6ap2_2))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7726
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7727
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7728
                self.pkg("update")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7729
                self.pkg("list t6ap1@2 t6ap2@1")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7730
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7731
        def test_basic_8a(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7732
                """Upgrade a package to an obsolete leaf version when another
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7733
                depends on it."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7734
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7735
                t8ap1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7736
                    open t8ap1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7737
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7738
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7739
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7740
                t8ap1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7741
                    open t8ap1@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7742
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7743
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7744
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7745
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7746
                t8ap2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7747
                    open t8ap2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7748
                    add depend type=require fmri=t8ap1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7749
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7750
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7751
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7752
                self.pkgsend_bulk(self.rurl, (t8ap1_1, t8ap2_1))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7753
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7754
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7755
                self.pkg("install t8ap2")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7756
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7757
                self.pkgsend_bulk(self.rurl, t8ap1_2)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7758
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7759
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7760
                self.pkg("update", exit=4) # does nothing
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7761
                self.pkg("list  t8ap2@1")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7762
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7763
        def test_basic_13a(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7764
                """Publish an package with a dependency, then publish both as
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7765
                obsolete, update, and see that both packages have gotten
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7766
                removed."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7767
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7768
                t13ap1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7769
                    open t13ap1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7770
                    add depend type=require fmri=t13ap2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7771
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7772
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7773
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7774
                t13ap1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7775
                    open t13ap1@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7776
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7777
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7778
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7779
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7780
                t13ap2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7781
                    open t13ap2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7782
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7783
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7784
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7785
                t13ap2_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7786
                    open t13ap2@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7787
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7788
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7789
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7790
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7791
                self.pkgsend_bulk(self.rurl, (t13ap1_1, t13ap2_1))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7792
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7793
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7794
                self.pkg("install t13ap1")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7795
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7796
                self.pkgsend_bulk(self.rurl, (t13ap1_2, t13ap2_2))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7797
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7798
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7799
                self.pkg("update")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7800
                self.pkg("list", exit=1)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7801
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7802
        def test_basic_11(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7803
                """Install or exact-install a package with an ambiguous name,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7804
                where only one match is non-obsolete."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7805
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7806
                self.basic_11_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7807
                self.basic_11_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7808
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7809
        def basic_11_helper(self, install_cmd):
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7810
                t11p1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7811
                    open netbeans@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7812
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7813
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7814
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7815
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7816
                t11p2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7817
                    open developer/netbeans@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7818
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7819
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7820
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7821
                self.pkgsend_bulk(self.rurl, (t11p1, t11p2))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7822
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7823
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7824
                self.pkg("%s netbeans" % install_cmd)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7825
                self.pkg("list pkg:/developer/netbeans")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7826
                self.pkg("list pkg:/netbeans", exit=1)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7827
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7828
        def test_basic_11a(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7829
                """Install or exact-install a package using an ambiguous name
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7830
                where pkg is renamed to another package, but not the
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7831
                conflicting one"""
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7832
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7833
                self.basic_11a_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7834
                self.basic_11a_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7835
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7836
        def basic_11a_helper(self, install_cmd):
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7837
                t11p1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7838
                    open netbonze@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7839
                    add set name=pkg.renamed value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7840
                    add depend type=require fmri=SUNWnetbonze
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7841
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7842
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7843
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7844
                t11p2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7845
                    open developer/netbonze@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7846
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7847
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7848
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7849
                t11p3 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7850
                    open SUNWnetbonze@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7851
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7852
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7853
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7854
                self.pkgsend_bulk(self.rurl, (t11p1, t11p2, t11p3))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7855
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7856
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7857
                self.pkg("%s netbonze" % install_cmd, exit=1)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7858
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7859
        def test_basic_11b(self):
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7860
                """Install or exact-install a package using an ambiguous name
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7861
                where only one match is non-renamed, and the renamed match
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7862
                is renamed to the other."""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7863
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7864
                self.basic_11b_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7865
                self.basic_11b_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7866
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7867
        def basic_11b_helper(self, install_cmd):
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7868
                t11p1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7869
                    open netbooze@1
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7870
                    close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7871
                """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7872
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7873
                t11p2 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7874
                    open netbooze@2
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7875
                    add set name=pkg.renamed value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7876
                    add depend type=require fmri=developer/netbooze
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7877
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7878
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7879
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7880
                t11p3 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7881
                    open developer/netbooze@2
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7882
                    close
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7883
                """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7884
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7885
                t11p4 = """
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7886
                    open developer/netbooze@3
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7887
                    add depend type=require fmri=developer/missing
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7888
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7889
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7890
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7891
                self.pkgsend_bulk(self.rurl, (t11p1, t11p2, t11p3, t11p4))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7892
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7893
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  7894
                self.pkg("%s netbooze" % install_cmd)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7895
                self.pkg("list pkg:/developer/netbooze")
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7896
                self.pkg("list pkg:/netbooze", exit=1)
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  7897
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7898
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7899
        def test_basic_12(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7900
                """Upgrade a package across a rename to an ambiguous name."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7901
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7902
                t12p1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7903
                    open netbeenz@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7904
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7905
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7906
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7907
                t12p1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7908
                    open netbeenz@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7909
                    add set name=pkg.renamed value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7910
                    add depend type=require fmri=pkg:/developer/netbeenz
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7911
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7912
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7913
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7914
                t12p2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7915
                    open developer/netbeenz@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7916
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7917
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7918
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7919
                self.pkgsend_bulk(self.rurl, t12p1_1)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7920
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7921
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7922
                self.pkg("install netbeenz")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7923
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7924
                self.pkgsend_bulk(self.rurl, (t12p1_2, t12p2_1))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7925
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7926
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7927
                self.pkg("update -v")
2336
b318adf82ae0 18125 we don't like 'u' anymore or your 'x'-friend from that other 'state'
Shawn Walker <shawn.walker@oracle.com>
parents: 2333
diff changeset
  7928
                self.pkg("list pkg:/developer/netbeenz | grep -- i--")
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7929
                self.pkg("list pkg:/netbeenz", exit=1)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7930
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7931
        def test_remove_renamed(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7932
                """If a renamed package has nothing depending on it, it should
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7933
                be removed."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7934
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7935
                p1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7936
                    open remrenA@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7937
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7938
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7939
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7940
                p1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7941
                    open remrenA@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7942
                    add set name=pkg.renamed value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7943
                    add depend type=require fmri=pkg:/remrenB
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7944
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7945
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7946
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7947
                p2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7948
                    open remrenB@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7949
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7950
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7951
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7952
                p3_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7953
                    open remrenC@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7954
                    add depend type=require fmri=pkg:/remrenA
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7955
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7956
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7957
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7958
                self.pkgsend_bulk(self.rurl, p1_1)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7959
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7960
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7961
                self.pkg("install remrenA")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7962
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  7963
                self.pkgsend_bulk(self.rurl, (p1_2, p2_1, p3_1))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7964
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7965
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7966
                self.pkg("update")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7967
                self.pkg("list remrenA", exit=1)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7968
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7969
                # But if there is something depending on the renamed package, it
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7970
                # can't be removed.
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7971
                self.pkg("uninstall remrenB")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7972
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7973
                self.pkg("install remrenA@1 remrenC")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  7974
                self.pkg("update")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7975
                self.pkg("list remrenA")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  7976
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7977
        def test_chained_renames(self):
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  7978
                """If there are multiple renames, make sure we delete as much
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7979
                as possible, but no more."""
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7980
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7981
                A1 = """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7982
                    open chained_A@1
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7983
                    close
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7984
                """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7985
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7986
                A2 = """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7987
                    open chained_A@2
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7988
                    add set name=pkg.renamed value=true
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7989
                    add depend type=require fmri=pkg:/chained_B@2
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7990
                    close
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7991
                """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7992
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7993
                B2 = """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7994
                    open chained_B@2
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7995
                    add set name=pkg.renamed value=true
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7996
                    add depend type=require fmri=pkg:/chained_C@2
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7997
                    close
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  7998
                """
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  7999
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8000
                C2 = """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8001
                    open chained_C@2
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8002
                    close
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8003
                """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8004
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8005
                X = """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8006
                    open chained_X@1
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8007
                    add depend type=require fmri=pkg:/chained_A
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8008
                    close
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8009
                """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8010
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8011
                Y = """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8012
                    open chained_Y@1
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8013
                    add depend type=require fmri=pkg:/chained_B
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8014
                    close
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8015
                """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8016
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8017
                Z = """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8018
                    open chained_Z@1
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8019
                    close
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8020
                """
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8021
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8022
                self.pkgsend_bulk(self.rurl, (A1, A2, B2, C2, X, Y, Z))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8023
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8024
                self.image_create(self.rurl)
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8025
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8026
                self.pkg("install chained_A@1 chained_X chained_Z")
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8027
                for p in ["chained_A@1", "chained_X@1"]:
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8028
                        self.pkg("list %s" % p)
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8029
                self.pkg("update")
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8030
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8031
                for p in ["chained_A@2", "chained_X@1", "chained_B@2",
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8032
                    "chained_C@2", "chained_Z"]:
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8033
                        self.pkg("list %s" % p)
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8034
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8035
                self.pkg("uninstall chained_X")
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8036
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8037
                for p in ["chained_C@2", "chained_Z"]:
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8038
                        self.pkg("list %s" % p)
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8039
1762
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8040
                # make sure renamed pkgs no longer needed are uninstalled
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8041
                for p in ["chained_A@2", "chained_B@2"]:
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8042
                        self.pkg("list %s" % p, exit=1)
2ae663f0e049 14507 renamed packages should be removed if possible
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1755
diff changeset
  8043
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8044
        def test_unobsoleted(self):
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8045
                """Ensure that the existence of an obsolete package version
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8046
                does not prevent the system from upgrading to or installing
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8047
                a resurrected version."""
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8048
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8049
                self.unobsoleted_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8050
                self.unobsoleted_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8051
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8052
        def unobsoleted_helper(self, install_cmd):
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8053
                pA_1 = """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8054
                    open reintroA@1
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8055
                    close
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8056
                """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8057
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8058
                pA_2 = """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8059
                    open reintroA@2
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8060
                    add set name=pkg.obsolete value=true
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8061
                    close
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8062
                """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8063
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8064
                pA_3 = """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8065
                    open reintroA@3
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8066
                    close
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8067
                """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8068
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8069
                pB_1 = """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8070
                    open reintroB@1
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8071
                    add depend type=require fmri=pkg:/reintroA@1
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8072
                    close
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8073
                """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8074
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8075
                pB_2 = """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8076
                    open reintroB@2
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8077
                    close
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8078
                """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8079
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8080
                pB_3 = """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8081
                    open reintroB@3
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8082
                    add depend type=require fmri=pkg:/reintroA@3
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8083
                    close
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8084
                """
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8085
2144
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  8086
                self.pkgsend_bulk(self.rurl, (pA_1, pA_2, pA_3, pB_1, pB_2,
2ac203b826ab 7276 /var/pkg metadata needs reorg (looks busy)
Shawn Walker <shawn.walker@oracle.com>
parents: 2092
diff changeset
  8087
                    pB_3))
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8088
                self.image_create(self.rurl)
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8089
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8090
                # Check installation of an unobsoleted package with no
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8091
                # dependencies.
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8092
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8093
                # Testing reintroA@1 -> reintroA@3 with update
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8094
                self.pkg("install reintroA@1")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8095
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8096
                self.pkg("update")
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8097
                self.pkg("list reintroA@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8098
                self.pkg("uninstall reintroA")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8099
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8100
                # Testing reintroA@1 -> reintroA@3 with install or
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8101
                # exact-install.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8102
                self.pkg("%s reintroA@1" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8103
                self.pkg("%s reintroA@3" % install_cmd)
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8104
                self.pkg("list reintroA@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8105
                self.pkg("uninstall reintroA")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8106
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8107
                # Testing empty image -> reintroA@3 with install or
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8108
                # exact-install.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8109
                self.pkg("%s reintroA@3" % install_cmd)
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8110
                self.pkg("list reintroA@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8111
                self.pkg("uninstall reintroA")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8112
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8113
                # Testing reintroA@1 -> reintroA@2 -> reintroA@3 with install
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8114
                # or exact-install.
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8115
                self.pkg("%s reintroA@1" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8116
                self.pkg("%s reintroA@2" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8117
                self.pkg("%s reintroA@3" % install_cmd)
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8118
                self.pkg("list reintroA@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8119
                self.pkg("uninstall reintroA")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8120
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8121
                # Check installation of a package with an unobsoleted
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8122
                # dependency.
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8123
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8124
                # Testing reintroB@1 -> reintroB@3 with update
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8125
                self.pkg("install reintroB@1")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8126
                self.pkg("refresh")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8127
                self.pkg("update")
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8128
                self.pkg("list reintroB@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8129
                self.pkg("list reintroA@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8130
                self.pkg("uninstall reintroB reintroA")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8131
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8132
                # Testing reintroB@1 -> reintroB@3 with install or
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8133
                # exact-install
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8134
                self.pkg("%s reintroB@1" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8135
                self.pkg("%s reintroB@3" % install_cmd)
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8136
                self.pkg("list reintroB@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8137
                self.pkg("list reintroA@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8138
                self.pkg("uninstall reintroB reintroA")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8139
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8140
                # Testing empty image -> reintroB@3 with install or
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8141
                # exact-install
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8142
                self.pkg("%s reintroB@3" % install_cmd)
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8143
                self.pkg("list reintroB@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8144
                self.pkg("list reintroA@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8145
                self.pkg("uninstall reintroB reintroA")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8146
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8147
                # Testing reintroB@1 -> reintroB@2 -> reintroB@3 with install
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8148
                # or exact-install
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8149
                self.pkg("%s reintroB@1" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8150
                self.pkg("%s reintroB@2" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8151
                self.pkg("%s reintroB@3" % install_cmd)
1564
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8152
                self.pkg("list reintroB@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8153
                self.pkg("list reintroA@3")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8154
                self.pkg("uninstall reintroB reintroA")
88b8ef77b129 13091 need a testcase for un-obsolete
Rich Burridge <rich.burridge@sun.com>
parents: 1552
diff changeset
  8155
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8156
        def test_incorp_1(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8157
                """We should be able to incorporate an obsolete package."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8158
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8159
                self.incorp_1_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8160
                self.incorp_1_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8161
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8162
        def incorp_1_helper(self, install_cmd):
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8163
                p1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8164
                    open inc1p1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8165
                    add depend type=incorporate fmri=inc1p2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8166
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8167
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8168
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8169
                p2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8170
                    open inc1p2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8171
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8172
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8173
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8174
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8175
                self.pkgsend_bulk(self.rurl, (p1_1, p2_1))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8176
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8177
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8178
                if install_cmd == "install":
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8179
                        self.pkg("install inc1p1")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8180
                        self.pkg("install inc1p2", exit=4)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8181
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8182
                        self.pkg("list inc1p2", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8183
                else:
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8184
                        self.pkg("exact-install inc1p1")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8185
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8186
        def test_incorp_2(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8187
                """We should be able to continue incorporating a package when it
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8188
                becomes obsolete on upgrade."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8189
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8190
                p1_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8191
                    open inc2p1@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8192
                    add depend type=incorporate fmri=inc2p2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8193
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8194
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8195
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8196
                p1_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8197
                    open inc2p1@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8198
                    add depend type=incorporate fmri=inc2p2@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8199
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8200
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8201
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8202
                p2_1 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8203
                    open inc2p2@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8204
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8205
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8206
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8207
                p2_2 = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8208
                    open inc2p2@2
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8209
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8210
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8211
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8212
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8213
                self.pkgsend_bulk(self.rurl, (p1_1, p2_1))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8214
                self.image_create(self.rurl)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8215
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8216
                self.pkg("install inc2p1 inc2p2")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8217
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8218
                self.pkgsend_bulk(self.rurl, (p1_2, p2_2))
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8219
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8220
                self.pkg("refresh")
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8221
                self.pkg("list -afv")
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8222
                self.pkg("update -v")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8223
                self.pkg("list inc2p2", exit=1)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8224
3134
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8225
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8226
class TestObsoletionNestedIncorporations(pkg5unittest.SingleDepotTestCase):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8227
        # Only start/stop the depot once (instead of for every test)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8228
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8229
        persistent_setup = True
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8230
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8231
        bug_15713570 = """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8232
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8233
            add depend type=require [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8234
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8235
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8236
            add depend type=require fmri=osnet-incorporation
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8237
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8238
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8239
            add set name=pkg.obsolete value=true
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8240
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8241
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8242
            add depend type=incorporate fmri=osnet-incorporation
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8243
            add depend type=incorporate fmri=osnet-incorporation@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8244
            add depend type=incorporate [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8245
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8246
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8247
            add depend type=incorporate fmri=osnet-incorporation
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8248
            add depend type=incorporate fmri=osnet-incorporation@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8249
            add depend type=incorporate [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8250
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8251
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8252
            add depend type=incorporate fmri=osnet-incorporation
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8253
            add depend type=incorporate fmri=osnet-incorporation@1
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8254
            add depend type=incorporate [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8255
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8256
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8257
            add depend type=incorporate [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8258
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8259
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8260
            add depend type=incorporate [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8261
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8262
            open [email protected],5.11-0
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8263
            add depend type=incorporate [email protected]
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8264
            close
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8265
       """
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8266
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8267
        def test_15713570(self):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8268
                """If an unincorporated package has its dependency obsoleted
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8269
                by a doubly nested incorporation with multiple levels of
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8270
                incorporation, there is no useful error message generated"""
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8271
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8272
                self.pkgsend_bulk(self.rurl, self.bug_15713570)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8273
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8274
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8275
                self.pkg("install -v [email protected] oldcompiler")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8276
                self.pkg("list")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8277
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8278
                self.pkg("update -v entire", exit=4)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8279
                self.pkg("list")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8280
                self.pkg("verify")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8281
                self.pkg("update -v entire@2", exit=1)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8282
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8283
                self.assert_("oldcompiler" in self.errout and
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8284
                    "oldperl" in self.errout,
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8285
                    "error message does not mention oldcompiler and oldperl packages")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8286
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8287
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8288
class TestPkgInstallMultiObsolete(pkg5unittest.ManyDepotTestCase):
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8289
        """Tests involving obsolete packages and multiple publishers."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8290
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8291
        obs = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8292
            open stem@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8293
            add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8294
            close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8295
        """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8296
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8297
        nonobs = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8298
            open stem@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8299
            close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8300
        """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8301
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8302
        persistent_setup = True
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8303
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8304
        def setUp(self):
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8305
                pkg5unittest.ManyDepotTestCase.setUp(self, ["test1", "test2"])
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8306
                self.rurl1 = self.dcs[1].get_repo_url()
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8307
                self.rurl2 = self.dcs[2].get_repo_url()
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8308
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8309
        def test_01(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8310
                """If an obsolete package is found in a preferred publisher and
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8311
                a non-obsolete package of the same name is found in a
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  8312
                non-preferred publisher, pick the preferred pub as usual """
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8313
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8314
                self.helper_01("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8315
                self.helper_01("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8316
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8317
        def helper_01(self, install_cmd):
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8318
                self.pkgsend_bulk(self.rurl1, self.obs)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8319
                self.pkgsend_bulk(self.rurl2, self.nonobs)
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8320
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8321
                self.image_create(self.rurl1, prefix="test1")
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8322
                self.pkg("set-publisher -O " + self.rurl2 + " test2")
1505
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  8323
                self.pkg("list -a")
cc598d70bbbe 4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 1461
diff changeset
  8324
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8325
                self.pkg("%s stem" % install_cmd, exit=4) # noting to do since it's obs
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8326
                # We should choose the obsolete package, which means nothing
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8327
                # gets installed.
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8328
                self.pkg("list", exit=1)
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8329
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8330
        def test_02(self):
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8331
                """Same as test_01, but now we have ambiguity in the package
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8332
                names.  While at first blush we might follow the same rule as in
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8333
                test_01 (choose the preferred publisher), in this case, we can't
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8334
                figure out which package from the preferred publisher we want,
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8335
                so the choice already isn't as straightforward, so we choose the
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8336
                non-obsolete package."""
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8337
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8338
                self.helper_02("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8339
                self.helper_02("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8340
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8341
        def helper_02(self, install_cmd):
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8342
                lobs = """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8343
                    open some/stem@1
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8344
                    add set name=pkg.obsolete value=true
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8345
                    close
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8346
                """
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8347
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8348
                self.pkgsend_bulk(self.rurl1, (self.obs, lobs))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8349
                self.pkgsend_bulk(self.rurl2, (self.nonobs, lobs))
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8350
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8351
                self.image_create(self.rurl1, prefix="test1")
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8352
                self.pkg("set-publisher -O " + self.rurl2 + " test2")
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8353
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  8354
                self.pkg("%s stem" % install_cmd, exit=1)
1461
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8355
fdf40c8c6765 820 Need a way to obsolete packages
Danek Duvall <danek.duvall@sun.com>
parents: 1431
diff changeset
  8356
3134
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8357
class TestPkgInstallMultiIncorp(pkg5unittest.ManyDepotTestCase):
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8358
        """Tests involving incorporations and multiple publishers."""
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8359
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8360
        incorporated_latest = """
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8361
            open [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8362
            close
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8363
            open [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8364
            close"""
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8365
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8366
        incorporated = """
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8367
            open [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8368
            close
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8369
            open [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8370
            close """
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8371
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8372
        incorporates = """
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8373
            open [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8374
            add depend type=incorporate [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8375
            close
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8376
            open [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8377
            add depend type=incorporate [email protected]
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8378
            close"""
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8379
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8380
        persistent_setup = True
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8381
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8382
        def setUp(self):
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8383
                pkg5unittest.ManyDepotTestCase.setUp(self, ["test1", "test2"])
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8384
                self.rurl1 = self.dcs[1].get_repo_url()
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8385
                self.rurl2 = self.dcs[2].get_repo_url()
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8386
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8387
        def test_1_incorp_latest_older(self):
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8388
                """Ensure that if the newest release version of a package is
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8389
                available for an older branch that incorporate dependencies work
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8390
                as expected."""
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8391
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8392
                self.image_create(self.rurl1)
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8393
                self.pkgsend_bulk(self.rurl1, (self.incorporates,
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8394
                    self.incorporated, self.incorporated_latest))
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8395
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8396
                # First, install two incorporations that intersect such that
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8397
                # only the version before the latest branch can be installed.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8398
                self.pkg("install userland-incorporation vim-incorporation")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8399
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8400
                # Then, attempt to install vim; this should succeed even though
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8401
                # the newest version available is for an older branch.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8402
                self.pkg("install [email protected]")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8403
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8404
        def test_2_incorp_multi_pub(self):
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8405
                """Ensure that if another publisher offers newer packages that
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8406
                satisfy an incorporate dependency, but are rejected because of
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8407
                publisher selection, that the preferred publisher's package can
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8408
                still satisfy the incorporate."""
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8409
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8410
                self.image_create(self.rurl1)
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8411
                self.pkgsend_bulk(self.rurl1, (self.incorporates,
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8412
                    self.incorporated))
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8413
                self.pkgsend_bulk(self.rurl2, self.incorporated_latest)
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8414
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8415
                # First, install the incorporation.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8416
                self.pkg("install userland-incorporation")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8417
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8418
                # Next, add the second publisher.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8419
                self.pkg("set-publisher -p %s" % self.rurl2)
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8420
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8421
                # Next, verify that first publisher's incorporated package can
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8422
                # be installed since it satisfies incorporate dependencies even
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8423
                # though second publisher's versions will be rejected.
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8424
                self.pkg("install //test1/vim")
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8425
c1da85e7efe7 18588974 solver can fail with faulty rejections for incorporates
saurabh.vyas@oracle.com
parents: 3063
diff changeset
  8426
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8427
class TestPkgInstallLicense(pkg5unittest.SingleDepotTestCase):
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8428
        """Tests involving one or more packages that require license acceptance
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8429
        or display."""
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8430
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8431
        persistent_depot = True
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8432
2729
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8433
        # Tests in this suite use the read only data directory.
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8434
        need_ro_data = True
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8435
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8436
        baz10 = """
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8437
            open [email protected],5.11-0
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8438
            add license copyright.baz license=copyright.baz
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8439
            close """
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8440
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8441
        # First iteration has just a copyright.
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8442
        licensed10 = """
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8443
            open [email protected],5.11-0
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8444
            add depend type=require [email protected]
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8445
            add license copyright.licensed license=copyright.licensed
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8446
            close """
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8447
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8448
        # Second iteration has copyright that must-display and a new license
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8449
        # that doesn't require acceptance.
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8450
        licensed12 = """
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8451
            open [email protected],5.11-0
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8452
            add depend type=require [email protected]
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8453
            add file libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8454
            add license copyright.licensed license=copyright.licensed must-display=True
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8455
            add license license.licensed license=license.licensed
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8456
            close """
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8457
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8458
        # Third iteration now requires acceptance of license.
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8459
        licensed13 = """
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8460
            open [email protected],5.11-0
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8461
            add depend type=require [email protected]
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8462
            add file libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8463
            add license copyright.licensed license=copyright.licensed must-display=True
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8464
            add license license.licensed license=license.licensed must-accept=True
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8465
            close """
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8466
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8467
        misc_files = ["copyright.baz", "copyright.licensed", "libc.so.1",
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8468
            "license.licensed", "license.licensed.addendum"]
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8469
2729
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8470
        # Packages with copyright in non-ascii character
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8471
        nonascii10 = """
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8472
            open [email protected],5.11-0
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8473
            add license 88591enc.copyright license=copyright
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8474
            close """
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8475
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8476
        # Packages with copyright in non-ascii character
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8477
        utf8enc10 = """
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8478
            open [email protected],5.11-0
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8479
            add license utf8enc.copyright license=copyright
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8480
            close """
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8481
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8482
        # Packages with copyright in unsupported character set
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8483
        unsupported10 = """
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8484
            open [email protected],5.11-0
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8485
            add license unsupported.copyright license=copyright
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8486
            close """
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8487
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8488
        def setUp(self):
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8489
                pkg5unittest.SingleDepotTestCase.setUp(self, publisher="bobcat")
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8490
                self.make_misc_files(self.misc_files)
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8491
2729
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8492
                # Use license with latin1 i.e 88591 encoding
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8493
                n_copyright = os.path.join(self.ro_data_root,
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8494
                    "88591enc.copyright")
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8495
                self.make_misc_files({"88591enc.copyright": n_copyright})
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8496
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8497
                # Use utf-8 encoding license
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8498
                utf_copyright = os.path.join(self.ro_data_root,
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8499
                    "utf8enc.copyright")
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8500
                self.make_misc_files({"utf8enc.copyright": utf_copyright})
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8501
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8502
                # Use unsupported license
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8503
                u_copyright = os.path.join(self.ro_data_root,
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8504
                    "unsupported.copyright")
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8505
                self.make_misc_files({"unsupported.copyright": u_copyright})
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8506
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8507
                self.plist = self.pkgsend_bulk(self.rurl, (self.licensed10,
2729
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8508
                    self.licensed12, self.licensed13, self.baz10,
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8509
                    self.nonascii10, self.utf8enc10, self.unsupported10))
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8510
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8511
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8512
        def test_01_install_update(self):
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8513
                """Verifies that install and update handle license
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8514
                acceptance and display."""
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8515
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8516
                self.image_create(self.rurl, prefix="bobcat")
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8517
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8518
                # First, test the basic install case to see if a license that
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8519
                # does not require viewing or acceptance will be installed.
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8520
                self.pkg("install --parsable=0 [email protected]")
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8521
                self.assertEqualParsable(self.output,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8522
                    add_packages=[self.plist[3], self.plist[0]], licenses=[
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8523
                        [self.plist[3], None,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8524
                            [self.plist[3], "copyright.baz", "copyright.baz",
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8525
                            False, False]],
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8526
                        [self.plist[0], None,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8527
                            [self.plist[0], "copyright.licensed",
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8528
                            "copyright.licensed", False, False]
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8529
                        ]])
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8530
                self.pkg("list")
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8531
                self.pkg("info [email protected] [email protected]")
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8532
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8533
                # Verify that --licenses include the license in output.
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8534
                self.pkg("install -n --licenses [email protected] | "
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8535
                    "grep 'license.licensed'")
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8536
2151
e04e45c5e7a2 17371 plan output should be shown after license output
Shawn Walker <shawn.walker@oracle.com>
parents: 2149
diff changeset
  8537
                # Verify that licenses that require display are included in
e04e45c5e7a2 17371 plan output should be shown after license output
Shawn Walker <shawn.walker@oracle.com>
parents: 2149
diff changeset
  8538
                # -n output even if --licenses is not provided.
e04e45c5e7a2 17371 plan output should be shown after license output
Shawn Walker <shawn.walker@oracle.com>
parents: 2149
diff changeset
  8539
                self.pkg("install -n [email protected] | grep 'copyright.licensed'")
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8540
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8541
                # Next, check that an upgrade succeeds when a license requires
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8542
                # display and that the license will be displayed.
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8543
                self.pkg("install --parsable=0 [email protected]")
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8544
                self.assertEqualParsable(self.output,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8545
                    change_packages=[[self.plist[0], self.plist[1]]], licenses=[
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8546
                        [self.plist[1],
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8547
                            None,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8548
                            [self.plist[1], "license.licensed",
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8549
                            "license.licensed", False, False]],
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8550
                        [self.plist[1],
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8551
                            [self.plist[0], "copyright.licensed",
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8552
                            "copyright.licensed", False, False],
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8553
                            [self.plist[1], "copyright.licensed",
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8554
                            "copyright.licensed", False, True]]])
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8555
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8556
                # Next, check that an update fails if the user has not
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8557
                # specified --accept and a license requires acceptance.
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8558
                self.pkg("update -v", exit=6)
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8559
                # Check that asking for parsable output doesn't change this
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8560
                # requirement.
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8561
                self.pkg("update --parsable=0", exit=6)
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8562
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8563
                # Verify that licenses are not included in -n output if
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8564
                # --licenses is not provided.
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8565
                self.pkg("update -n | grep 'copyright.licensed", exit=1)
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8566
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8567
                # Verify that --licenses include the license in output.
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8568
                self.pkg("update -n --licenses | "
1715
8f305f0a6864 8265 EINVAL on rmdir running "make test"
Dan Price <dp@eng.sun.com>
parents: 1713
diff changeset
  8569
                    "grep 'license.licensed'")
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8570
2089
c8b9d6341530 2775 pkg should provide a way to downgrade (reinstall) packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2084
diff changeset
  8571
                # Next, check that an update succeeds if the user has
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8572
                # specified --accept and a license requires acceptance.
2500
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8573
                self.pkg("update --parsable=0 --accept")
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8574
                self.assertEqualParsable(self.output,
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8575
                    change_packages=[[self.plist[1], self.plist[2]]], licenses=[
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8576
                        [self.plist[2],
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8577
                            [self.plist[1], "license.licensed",
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8578
                            "license.licensed", False, False],
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8579
                            [self.plist[2], "license.licensed",
a63fead21404 18439 pkg commands that modify the image should have a parsable output option
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2488
diff changeset
  8580
                            "license.licensed", True, False]]])
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8581
                self.pkg("info [email protected]")
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8582
2729
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8583
        def test_02_bug_7127117(self):
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8584
                """Verifies that install with --parsable handles licenses
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8585
                with non-ascii & non UTF locale"""
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8586
                self.image_create(self.rurl, prefix="bobcat")
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8587
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8588
                self.pkg("install --parsable=0 [email protected]")
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8589
                self.pkg("install --parsable=0 [email protected]")
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8590
                self.pkg("install --parsable=0 [email protected]")
fbe29295150f 7127117 pkg update --parsable option is not working
saurabh.vyas@oracle.com
parents: 2711
diff changeset
  8591
1618
04f7471c9e72 5943 add 'must-accept' attribute to license actions
Shawn Walker <srw@sun.com>
parents: 1601
diff changeset
  8592
1970
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8593
class TestActionErrors(pkg5unittest.SingleDepotTestCase):
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8594
        """This set of tests is intended to verify that the client will handle
1970
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8595
        image state and action errors gracefully during install or uninstall
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8596
        operations.  Unlike the client API version of these tests, the CLI only
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8597
        needs to be tested for failure cases since it uses the client API."""
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8598
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8599
        # Teardown the test root every time.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8600
        persistent_setup = False
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8601
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8602
        dir10 = """
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8603
            open [email protected],5.11-0
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8604
            add dir path=dir mode=755 owner=root group=bin
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8605
            close """
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8606
2476
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8607
        dir11 = """
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8608
            open [email protected],5.11-0
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8609
            add dir path=dir mode=750 owner=root group=bin
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8610
            close """
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8611
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8612
        # Purposefully omits depend on [email protected].
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8613
        filesub10 = """
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8614
            open [email protected],5.11-0
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8615
            add file tmp/file path=dir/file mode=755 owner=root group=bin
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8616
            close """
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8617
2476
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8618
        filesub11 = """
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8619
            open [email protected],5.11-0
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8620
            add file tmp/file path=dir/file mode=444 owner=root group=bin
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8621
            close """
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8622
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8623
        # Dependency providing file intentionally omitted.
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8624
        hardlink10 = """
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8625
            open [email protected],5.11-0
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8626
            add hardlink path=hardlink target=file
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8627
            close """
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8628
1970
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8629
        # Empty packages suitable for corruption testing.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8630
        foo10 = """
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8631
            open [email protected],5.11-0
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8632
            close """
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8633
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8634
        unsupp10 = """
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8635
            open [email protected]
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8636
            add depend type=require [email protected]
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8637
            close """
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8638
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8639
        misc_files = ["tmp/file"]
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8640
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8641
        def setUp(self):
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8642
                pkg5unittest.SingleDepotTestCase.setUp(self)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8643
                self.make_misc_files(self.misc_files)
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8644
2476
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8645
                plist = self.pkgsend_bulk(self.rurl, (self.dir10, self.dir11,
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8646
                    self.filesub10, self.filesub11, self.hardlink10))
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8647
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8648
                self.plist = {}
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8649
                for p in plist:
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8650
                        pfmri = fmri.PkgFmri(p, "5.11")
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8651
                        self.plist[pfmri.pkg_name] = pfmri
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8652
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8653
        @staticmethod
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8654
        def __write_empty_file(target, mode=644, owner="root", group="bin"):
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8655
                f = open(target, "wb")
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8656
                f.write("\n")
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8657
                f.close()
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8658
                os.chmod(target, mode)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8659
                owner = portable.get_user_by_name(owner, "/", True)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8660
                group = portable.get_group_by_name(group, "/", True)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8661
                os.chown(target, owner, group)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8662
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8663
        def test_00_directory(self):
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8664
                """Verify that directory install fails as expected when it has
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8665
                been replaced with a link prior to install."""
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8666
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8667
                self.image_create(self.rurl)
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8668
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8669
                # The dest_dir's installed path.
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8670
                dest_dir_name = "dir"
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8671
                dest_dir = os.path.join(self.get_img_path(), dest_dir_name)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8672
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8673
                # Directory replaced with a link (fails for install).
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8674
                self.__write_empty_file(dest_dir + ".src")
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8675
                os.symlink(dest_dir + ".src", dest_dir)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8676
                self.pkg("install %s" % dest_dir_name, exit=1)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8677
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8678
        def test_01_file(self):
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8679
                """Verify that file install works as expected when its parent
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8680
                directory has been replaced with a link."""
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8681
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8682
                self.image_create(self.rurl)
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8683
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8684
                # File's parent directory replaced with a link.
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8685
                self.pkg("install dir")
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8686
                src = os.path.join(self.get_img_path(), "dir")
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8687
                os.mkdir(os.path.join(self.get_img_path(), "export"))
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8688
                new_src = os.path.join(os.path.dirname(src), "export", "dir")
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8689
                shutil.move(src, os.path.dirname(new_src))
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8690
                os.symlink(new_src, src)
2476
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8691
                self.pkg("install [email protected]", exit=1)
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8692
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8693
        def test_02_hardlink(self):
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8694
                """Verify that hardlink install fails as expected when
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8695
                hardlink target is missing."""
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8696
1895
0a260cc2a689 15762 client support for filesystem-based repository access
Shawn Walker <shawn.walker@oracle.com>
parents: 1859
diff changeset
  8697
                self.image_create(self.rurl)
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8698
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8699
                # Hard link target is missing (failure expected).
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8700
                self.pkg("install hardlink", exit=1)
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8701
1970
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8702
        def __populate_repo(self, unsupp_content=None):
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8703
                # Publish a package and then add some unsupported action data
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8704
                # to the repository's copy of the manifest and catalog.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8705
                sfmri = self.pkgsend_bulk(self.rurl, self.unsupp10)[0]
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8706
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8707
                if unsupp_content is None:
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8708
                        # No manipulation required.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8709
                        return
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8710
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8711
                pfmri = fmri.PkgFmri(sfmri)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8712
                repo = self.get_repo(self.dcs[1].get_repodir())
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8713
                mpath = repo.manifest(pfmri)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8714
                with open(mpath, "ab+") as mfile:
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8715
                        mfile.write(unsupp_content + "\n")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8716
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8717
                mcontent = None
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8718
                with open(mpath, "rb") as mfile:
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8719
                        mcontent = mfile.read()
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8720
2028
b2c674e6ee28 16744 repository multi-publisher on-disk format should be formalized and implemented
Shawn Walker <shawn.walker@oracle.com>
parents: 2026
diff changeset
  8721
                cat = repo.get_catalog("test")
1970
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8722
                cat.log_updates = False
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8723
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8724
                # Update the catalog signature.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8725
                entry = cat.get_entry(pfmri)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8726
                entry["signature-sha-1"] = manifest.Manifest.hash_create(
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8727
                    mcontent)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8728
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8729
                # Update the catalog actions.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8730
                dpart = cat.get_part("catalog.dependency.C", must_exist=True)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8731
                entry = dpart.get_entry(pfmri)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8732
                entry["actions"].append(unsupp_content)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8733
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8734
                # Write out the new catalog.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8735
                cat.save()
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8736
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8737
        def test_03_unsupported(self):
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8738
                """Verify that packages with invalid or unsupported actions are
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8739
                handled gracefully.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8740
                """
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8741
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8742
                # Base package needed for tests.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8743
                self.pkgsend_bulk(self.rurl, self.foo10)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8744
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8745
                # Verify that a package with unsupported content doesn't cause
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8746
                # a problem.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8747
                newact = "depend type=new-type [email protected]"
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8748
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8749
                # Now create a new image and verify that pkg install will fail
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8750
                # for the unsupported package, but succeed for the supported
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8751
                # one.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8752
                self.__populate_repo(newact)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8753
                self.image_create(self.rurl)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8754
                self.pkg("install [email protected]")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8755
                self.pkg("install [email protected]", exit=1)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8756
                self.pkg("uninstall foo")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8757
                self.pkg("install [email protected] [email protected]", exit=1)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8758
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8759
                # Verify that a package with invalid content behaves the same.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8760
                newact = "depend notvalid"
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8761
                self.__populate_repo(newact)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8762
                self.pkg("refresh --full")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8763
                self.pkg("install [email protected]")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8764
                self.pkg("install [email protected]", exit=1)
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8765
                self.pkg("uninstall foo")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8766
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8767
                # Now verify that if a newer version of the unsupported package
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8768
                # is found that is supported, it can be installed.
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8769
                self.__populate_repo()
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8770
                self.pkg("refresh --full")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8771
                self.pkg("install [email protected] [email protected]")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8772
                self.pkg("uninstall foo unsupported")
60471574c487 16238 client api should ignore invalid and not yet supported packages
Shawn Walker <shawn.walker@oracle.com>
parents: 1968
diff changeset
  8773
2476
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8774
        def test_04_loop(self):
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8775
                """Verify that if a directory or file is replaced with a link
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8776
                that targets itself (resulting in ELOOP) pkg fails gracefully.
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8777
                """
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8778
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8779
                # Create an image and install a package delivering a file.
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8780
                self.image_create(self.rurl)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8781
                self.pkg("install [email protected] [email protected]")
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8782
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8783
                # Now replace the file with a link that points to itself.
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8784
                def create_link_loop(fpath):
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8785
                        if os.path.isfile(fpath):
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8786
                                portable.remove(fpath)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8787
                        else:
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8788
                                shutil.rmtree(fpath)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8789
                        cwd = os.getcwd()
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8790
                        os.chdir(os.path.dirname(fpath))
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8791
                        os.symlink(os.path.basename(fpath),
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8792
                            os.path.basename(fpath))
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8793
                        os.chdir(cwd)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8794
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8795
                fpath = self.get_img_file_path("dir/file")
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8796
                create_link_loop(fpath)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8797
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8798
                # Verify that pkg verify gracefully fails if traversing a
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8799
                # link targeting itself.
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8800
                self.pkg("verify", exit=1)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8801
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8802
                # Verify that pkg succeeds if attempting to update a
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8803
                # package containing a file replaced with a link loop.
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8804
                self.pkg("update filesub")
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8805
                self.pkg("verify")
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8806
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8807
                # Now remove the package delivering the file and replace the
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8808
                # directory with a link loop.
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8809
                self.pkg("uninstall filesub")
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8810
                fpath = self.get_img_file_path("dir")
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8811
                create_link_loop(fpath)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8812
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8813
                # Verify that pkg verify gracefully fails if traversing a
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8814
                # link targeting itself.
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8815
                self.pkg("verify", exit=1)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8816
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8817
                # Verify that pkg gracefully fails if attempting to update
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8818
                # a package containing a directory replace with a link loop.
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8819
                self.pkg("update", exit=1)
25342deb3749 3262 symlink loops can cause operation traceback
Shawn Walker <shawn.walker@oracle.com>
parents: 2470
diff changeset
  8820
1859
6e6e866921e7 529 client can traceback with EBUSY during action removal
Shawn Walker <shawn.walker@oracle.com>
parents: 1855
diff changeset
  8821
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  8822
class TestConflictingActions(_TestHelper, pkg5unittest.SingleDepotTestCase):
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8823
        """This set of tests verifies that packages which deliver conflicting
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8824
        actions into the same name in a namespace cannot be installed
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8825
        simultaneously."""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8826
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8827
        pkg_boring10 = """
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8828
            open [email protected],5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8829
            close """
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8830
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8831
        pkg_dupfiles = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8832
            open dupfiles@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8833
            add file tmp/file1 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8834
            add file tmp/file2 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8835
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8836
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8837
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8838
        pkg_dupfilesp1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8839
            open dupfilesp1@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8840
            add file tmp/file1 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8841
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8842
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8843
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8844
        pkg_dupfilesp2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8845
            open dupfilesp2@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8846
            add file tmp/file2 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8847
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8848
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8849
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8850
        pkg_dupfilesp2v2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8851
            open dupfilesp2@2,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8852
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8853
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8854
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8855
        pkg_dupfilesp3 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8856
            open dupfilesp3@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8857
            add file tmp/file2 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8858
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8859
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8860
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8861
        pkg_dupfilesp4 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8862
            open dupfilesp4@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8863
            add file tmp/file3 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8864
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8865
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8866
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8867
        pkg_dupotherfilesp1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8868
            open dupotherfilesp1@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8869
            add file tmp/file1 path=dir/namepath mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8870
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8871
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8872
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8873
        pkg_dupotherfilesp2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8874
            open dupotherfilesp2@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8875
            add file tmp/file2 path=dir/namepath mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8876
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8877
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8878
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8879
        pkg_dupotherfilesp2v2 = """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8880
            open dupotherfilesp2@2,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8881
            close
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8882
        """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8883
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8884
        pkg_dupotherfilesp3 = """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8885
            open dupotherfilesp3@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8886
            add file tmp/file3 path=dir/namepath mode=0755 owner=root group=bin
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8887
            close
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8888
        """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  8889
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8890
        pkg_identicalfiles = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8891
            open identicalfiles@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8892
            add file tmp/file1 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8893
            add file tmp/file1 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8894
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8895
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8896
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8897
        pkg_overlaid = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8898
            open overlaid@0,5.11-0
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8899
            add dir path=etc mode=0755 owner=root group=root
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8900
            add file tmp/file1 path=etc/pam.conf mode=644 owner=root group=sys preserve=true overlay=allow
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8901
            close
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8902
            open overlaid@1,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8903
            add dir path=etc mode=0755 owner=root group=root
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8904
            add file tmp/file1 path=etc/pam.conf mode=644 owner=root group=sys preserve=renamenew overlay=allow
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8905
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8906
            open overlaid@2,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8907
            add dir path=etc mode=0755 owner=root group=root
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8908
            add file tmp/file3 path=etc/pam.conf mode=644 owner=root group=sys preserve=renamenew overlay=allow
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8909
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8910
            open overlaid@3,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8911
            add set name=pkg.renamed value=true
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8912
            add depend type=require fmri=overlaid-renamed@3
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8913
            add depend type=exclude fmri=overlaid-renamed@4
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8914
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8915
            open overlaid-renamed@3,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8916
            add depend type=optional fmri=overlaid@3
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8917
            add dir path=etc mode=0755 owner=root group=root
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8918
            add file tmp/file3 original_name=overlaid:etc/pam.conf path=etc/pam.conf mode=644 owner=root group=sys preserve=renamenew overlay=allow
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8919
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8920
            open [email protected],5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8921
            add depend type=optional fmri=overlaid@3
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8922
            add dir path=etc mode=0755 owner=root group=root
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8923
            add dir path=etc/pam mode=0755 owner=root group=root
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8924
            add file tmp/file4 original_name=overlaid:etc/pam.conf path=etc/pam/pam.conf mode=644 owner=root group=sys preserve=renamenew
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8925
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8926
            open [email protected],5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8927
            add depend type=optional fmri=overlaid@3
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8928
            add dir path=etc mode=0755 owner=root group=root
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8929
            add dir path=etc/pam mode=0755 owner=root group=root
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8930
            add file tmp/file4 original_name=overlaid:etc/pam.conf path=etc/pam/pam.conf mode=644 owner=root group=sys preserve=renamenew overlay=allow
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8931
            close
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8932
        """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8933
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8934
        # 'overlay' is ignored unless 'preserve' is also set.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8935
        pkg_invalid_overlaid = """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8936
            open invalid-overlaid@0,5.11-0
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8937
            add file tmp/file1 path=etc/pam.conf mode=644 owner=root group=sys overlay=allow
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8938
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8939
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8940
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8941
        pkg_overlayer = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8942
            open overlayer@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8943
            add file tmp/file2 path=etc/pam.conf mode=644 owner=root group=sys preserve=true overlay=true
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8944
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8945
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8946
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8947
        pkg_overlayer_move = """
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8948
            open overlayer-move@0,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8949
            add file tmp/file2 path=etc/pam.conf mode=644 owner=root group=sys preserve=true overlay=true
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8950
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8951
            open overlayer-move@1,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8952
            add file tmp/file3 path=etc/pam/pam.conf mode=644 owner=root group=sys preserve=true overlay=true original_name=overlayer-move:etc/pam.conf
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8953
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8954
        """
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8955
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8956
        pkg_overlayer_update = """
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8957
            open overlayer-update@0,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8958
            add file tmp/file1 path=etc/pam.conf mode=644 owner=root group=sys overlay=true
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8959
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8960
            open overlayer-update@1,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8961
            add file tmp/file2 path=etc/pam.conf mode=644 owner=root group=sys preserve=true overlay=true
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8962
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8963
            open overlayer-update@2,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8964
            add file tmp/file3 path=etc/pam.conf mode=644 owner=root group=sys preserve=renameold overlay=true
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8965
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8966
            open overlayer-update@3,5.11-0
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8967
            add file tmp/file4 path=etc/pam.conf mode=644 owner=root group=sys preserve=renamenew overlay=true
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8968
            close
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8969
        """
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8970
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8971
        pkg_multi_overlayer = """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8972
            open multi-overlayer@0,5.11-0
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8973
            add file tmp/file2 path=etc/pam.conf mode=644 owner=root group=sys preserve=true overlay=true
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8974
            close
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8975
        """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8976
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8977
        # overlaying file is treated as conflicting file if its mode, owner, and
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8978
        # group attributes don't match the action being overlaid
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8979
        pkg_mismatch_overlayer = """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8980
            open mismatch-overlayer@0,5.11-0
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8981
            add file tmp/file2 path=etc/pam.conf mode=640 owner=root group=bin preserve=true overlay=true
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8982
            close
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8983
        """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8984
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8985
        # overlaying file is treated as conflicting file if it doesn't set overlay=true
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8986
        # even if file being overlaid allows overlay.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8987
        pkg_invalid_overlayer = """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8988
            open invalid-overlayer@0,5.11-0
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8989
            add file tmp/file2 path=etc/pam.conf mode=644 owner=root group=sys preserve=true
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8990
            close
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8991
        """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8992
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8993
        pkg_unpreserved_overlayer = """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8994
            open unpreserved-overlayer@0,5.11-0
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  8995
            add file tmp/unpreserved path=etc/pam.conf mode=644 owner=root group=sys overlay=true
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8996
            close
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8997
        """
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  8998
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  8999
        pkgremote_pkg1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9000
            open pkg1@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9001
            add file tmp/file1 path=remote mode=644 owner=root group=sys
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9002
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9003
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9004
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9005
        pkgremote_pkg2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9006
            open pkg2@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9007
            add file tmp/file2 path=remote mode=644 owner=root group=sys
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9008
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9009
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9010
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9011
        pkg_dupfilesv1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9012
            open dupfilesv1@0,5.11-0
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  9013
            add set name=variant.arch value=sparc value=i386
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9014
            add dir path=dir/pathname mode=0755 owner=root group=bin variant.arch=i386
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9015
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9016
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9017
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9018
        pkg_dupfilesv2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9019
            open dupfilesv2@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9020
            add dir path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9021
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9022
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9023
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9024
        pkg_dupfilesv3 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9025
            open dupfilesv3@0,5.11-0
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  9026
            add set name=variant.arch value=sparc value=i386
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9027
            add dir path=dir/pathname mode=0777 owner=root group=bin variant.arch=sparc
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9028
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9029
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9030
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9031
        pkg_dupfilesv4 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9032
            open dupfilesv4@0,5.11-0
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  9033
            add set name=variant.arch value=sparc value=i386
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9034
            add file tmp/file1 path=dir/pathname mode=0777 owner=root group=bin variant.arch=sparc
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9035
            add file tmp/file2 path=dir/pathname mode=0777 owner=root group=bin variant.arch=sparc
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9036
            add file tmp/file3 path=dir/pathname mode=0777 owner=root group=bin variant.arch=i386
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9037
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9038
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9039
2211
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9040
        pkg_dupfilesv5 = """
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9041
            open dupfilesv5@0,5.11-0
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
  9042
            add set name=variant.opensolaris.zone value=global value=nonglobal
2211
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9043
            add file tmp/file1 path=dir/pathname mode=0777 owner=root group=bin variant.opensolaris.zone=nonglobal
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9044
            close
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9045
        """
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9046
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9047
        pkg_dupfilesv6 = """
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9048
            open dupfilesv6@0,5.11-0
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9049
            add file tmp/file2 path=dir/pathname mode=0755 owner=root group=bin
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9050
            close
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9051
        """
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
  9052
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9053
        pkg_dupfilesf1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9054
            open dupfilesf1@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9055
            add dir path=dir/pathname mode=0755 owner=root group=bin facet.devel=true
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9056
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9057
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9058
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9059
        pkg_dupfilesf2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9060
            open dupfilesf2@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9061
            add dir path=dir/pathname mode=0755 owner=root group=bin facet.devel=false
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9062
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9063
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9064
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9065
        pkg_dupfilesf3 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9066
            open dupfilesf3@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9067
            add dir path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9068
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9069
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9070
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9071
        pkg_dupfilesf4 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9072
            open dupfilesf4@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9073
            add file tmp/file1 path=dir/pumpkin mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9074
            add file tmp/file2 path=dir/pumpkin mode=0755 owner=root group=bin facet.devel=true
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9075
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9076
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9077
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9078
        pkg_duppathfilelink = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9079
            open duppath-filelink@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9080
            add file tmp/file1 path=dir/pathname mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9081
            add link path=dir/pathname target=dir/other
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9082
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9083
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9084
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9085
        pkg_duplink = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9086
            open duplink@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9087
            add link path=dir/pathname target=dir/other
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9088
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9089
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9090
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9091
        pkg_dupmultitypes1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9092
            open dupmultitypes@1,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9093
            add link path=multitypepath target=dir/other
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9094
            add file tmp/file1 path=multitypepath mode=0644 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9095
            add dir path=multitypepath mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9096
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9097
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9098
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9099
        pkg_dupmultitypes2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9100
            open dupmultitypes@2,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9101
            add dir path=multitypepath mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9102
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9103
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9104
2232
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9105
        pkg_dupmultitypes3_0 = """
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9106
            open dupmultitypes3@0,5.11-0
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9107
            add link path=multitypepath target=blah
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9108
            add link path=multitypepath target=blah
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9109
            close
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9110
        """
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9111
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9112
        pkg_dupmultitypes3_1 = """
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9113
            open dupmultitypes3@1,5.11-0
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9114
            add dir path=multitypepath mode=0755 owner=root group=bin
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9115
            add dir path=multitypepath mode=0755 owner=root group=bin
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9116
            close
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9117
        """
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
  9118
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9119
        pkg_duppathnonidenticallinks = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9120
            open duppath-nonidenticallinks@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9121
            add link path=dir/pathname target=dir/something
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9122
            add link path=dir/pathname target=dir/other
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9123
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9124
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9125
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9126
        pkg_duppathnonidenticallinksp1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9127
            open duppath-nonidenticallinksp1@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9128
            add link path=dir/pathname target=dir/something
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9129
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9130
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9131
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9132
        pkg_duppathnonidenticallinksp2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9133
            open duppath-nonidenticallinksp2@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9134
            add link path=dir/pathname target=dir/other
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9135
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9136
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9137
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9138
        pkg_duppathnonidenticallinksp2v1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9139
            open duppath-nonidenticallinksp2@1,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9140
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9141
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9142
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9143
        pkg_duppathnonidenticaldirs = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9144
            open duppath-nonidenticaldirs@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9145
            add dir path=dir/pathname owner=root group=root mode=0755
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9146
            add dir path=dir/pathname owner=root group=bin mode=0711
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9147
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9148
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9149
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9150
        pkg_duppathalmostidenticaldirs = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9151
            open duppath-almostidenticaldirs@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9152
            add dir path=dir/pathname owner=root group=root mode=0755
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9153
            add dir path=dir/pathname owner=root group=root mode=755
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9154
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9155
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9156
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9157
        pkg_implicitdirs = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9158
            open implicitdirs@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9159
            add file tmp/file1 path=usr/bin/something mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9160
            add file tmp/file2 path=usr/bin mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9161
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9162
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9163
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9164
        pkg_implicitdirs2 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9165
            open implicitdirs2@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9166
            add file tmp/file1 path=usr/bin/something mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9167
            add dir path=usr/bin mode=0700 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9168
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9169
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9170
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9171
        pkg_implicitdirs3 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9172
            open implicitdirs3@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9173
            add file tmp/file1 path=usr/bin/other mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9174
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9175
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9176
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9177
        pkg_implicitdirs4 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9178
            open implicitdirs4@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9179
            add file tmp/file1 path=usr/bin/something mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9180
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9181
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9182
        pkg_implicitdirs5 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9183
            open implicitdirs5@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9184
            add dir path=usr/bin mode=0755 owner=root group=sys
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9185
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9186
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9187
        pkg_implicitdirs6 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9188
            open implicitdirs6@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9189
            add dir path=usr/bin mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9190
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9191
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9192
        pkg_implicitdirs7 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9193
            open implicitdirs7@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9194
            add file tmp/file1 path=usr/bin mode=0755 owner=root group=bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9195
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9196
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9197
        pkg_dupdir = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9198
            open dupdir@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9199
            add dir path=dir/pathname owner=root group=bin mode=0755
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9200
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9201
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9202
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9203
        pkg_dupdirv1 = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9204
            open dupdir@1,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9205
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9206
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9207
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9208
        pkg_dupdirnowhere = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9209
            open dupdirnowhere@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9210
            add dir path=dir/pathname owner=root group=bin mode=0755
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9211
            close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9212
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9213
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9214
        pkg_dupdirp1 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9215
            open dupdirp1@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9216
            add dir path=dir owner=root group=bin mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9217
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9218
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9219
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9220
        pkg_dupdirp2 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9221
            open dupdirp2@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9222
            add dir path=dir owner=root group=sys mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9223
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9224
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9225
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9226
        pkg_dupdirp2_2 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9227
            open dupdirp2@2,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9228
            add dir path=dir owner=root group=bin mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9229
            close
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9230
        """
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9231
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9232
        pkg_dupdirp3 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9233
            open dupdirp3@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9234
            add dir path=dir owner=root group=bin mode=0750
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9235
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9236
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9237
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9238
        pkg_dupdirp4 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9239
            open dupdirp4@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9240
            add dir path=dir owner=root group=sys mode=0750
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9241
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9242
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9243
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9244
        pkg_dupdirp5 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9245
            open dupdirp5@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9246
            add dir path=dir owner=root group=other mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9247
            close
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9248
        """
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9249
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9250
        pkg_dupdirp6 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9251
            open dupdirp6@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9252
            add dir path=dir owner=root group=other mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9253
            close
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9254
        """
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9255
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9256
        pkg_dupdirp7 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9257
            open dupdirp7@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9258
            add file tmp/file1 path=dir/file owner=root group=other mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9259
            close
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9260
        """
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9261
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9262
        pkg_dupdirp8 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9263
            open dupdirp8@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9264
            add dir path=dir owner=root group=bin mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9265
            close
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9266
        """
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9267
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9268
        pkg_dupdirp8_2 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9269
            open dupdirp8@2,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9270
            add dir path=dir owner=root group=sys mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9271
            close
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9272
        """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9273
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9274
        pkg_dupdirp9 = """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9275
            open dupdirp9@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9276
            add dir path=var owner=root group=other mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9277
            add dir path=usr owner=root group=other mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9278
            close
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9279
        """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9280
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9281
        pkg_dupdirp10 = """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9282
            open dupdirp10@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9283
            add dir path=var owner=root group=bin mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9284
            add dir path=usr owner=root group=bin mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9285
            close
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9286
        """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9287
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9288
        pkg_dupdirp11 = """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9289
            open dupdirp11@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9290
            add dir path=usr/bin owner=root group=bin mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9291
            add dir path=var/zap owner=root group=bin mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9292
            close
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9293
        """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9294
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9295
        pkg_dupdirp12 = """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9296
            open dupdirp12@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9297
            add dir path=usr/bin owner=root group=bin mode=0755
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9298
            add legacy pkg=dupdirp9
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9299
            close
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9300
        """
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
  9301
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9302
        pkg_userdb = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9303
            open userdb@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9304
            add file tmp/passwd mode=0644 owner=root group=bin path=etc/passwd preserve=true
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9305
            add file tmp/group mode=0644 owner=root group=bin path=etc/group preserve=true
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9306
            add file tmp/shadow mode=0600 owner=root group=bin path=etc/shadow preserve=true
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9307
            add file tmp/ftpusers mode=0644 owner=root group=bin path=etc/ftpd/ftpusers preserve=true
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9308
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9309
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9310
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9311
        userdb_files = {
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9312
            "tmp/passwd": """\
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9313
root:x:0:0::/root:/usr/bin/bash
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9314
daemon:x:1:1::/:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9315
bin:x:2:2::/usr/bin:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9316
sys:x:3:3::/:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9317
adm:x:4:4:Admin:/var/adm:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9318
""",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9319
            "tmp/group": """\
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9320
root::0:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9321
other::1:root
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9322
bin::2:root,daemon
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9323
sys::3:root,bin,adm
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9324
adm::4:root,daemon
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9325
""",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9326
            "tmp/shadow": """\
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9327
root:9EIfTNBp9elws:13817::::::
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9328
daemon:NP:6445::::::
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9329
bin:NP:6445::::::
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9330
sys:NP:6445::::::
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9331
adm:NP:6445::::::
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9332
""",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9333
            "tmp/ftpusers": """\
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9334
root
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9335
bin
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9336
sys
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9337
adm
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9338
"""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9339
        }
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9340
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9341
        pkg_dupuser = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9342
            open dupuser@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9343
            add user username=kermit group=adm gcos-field="kermit 1"
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9344
            add user username=kermit group=adm gcos-field="kermit 2"
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9345
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9346
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9347
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9348
        pkg_dupuserp1 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9349
            open dupuserp1@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9350
            add user username=kermit group=adm gcos-field="kermit 1"
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9351
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9352
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9353
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9354
        pkg_dupuserp2 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9355
            open dupuserp2@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9356
            add user username=kermit group=adm gcos-field="kermit 2"
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9357
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9358
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9359
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9360
        pkg_dupuserp2v2 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9361
            open dupuserp2@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9362
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9363
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9364
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9365
        pkg_dupuserp3 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9366
            open dupuserp3@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9367
            add user username=kermit group=adm gcos-field="kermit 2"
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9368
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9369
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9370
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9371
        pkg_dupuserp4 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9372
            open dupuserp4@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9373
            add user username=kermit group=adm gcos-field="kermit 4"
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9374
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9375
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9376
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9377
        pkg_otheruser = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9378
            open otheruser@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9379
            add user username=fozzie group=adm home-dir=/export/home/fozzie
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9380
            close
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9381
        """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9382
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9383
        pkg_othergroup = """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9384
            open othergroup@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9385
            add group groupname=fozzie gid=87
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9386
            add group groupname=fozzie gid=88
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9387
            add group groupname=fozzie gid=89
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9388
            close
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9389
        """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9390
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9391
        pkg_othergroup1 = """
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9392
            open othergroup@1,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9393
            add group groupname=fozzie gid=87
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9394
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9395
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9396
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9397
        pkg_driverdb = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9398
            open driverdb@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9399
            add file tmp/devlink.tab path=etc/devlink.tab mode=0644 owner=root group=bin
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9400
            add file tmp/driver_aliases path=etc/driver_aliases mode=0644 owner=root group=bin
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9401
            add file tmp/driver_classes path=etc/driver_classes mode=0644 owner=root group=bin
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9402
            add file tmp/minor_perm path=etc/minor_perm mode=0644 owner=root group=bin
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9403
            add file tmp/name_to_major path=etc/name_to_major mode=0644 owner=root group=bin
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9404
            add file tmp/device_policy path=etc/security/device_policy mode=0644 owner=root group=bin
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9405
            add file tmp/extra_privs path=etc/security/extra_privs mode=0644 owner=root group=bin
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9406
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9407
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9408
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9409
        driverdb_files = {
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9410
            "tmp/devlink.tab": "",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9411
            "tmp/driver_aliases": "",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9412
            "tmp/driver_classes": "",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9413
            "tmp/minor_perm": "",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9414
            "tmp/name_to_major": "",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9415
            "tmp/device_policy": "",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9416
            "tmp/extra_privs": ""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9417
        }
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9418
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9419
        pkg_dupdrv = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9420
            open dupdriver@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9421
            add driver name=asy perms="* 0666 root sys" perms="*,cu 0600 uucp uucp"
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9422
            add driver name=asy perms="* 0666 root sys" alias=pci11c1,480
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9423
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9424
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9425
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9426
        pkg_dupdepend1 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9427
            open dupdepend1@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9428
            add depend type=require fmri=dupfilesp1
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9429
            add depend type=require fmri=dupfilesp1
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9430
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9431
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9432
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9433
        pkg_dupdepend2 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9434
            open dupdepend2@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9435
            add depend type=require fmri=dupfilesp1
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9436
            add depend type=incorporate fmri=dupfilesp1
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9437
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9438
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9439
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9440
        pkg_dupdepend3 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9441
            open dupdepend3@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9442
            add depend type=require fmri=dupfilesp1@0-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9443
            add depend type=require fmri=dupfilesp1@0-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9444
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9445
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9446
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9447
        pkg_dupdepend4 = """
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9448
            open dupdepend4@0,5.11-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9449
            add depend type=require fmri=dupfilesp1@0-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9450
            add depend type=incorporate fmri=dupfilesp1@0-0
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9451
            close
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9452
        """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9453
2608
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9454
        pkg_tripledupfilea = """
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9455
            open tripledupfilea@0,5.11-0
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9456
            add set name=variant.foo value=one
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9457
            add file tmp/file1 path=file owner=root group=other mode=0755
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9458
            close
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9459
        """
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9460
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9461
        pkg_tripledupfileb = """
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9462
            open tripledupfileb@0,5.11-0
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9463
            add set name=variant.foo value=one value=two
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9464
            add file tmp/file2 path=file owner=root group=other mode=0755
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9465
            close
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9466
        """
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9467
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9468
        pkg_tripledupfilec = """
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9469
            open tripledupfilec@0,5.11-0
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9470
            add set name=variant.foo value=one value=two
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9471
            add file tmp/file3 path=file owner=root group=other mode=0755
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9472
            close
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9473
        """
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
  9474
2613
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9475
        pkg_variantedtypes = """
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9476
            open vpath@0,5.11-0
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9477
            add set name=variant.foo value=one value=two
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9478
            add dir group=bin mode=0755 owner=root path=boot/platform \
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9479
                variant.foo=two
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9480
            add link path=boot/platform target=../platform variant.foo=one
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9481
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9482
            close
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9483
        """
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
  9484
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9485
        misc_files = ["tmp/file1", "tmp/file2", "tmp/file3", "tmp/file4",
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9486
            "tmp/unpreserved"]
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9487
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9488
        # Keep the depots around for the duration of the entire class
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9489
        persistent_setup = True
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9490
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9491
        def setUp(self):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9492
                pkg5unittest.SingleDepotTestCase.setUp(self)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9493
                self.make_misc_files(self.misc_files)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9494
                self.make_misc_files(self.userdb_files)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9495
                self.make_misc_files(self.driverdb_files)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9496
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9497
                pkgs = []
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9498
                for objname in dir(self.__class__):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9499
                        obj = getattr(self, objname)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9500
                        if objname.startswith("pkg_") and type(obj) == str:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9501
                                pkgs.append(obj)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9502
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9503
                for i in xrange(20):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9504
                        s = """
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9505
                                open massivedupdir%d@0,5.11-0
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9506
                                add dir path=usr owner=root group=%%s mode=%%s zig=%%s
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9507
                                close
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9508
                        """ % i
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9509
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9510
                        if i == 14:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9511
                                s = s % ("root", "0750", "zag")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9512
                        elif i in (1, 9):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9513
                                s = s % ("sys", "0750", "zag")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9514
                        elif i in (3, 8, 12, 17):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9515
                                s = s % ("root", "0755", "zag")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9516
                        else:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9517
                                s = s % ("sys", "0755", "zig")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9518
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9519
                        pkgs.append(s)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9520
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9521
                self.plist = self.pkgsend_bulk(self.rurl, pkgs)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9522
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  9523
        def test_multiple_files_install(self):
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9524
                """Test the behavior of pkg(1) when multiple file actions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9525
                deliver to the same pathname."""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9526
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9527
                self.image_create(self.rurl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9528
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9529
                # Duplicate files in the same package
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9530
                self.pkg("install dupfiles", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9531
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9532
                # Duplicate files in different packages, but in the same
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9533
                # transaction
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9534
                self.pkg("install dupfilesp1 dupfilesp2@0", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9535
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9536
                # Duplicate files in different packages, in different
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9537
                # transactions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9538
                self.pkg("install dupfilesp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9539
                self.pkg("install dupfilesp2@0", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9540
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9541
                # Test that being in a duplicate file situation doesn't break
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9542
                # you completely and allows you to add and remove other packages
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9543
                self.pkg("-D broken-conflicting-action-handling=1 install dupfilesp2@0")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9544
                self.pkg("install implicitdirs2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9545
                self.pkg("uninstall implicitdirs2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9546
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9547
                # If the packages involved get upgraded but leave the actions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9548
                # themselves alone, we should be okay.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9549
                self.pkg("install dupfilesp2 dupfilesp3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9550
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9551
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9552
                # Test that removing one of two offending actions reverts the
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9553
                # system to a clean state.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9554
                self.pkg("uninstall dupfilesp3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9555
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9556
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9557
                # You should be able to upgrade to a fixed set of packages in
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9558
                # order to move past the problem, too.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9559
                self.pkg("uninstall dupfilesp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9560
                self.pkg("-D broken-conflicting-action-handling=1 install dupfilesp2@0")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9561
                self.pkg("update")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9562
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9563
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9564
                # If we upgrade to a version of a conflicting package that no
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9565
                # longer has the conflict, but at the same time introduce a new
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9566
                # file action at the path with different contents, we should
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9567
                # fail.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9568
                self.pkg("uninstall dupfilesp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9569
                self.pkg("-D broken-conflicting-action-handling=1 install dupfilesp2@0")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9570
                self.pkg("install dupfilesp2 dupfilesp4", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9571
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9572
                # Removing one of more than two offending actions can't do much
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9573
                # of anything, but should leave the system alone.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9574
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9575
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9576
                    "dupfilesp1 dupfilesp2@0 dupfilesp3")
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9577
                # Verify should report a duplicate action error on dupfilesp1,
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9578
                # dupfilesp2 and dupfilesp3 and shouldn't report it was failing
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9579
                # due to hashes being wrong.
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9580
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9581
                out1, err1 = self.output, self.errout
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9582
                for i, l in enumerate(self.plist):
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9583
                    if l.startswith("pkg://test/dupfilesp1"):
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9584
                        index = i
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9585
                expected = "\n  {0}\n  {1}\n  {2}".format(
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9586
                    self.plist[index], self.plist[index + 1], self.plist[index + 3])
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9587
                self.assert_(expected in err1, err1)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9588
                self.assert_("Hash" not in out1)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9589
                self.pkg("uninstall dupfilesp3")
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9590
                # Removing dupfilesp3, verify should still report a duplicate
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9591
                # action error on dupfilesp1 and dupfilesp2.
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9592
                self.pkg("verify", exit=1)
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9593
                out2, err2 = self.output, self.errout
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9594
                expected = "\n  {0}\n  {1}".format(
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9595
                    self.plist[index], self.plist[index + 1])
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9596
                self.assert_(expected in err2)
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
  9597
                self.assert_("Hash" not in out2)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9598
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9599
                # Removing all but one of the offending actions should get us
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9600
                # back to sanity.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9601
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9602
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9603
                    "dupfilesp1 dupfilesp2@0 dupfilesp3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9604
                self.pkg("uninstall dupfilesp3 dupfilesp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9605
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9606
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9607
                # Make sure we handle cleaning up multiple files properly.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9608
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9609
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9610
                    "dupfilesp1 dupfilesp2@0 dupotherfilesp1 dupotherfilesp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9611
                self.pkg("uninstall dupfilesp2 dupotherfilesp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9612
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9613
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9614
                # Re-use the overlay packages for some preserve testing.
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9615
                self.pkg("install overlaid@0")
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9616
                self.pkg("-D broken-conflicting-action-handling=1 install "
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9617
                    "invalid-overlayer")
2274
1c8cd2ff57d3 17958 when fixing duplicate action conflicts after uninstall, pkg should leave editable files alone
Danek Duvall <danek.duvall@oracle.com>
parents: 2273
diff changeset
  9618
                # We may have been able to lay down the package, but because the
1c8cd2ff57d3 17958 when fixing duplicate action conflicts after uninstall, pkg should leave editable files alone
Danek Duvall <danek.duvall@oracle.com>
parents: 2273
diff changeset
  9619
                # file is marked preserve=true, we didn't actually overwrite
1c8cd2ff57d3 17958 when fixing duplicate action conflicts after uninstall, pkg should leave editable files alone
Danek Duvall <danek.duvall@oracle.com>
parents: 2273
diff changeset
  9620
                self.file_contains("etc/pam.conf", "file2")
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9621
                self.pkg("uninstall invalid-overlayer")
2274
1c8cd2ff57d3 17958 when fixing duplicate action conflicts after uninstall, pkg should leave editable files alone
Danek Duvall <danek.duvall@oracle.com>
parents: 2273
diff changeset
  9622
                self.file_contains("etc/pam.conf", "file2")
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9623
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9624
                # Make sure we get rid of all implicit directories.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9625
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9626
                self.pkg("install implicitdirs3 implicitdirs4")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9627
                self.pkg("uninstall implicitdirs3 implicitdirs4")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9628
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9629
                if os.path.isdir(os.path.join(self.get_img_path(), "usr/bin")):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9630
                        self.assert_(False, "Directory 'usr/bin' should not exist")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9631
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9632
                if os.path.isdir(os.path.join(self.get_img_path(), "usr")):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9633
                        self.assert_(False, "Directory 'usr' should not exist")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9634
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9635
                # Make sure identical actions don't cause problems
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9636
                self.pkg("install -nv identicalfiles", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9637
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9638
                # Trigger a bug similar to 17943 via duplicate files.
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9639
                self.pkg("publisher")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9640
                self.pkg("-D broken-conflicting-action-handling=1 install "
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9641
                    "dupfilesp1@0 dupfilesp2@0 dupfilesp3@0 dupotherfilesp1@0 "
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9642
                    "dupotherfilesp2@0 dupotherfilesp3@0")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9643
                self.pkg("update")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
  9644
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9645
                # If an uninstall causes a fixup to happen and we can't because
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9646
                # we lost the cached files and the repo is down, make sure we
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9647
                # fail before actually uninstalling anything.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9648
                self.dc.start()
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9649
                self.pkgsend_bulk(self.durl, (self.pkgremote_pkg1,
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9650
                    self.pkgremote_pkg2))
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9651
                self.image_create(self.durl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9652
                self.pkg("install pkg1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9653
                self.pkg("-D broken-conflicting-action-handling=1 install pkg2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9654
                self.pkg("verify pkg2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9655
                self.dc.stop()
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9656
                self.pkg("uninstall pkg2", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9657
                self.pkg("verify pkg2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
  9658
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
  9659
        def test_overlay_files_install(self):
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9660
                """Test the behaviour of pkg(1) when actions for editable files
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9661
                overlay other actions."""
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9662
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9663
                # Ensure that overlay is allowed for file actions when one
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9664
                # action has specified preserve attribute and overlay=allow,
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9665
                # and *one* (only) other action has specified overlay=true
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9666
                # (preserve does not have to be set).
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9667
                self.image_create(self.rurl)
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9668
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9669
                # Ensure boring package is installed as conflict checking is
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9670
                # bypassed (and thus, overlay semantics) if all packages are
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9671
                # removed from an image.
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9672
                self.pkg("install boring")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9673
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9674
                # Should fail because one action specified overlay=allow,
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9675
                # but not preserve (it isn't editable).
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9676
                self.pkg("install invalid-overlaid")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9677
                self.pkg("install overlayer", exit=1)
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9678
                self.pkg("uninstall invalid-overlaid")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9679
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9680
                # Should fail because one action is overlayable but overlaying
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9681
                # action doesn't declare its intent to overlay.
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9682
                self.pkg("install overlaid@0")
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9683
                self.file_contains("etc/pam.conf", "file1")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9684
                self.pkg("install invalid-overlayer", exit=1)
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9685
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9686
                # Should fail because one action is overlayable but overlaying
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9687
                # action mode, owner, and group attributes don't match.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9688
                self.pkg("install mismatch-overlayer", exit=1)
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9689
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9690
                # Should succeed because one action is overlayable and
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9691
                # overlaying action declares its intent to overlay.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9692
                self.pkg("contents -m overlaid")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9693
                self.pkg("contents -mr overlayer")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9694
                self.pkg("install --parsable=0 overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9695
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9696
                    installed=["etc/pam.conf"],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9697
                )
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9698
                self.file_contains("etc/pam.conf", "file2")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9699
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9700
                # Should fail because multiple actions are not allowed to
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9701
                # overlay a single action.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9702
                self.pkg("install multi-overlayer", exit=1)
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9703
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9704
                # Should succeed even though file is different than originally
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9705
                # delivered since original package permits file modification.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9706
                self.pkg("verify overlaid overlayer")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9707
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9708
                # Should succeed because package delivering overlayable file
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9709
                # permits modification and because package delivering overlay
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9710
                # file permits modification.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9711
                self.file_append("etc/pam.conf", "zigit")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9712
                self.pkg("verify overlaid overlayer")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9713
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9714
                # Verify that the file isn't touched on uninstall of the
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9715
                # overlaying package if package being overlaid is still
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9716
                # installed.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9717
                self.pkg("uninstall --parsable=0 overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9718
                self._assertEditables()
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9719
                self.file_contains("etc/pam.conf", "zigit")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9720
                self.file_contains("etc/pam.conf", "file2")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9721
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9722
                # Verify that removing the last package delivering an overlaid
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9723
                # file removes the file.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9724
                self.pkg("uninstall --parsable=0 overlaid")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9725
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9726
                    removed=["etc/pam.conf"],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9727
                )
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9728
                self.file_doesnt_exist("etc/pam.conf")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9729
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9730
                # Verify that installing both packages at the same time results
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9731
                # in only the overlaying file being delivered.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9732
                self.pkg("install --parsable=0 overlaid@0 overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9733
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9734
                    installed=["etc/pam.conf"],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9735
                )
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9736
                self.file_contains("etc/pam.conf", "file2")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9737
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9738
                # Verify that the file isn't touched on uninstall of the
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9739
                # overlaid package if overlaying package is still installed.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9740
                self.file_append("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9741
                self.pkg("uninstall --parsable=0 overlaid")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9742
                self._assertEditables()
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9743
                self.file_contains("etc/pam.conf", "file2")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9744
                self.file_contains("etc/pam.conf", "zigit")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9745
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9746
                # Re-install overlaid package and verify that file content
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9747
                # does not change.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9748
                self.pkg("install --parsable=0 overlaid@0")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9749
                self._assertEditables()
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9750
                self.file_contains("etc/pam.conf", "file2")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9751
                self.file_contains("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9752
                self.pkg("uninstall --parsable=0 overlaid overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9753
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9754
                    removed=["etc/pam.conf"],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9755
                )
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9756
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9757
                # Should succeed because one action is overlayable and
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9758
                # overlaying action declares its intent to overlay even
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9759
                # though the overlaying action isn't marked with preserve.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9760
                self.pkg("install -nvv overlaid@0 unpreserved-overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9761
                self.pkg("install --parsable=0 overlaid@0 unpreserved-overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9762
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9763
                    installed=["etc/pam.conf"],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9764
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9765
                self.file_contains("etc/pam.conf", "unpreserved")
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9766
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9767
                # Should succeed because overlaid action permits modification
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9768
                # and contents matches overlaying action.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9769
                self.pkg("verify overlaid unpreserved-overlayer")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9770
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9771
                # Should succeed even though file has been modified since
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9772
                # overlaid action permits modification.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9773
                self.file_append("etc/pam.conf", "zigit")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9774
                self.pkg("verify overlaid")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9775
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9776
                # Should fail because overlaying action does not permit
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9777
                # modification.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9778
                self.pkg("verify unpreserved-overlayer", exit=1)
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9779
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9780
                # Should revert to content delivered by overlaying action.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9781
                self.pkg("fix unpreserved-overlayer")
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9782
                self.file_contains("etc/pam.conf", "unpreserved")
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9783
                self.file_doesnt_contain("etc/pam.conf", "zigit")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9784
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9785
                # Should revert to content delivered by overlaying action.
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9786
                self.file_append("etc/pam.conf", "zigit")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9787
                self.pkg("revert /etc/pam.conf")
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9788
                self.file_contains("etc/pam.conf", "unpreserved")
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9789
                self.file_doesnt_contain("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9790
                self.pkg("uninstall --parsable=0 unpreserved-overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9791
                self._assertEditables()
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9792
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9793
                # Should revert to content delivered by overlaid action.
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9794
                self.file_contains("etc/pam.conf", "unpreserved")
2400
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9795
                self.pkg("revert /etc/pam.conf")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9796
                self.file_contains("etc/pam.conf", "file1")
8786abc4c255 18390 allow packaging of editable files delivered by other packages
Shawn Walker <shawn.walker@oracle.com>
parents: 2382
diff changeset
  9797
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9798
                # Install overlaying package, then update overlaid package and
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9799
                # verify that file content does not change if only preserve
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9800
                # attribute changes.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9801
                self.pkg("install --parsable=0 unpreserved-overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9802
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9803
                    installed=["etc/pam.conf"],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9804
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9805
                self.file_contains("etc/pam.conf", "unpreserved")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9806
                self.pkg("install --parsable=0 overlaid@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9807
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9808
                self.file_contains("etc/pam.conf", "unpreserved")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9809
                self.pkg("uninstall --parsable=0 overlaid")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9810
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9811
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9812
                # Now update overlaid package again, and verify that file
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9813
                # content does not change even though overlaid content has.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9814
                self.pkg("install --parsable=0 overlaid@2")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9815
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9816
                self.file_contains("etc/pam.conf", "unpreserved")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9817
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9818
                # Now update overlaid package again this time as part of a
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9819
                # rename, and verify that file content does not change even
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9820
                # though file has moved between packages.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9821
                self.pkg("install --parsable=0 overlaid@3")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9822
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9823
                self.file_contains("etc/pam.conf", "unpreserved")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9824
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9825
                # Verify that unpreserved overlay is not salvaged when both
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9826
                # overlaid and overlaying package are removed at the same time.
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9827
                # (Preserved files are salvaged if they have been modified on
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9828
                # uninstall.)
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9829
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9830
                # Ensure directory is empty before testing.
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9831
                api_inst = self.get_img_api_obj()
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9832
                img_inst = api_inst.img
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9833
                sroot = os.path.join(img_inst.imgdir, "lost+found")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9834
                shutil.rmtree(sroot)
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9835
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9836
                # Verify etc directory not found after uninstall.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9837
                self.pkg("uninstall --parsable=0 overlaid-renamed "
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9838
                    "unpreserved-overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9839
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9840
                    removed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9841
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9842
                salvaged = [
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9843
                    n for n in os.listdir(sroot)
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9844
                    if n.startswith("etc")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9845
                ]
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9846
                self.assertEqualDiff(salvaged, [])
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9847
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9848
                # Next, update overlaid package again this time as part of a
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9849
                # file move.  Verify that the configuration file exists at both
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9850
                # the new location and the old location, that the content has
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9851
                # not changed in either, and that the new configuration exists
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9852
                # as expected as ".new".
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9853
                self.pkg("install --parsable=0 overlaid-renamed@3 "
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9854
                    "unpreserved-overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9855
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9856
                    installed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9857
                )
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9858
                self.pkg("install -nvv [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9859
                self.pkg("install --parsable=0 [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9860
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9861
                    moved=[['etc/pam.conf', 'etc/pam/pam.conf']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9862
                    installed=['etc/pam/pam.conf.new'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9863
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9864
                self.file_contains("etc/pam.conf", "unpreserved")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9865
                self.file_contains("etc/pam/pam.conf", "unpreserved")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9866
                self.file_contains("etc/pam/pam.conf.new", "file4")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9867
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9868
                # Verify etc/pam.conf not salvaged after uninstall as overlay
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9869
                # file has not been changed.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9870
                self.pkg("uninstall --parsable=0 overlaid-renamed "
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9871
                    "unpreserved-overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9872
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9873
                    removed=['etc/pam.conf', 'etc/pam/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9874
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9875
                salvaged = [
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9876
                    n for n in os.listdir(os.path.join(sroot, "etc"))
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9877
                    if n.startswith("pam.conf")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9878
                ]
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9879
                self.assertEqualDiff(salvaged, [])
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9880
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9881
                # Next, repeat the same set of tests performed above for renames
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9882
                # and moves with an overlaying, preserved file.
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9883
                #
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9884
                # Install overlaying package, then update overlaid package and
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9885
                # verify that file content does not change if only preserve
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9886
                # attribute changes.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9887
                self.pkg("install --parsable=0 overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9888
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9889
                    installed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9890
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9891
                self.file_contains("etc/pam.conf", "file2")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9892
                self.file_append("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9893
                self.pkg("install --parsable=0 overlaid@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9894
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9895
                self.file_contains("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9896
                self.pkg("uninstall --parsable=0 overlaid")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9897
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9898
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9899
                # Now update overlaid package again, and verify that file
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9900
                # content does not change even though overlaid content has.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9901
                self.pkg("install --parsable=0 overlaid@2")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9902
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9903
                self.file_contains("etc/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9904
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9905
                # Now update overlaid package again this time as part of a
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9906
                # rename, and verify that file content does not change even
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9907
                # though file has moved between packages.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9908
                self.pkg("install --parsable=0 overlaid@3")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9909
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9910
                self.file_contains("etc/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9911
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9912
                # Verify that preserved overlay is salvaged when both overlaid
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9913
                # and overlaying package are removed at the same time.
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9914
                # (Preserved files are salvaged if they have been modified on
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9915
                # uninstall.)
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9916
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9917
                # Ensure directory is empty before testing.
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9918
                api_inst = self.get_img_api_obj()
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9919
                img_inst = api_inst.img
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9920
                sroot = os.path.join(img_inst.imgdir, "lost+found")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9921
                shutil.rmtree(sroot)
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9922
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9923
                # Verify etc directory found after uninstall.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9924
                self.pkg("uninstall --parsable=0 overlaid-renamed overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9925
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9926
                    removed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9927
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9928
                salvaged = [
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9929
                    n for n in os.listdir(sroot)
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9930
                    if n.startswith("etc")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9931
                ]
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9932
                self.assertEqualDiff(salvaged, ["etc"])
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9933
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9934
                # Next, update overlaid package again, this time as part of a
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9935
                # file move where the overlay attribute was dropped.  Verify
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9936
                # that the configuration file exists at both the new location
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9937
                # and the old location, that the content has not changed in
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9938
                # either, and that the new configuration exists as expected as
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9939
                # ".new".
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9940
                self.pkg("install --parsable=0 overlaid-renamed@3 overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9941
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9942
                    installed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9943
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9944
                self.file_append("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9945
                self.pkg("install --parsable=0 [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9946
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9947
                    moved=[['etc/pam.conf', 'etc/pam/pam.conf']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9948
                    installed=['etc/pam/pam.conf.new'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9949
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9950
                self.file_contains("etc/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9951
                self.file_contains("etc/pam/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9952
                self.file_contains("etc/pam/pam.conf.new", "file4")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9953
                self.pkg("uninstall --parsable=0 overlaid-renamed overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9954
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9955
                    removed=['etc/pam.conf', 'etc/pam/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9956
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9957
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9958
                # Next, update overlaid package again, this time as part of a
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9959
                # file move.  Verify that the configuration file exists at both
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9960
                # the new location and the old location, that the content has
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9961
                # not changed in either, and that the new configuration exists
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9962
                # as expected as ".new".
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9963
                self.pkg("install --parsable=0 overlaid-renamed@3 overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9964
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9965
                    installed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9966
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9967
                self.file_append("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9968
                self.pkg("install --parsable=0 [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9969
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9970
                    moved=[['etc/pam.conf', 'etc/pam/pam.conf']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9971
                    installed=['etc/pam/pam.conf.new'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9972
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9973
                self.file_contains("etc/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9974
                self.file_contains("etc/pam/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9975
                self.file_contains("etc/pam/pam.conf.new", "file4")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9976
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9977
                # Next, downgrade the package and verify that if an overlaid
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9978
                # file moves back to its original location, the content of the
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9979
                # overlay file will not change.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9980
                self.pkg("update --parsable=0 overlaid-renamed@3")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9981
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9982
                    removed=['etc/pam/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9983
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9984
                self.file_contains("etc/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9985
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9986
                # Now upgrade again for remaining tests.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9987
                self.pkg("install --parsable=0 [email protected]")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9988
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9989
                    moved=[['etc/pam.conf', 'etc/pam/pam.conf']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9990
                    installed=['etc/pam/pam.conf.new'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9991
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9992
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9993
                # Verify etc/pam.conf and etc/pam/pam.conf salvaged after
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9994
                # uninstall as overlay file and overlaid file is different from
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9995
                # packaged.
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
  9996
                shutil.rmtree(sroot)
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9997
                self.pkg("uninstall --parsable=0 overlaid-renamed overlayer")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9998
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
  9999
                    removed=['etc/pam.conf', 'etc/pam/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10000
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10001
                salvaged = sorted(
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10002
                    n for n in os.listdir(os.path.join(sroot, "etc"))
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10003
                    if n.startswith("pam")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10004
                )
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10005
                # Should have three entries; one should be 'pam' directory
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10006
                # (presumably containing pam.conf-X...), another a file starting
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10007
                # with 'pam.conf', and finally a 'pam-XXX' directory containing
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10008
                # the 'pam.conf.new-XXX'.
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10009
                self.assertEqualDiff(salvaged[0], "pam")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10010
                self.assert_(salvaged[1].startswith("pam-"),
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10011
                    msg=str(salvaged))
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10012
                self.assert_(salvaged[2].startswith("pam.conf"),
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10013
                    msg=str(salvaged))
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10014
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10015
                # Next, install overlaid package and overlaying package, then
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10016
                # upgrade each to a version where the file has changed
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10017
                # locations and verify that the content remains intact.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10018
                self.pkg("install --parsable=0 overlaid@0 overlayer-move@0")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10019
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10020
                    installed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10021
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10022
                self.file_append("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10023
                self.pkg("install --parsable=0 overlaid@3")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10024
                self._assertEditables()
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10025
                self.file_contains("etc/pam.conf", "zigit")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10026
                self.pkg("install --parsable=0 [email protected] "
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10027
                    "overlayer-move@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10028
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10029
                    moved=[['etc/pam.conf', 'etc/pam/pam.conf']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10030
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10031
                self.file_contains("etc/pam/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10032
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10033
                # Next, downgrade overlaid-renamed and overlaying package to
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10034
                # versions where the file is restored to its original location
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10035
                # and verify that the content is reverted to the original
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10036
                # overlay version since this is a downgrade.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10037
                self.pkg("update --parsable=0 overlaid-renamed@3 "
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10038
                    "overlayer-move@0")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10039
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10040
                    removed=['etc/pam/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10041
                    installed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10042
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10043
                self.file_contains("etc/pam.conf", "file2")
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10044
                self.pkg("uninstall --parsable=0 overlaid-renamed overlayer-move")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10045
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10046
                    removed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10047
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10048
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10049
                # Next, install overlaid package and overlaying package and
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10050
                # verify preserve acts as expected for overlay package as it is
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10051
                # updated.
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10052
                self.pkg("install --parsable=0 overlaid@2 overlayer-update@0")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10053
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10054
                    installed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10055
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10056
                self.file_contains("etc/pam.conf", "file1")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10057
                # unpreserved -> preserved
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10058
                self.pkg("install --parsable=0 overlayer-update@1")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10059
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10060
                    updated=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10061
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10062
                self.file_contains("etc/pam.conf", "file2")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10063
                self.file_append("etc/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10064
                # preserved -> renameold
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10065
                self.pkg("install --parsable=0 overlayer-update@2")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10066
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10067
                    moved=[['etc/pam.conf', 'etc/pam.conf.old']],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10068
                    installed=['etc/pam.conf'],
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10069
                )
2909
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10070
                self.file_doesnt_contain("etc/pam.conf", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10071
                self.file_contains("etc/pam.conf.old", "zigit")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10072
                self.file_append("etc/pam.conf", "zagat")
bcafb737718d 16764165 overlay files may be removed unexpectedly during pkg operations
Shawn Walker <shawn.walker@oracle.com>
parents: 2876
diff changeset
 10073
                # renameold -> renamenew
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10074
                self.pkg("install --parsable=0 overlayer-update@3")
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10075
                self._assertEditables(
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10076
                    installed=['etc/pam.conf.new'],
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10077
                )
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10078
                self.file_contains("etc/pam.conf", "zagat")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10079
                self.file_contains("etc/pam.conf.new", "file4")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10080
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10081
        def test_different_types_install(self):
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10082
                """Test the behavior of pkg(1) when multiple actions of
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10083
                different types deliver to the same pathname."""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10084
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10085
                self.image_create(self.rurl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10086
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10087
                # In the same package
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10088
                self.pkg("install duppath-filelink", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10089
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10090
                # In different packages, in the same transaction
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10091
                self.pkg("install dupfilesp1 duplink", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10092
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10093
                # In different packages, in different transactions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10094
                self.pkg("install dupfilesp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10095
                self.pkg("install duplink", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10096
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10097
                # Does removal of one of the busted packages get us out of the
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10098
                # situation?
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10099
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10100
                self.pkg("-D broken-conflicting-action-handling=1 install dupfilesp1 duplink")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10101
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10102
                self.pkg("uninstall dupfilesp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10103
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10104
                self.pkg("-D broken-conflicting-action-handling=1 install dupfilesp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10105
                self.pkg("uninstall duplink")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10106
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10107
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10108
                # Implicit directory conflicts with a file
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10109
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10110
                self.pkg("install implicitdirs", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10111
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10112
                # Implicit directory coincides with a delivered directory
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10113
                self.pkg("install implicitdirs2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10114
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10115
                # Make sure that we don't die trying to fixup a directory using
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10116
                # an implicit directory action.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10117
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10118
                self.pkg("install implicitdirs4")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10119
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10120
                    "implicitdirs7")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10121
                self.pkg("uninstall implicitdirs7")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10122
                # XXX We don't currently fix up anything beneath a directory
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10123
                # that was restored, so we have to do it by hand.
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10124
                os.mkdir("%s/usr/bin" % self.img_path())
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10125
                shutil.copy("%s/tmp/file1" % self.test_root,
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10126
                    "%s/usr/bin/something" % self.img_path())
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10127
                owner = portable.get_user_by_name("root", self.img_path(), True)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10128
                group = portable.get_group_by_name("bin", self.img_path(), True)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10129
                os.chown("%s/usr/bin/something" % self.img_path(), owner, group)
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10130
                os.chmod("%s/usr/bin/something" % self.img_path(), 0755)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10131
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10132
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10133
                # Removing one of more than two offending actions can't do much
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10134
                # of anything, but should leave the system alone.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10135
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10136
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10137
                    "dupfilesp1 duplink dupdir@0")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10138
                tmap = {
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10139
                    stat.S_IFIFO: "fifo",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10140
                    stat.S_IFCHR: "character device",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10141
                    stat.S_IFDIR: "directory",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10142
                    stat.S_IFBLK: "block device",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10143
                    stat.S_IFREG: "regular file",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10144
                    stat.S_IFLNK: "symbolic link",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10145
                    stat.S_IFSOCK: "socket",
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10146
                }
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10147
                thepath = "%s/dir/pathname" % self.img_path()
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10148
                fmt = stat.S_IFMT(os.lstat(thepath).st_mode)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10149
                # XXX The checks here rely on verify failing due to action types
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10150
                # not matching what's on the system; they should probably report
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10151
                # duplicate actions instead.  Checking the output text is a bit
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10152
                # ugly, too, but we do need to make sure that the two problems
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10153
                # become one.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10154
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10155
                verify_type_re = "File Type: '(.*?)' should be '(.*?)'"
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10156
                matches = re.findall(verify_type_re, self.output)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10157
                # We make sure that what got reported is correct -- two actions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10158
                # of different types in conflict with whatever actually got laid
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10159
                # down.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10160
                self.assert_(len(matches) == 2)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10161
                whatis = matches[0][0]
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10162
                self.assert_(matches[1][0] == whatis)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10163
                self.assert_(whatis == tmap[fmt])
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10164
                shouldbe = set(["symbolic link", "regular file", "directory"]) - \
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10165
                    set([whatis])
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10166
                self.assert_(set([matches[0][1], matches[1][1]]) == shouldbe)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10167
                # Now we uninstall one of the packages delivering a type which
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10168
                # isn't what's on the filesystem.  The filesystem should remain
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10169
                # unchanged, but one of the errors should go away.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10170
                if whatis == "directory":
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10171
                        self.pkg("uninstall duplink")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10172
                else:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10173
                        self.pkg("uninstall dupdir")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10174
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10175
                matches = re.findall(verify_type_re, self.output)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10176
                self.assert_(len(matches) == 1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10177
                nfmt = stat.S_IFMT(os.lstat(thepath).st_mode)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10178
                self.assert_(nfmt == fmt)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10179
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10180
                # Now we do the same thing, but we uninstall the package
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10181
                # delivering the type which *is* what's on the filesystem.  This
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10182
                # should also leave the filesystem alone, even though what's
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10183
                # there will match *neither* of the remaining installed
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10184
                # packages.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10185
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10186
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10187
                    "dupfilesp1 duplink dupdir@0")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10188
                fmt = stat.S_IFMT(os.lstat(thepath).st_mode)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10189
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10190
                matches = re.findall(verify_type_re, self.output)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10191
                self.assert_(len(matches) == 2)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10192
                whatis = matches[0][0]
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10193
                self.assert_(matches[1][0] == whatis)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10194
                self.assert_(whatis == tmap[fmt])
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10195
                shouldbe = set(["symbolic link", "regular file", "directory"]) - \
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10196
                    set([whatis])
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10197
                self.assert_(set([matches[0][1], matches[1][1]]) == shouldbe)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10198
                if whatis == "directory":
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10199
                        self.pkg("uninstall dupdir")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10200
                elif whatis == "symbolic link":
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10201
                        self.pkg("uninstall duplink")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10202
                elif whatis == "regular file":
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10203
                        self.pkg("uninstall dupfilesp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10204
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10205
                matches = re.findall(verify_type_re, self.output)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10206
                self.assert_(len(matches) == 2)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10207
                nfmt = stat.S_IFMT(os.lstat(thepath).st_mode)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10208
                self.assert_(nfmt == fmt)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10209
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10210
                # Go from multiple conflicting types down to just one type.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10211
                # This also tests the case where a package version being newly
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10212
                # installed gets fixed at the same time.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10213
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10214
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10215
                    "dupmultitypes@1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10216
                self.pkg("install dupmultitypes")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10217
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10218
2232
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10219
                # Upgrading from multiple instances of one refcounted type to
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10220
                # multiple instances of another (here, link to directory) should
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10221
                # succeed.
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10222
                self.pkg("uninstall '*'")
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10223
                self.pkg("install dupmultitypes3@0")
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10224
                self.pkg("update")
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10225
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10226
        def test_conflicting_attrs_fs_install(self):
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10227
                """Test the behavior of pkg(1) when multiple non-file actions of
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10228
                the same type deliver to the same pathname, but whose other
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10229
                attributes differ."""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10230
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10231
                self.image_create(self.rurl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10232
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10233
                # One package, two links with different targets
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10234
                self.pkg("install duppath-nonidenticallinks", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10235
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10236
                # One package, two directories with different perms
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10237
                self.pkg("install duppath-nonidenticaldirs", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10238
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10239
                # One package, two dirs with same modes expressed two ways
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10240
                self.pkg("install duppath-almostidenticaldirs")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10241
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10242
                # One package delivers a directory explicitly, another
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10243
                # implicitly.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10244
                self.pkg("install implicitdirs2 implicitdirs3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10245
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10246
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10247
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10248
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10249
                # Make sure that we don't die trying to fixup a directory using
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10250
                # an implicit directory action.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10251
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10252
                    "implicitdirs4 implicitdirs5 implicitdirs6")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10253
                self.pkg("uninstall implicitdirs5")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10254
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10255
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10256
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10257
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10258
                # Make sure that we don't die trying to fixup a directory using
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10259
                # an implicit directory action when that's all that's left.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10260
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10261
                    "implicitdirs4 implicitdirs5 implicitdirs6")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10262
                self.pkg("uninstall implicitdirs5 implicitdirs6")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10263
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10264
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10265
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10266
2232
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10267
                # If two packages deliver conflicting directories and another
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10268
                # package delivers that directory implicitly, make sure the
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10269
                # third package isn't blamed.
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10270
                self.pkg("install implicitdirs4 implicitdirs5 implicitdirs6",
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10271
                    exit=1)
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10272
                self.assert_("implicitdirs4" not in self.errout)
19fb8816dac6 17894 upgrade converting multiples of one type of action to another type fails
Danek Duvall <danek.duvall@oracle.com>
parents: 2230
diff changeset
 10273
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10274
                # Two packages, two links with different targets, installed at
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10275
                # once
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10276
                self.pkg("install duppath-nonidenticallinksp1 "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10277
                    "duppath-nonidenticallinksp2@0", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10278
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10279
                # Two packages, two links with different targets, installed
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10280
                # separately
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10281
                self.pkg("install duppath-nonidenticallinksp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10282
                self.pkg("install duppath-nonidenticallinksp2@0", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10283
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10284
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10285
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10286
                # If we get into a broken state, can we get out of it?
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10287
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10288
                    "duppath-nonidenticallinksp1 duppath-nonidenticallinksp2@0")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10289
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10290
                self.pkg("install duppath-nonidenticallinksp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10291
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10292
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10293
                # If we get into a broken state, can we make it a little bit
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10294
                # better by uninstalling one of the packages?  Removing dupdir5
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10295
                # here won't reduce the number of different groups under which
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10296
                # dir is delivered, but does reduce the number of actions
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10297
                # delivering it.
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10298
                self.pkg("uninstall '*'")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10299
                self.pkg("-D broken-conflicting-action-handling=1 install "
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10300
                    "dupdirp1 dupdirp2@1 dupdirp5 dupdirp6")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10301
                self.pkg("uninstall dupdirp5")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10302
                self.pkg("verify", exit=1)
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10303
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10304
                self.pkg("-D broken-conflicting-action-handling=1 install "
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10305
                    "dupdirp5")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10306
                # Make sure we can install a package delivering an implicit
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10307
                # directory that's currently in conflict.
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10308
                self.pkg("install dupdirp7")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10309
                # And make sure we can uninstall it again.
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10310
                self.pkg("uninstall dupdirp7")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10311
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10312
                # Removing the remaining conflicts in a couple of steps should
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10313
                # result in a verifiable system.
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10314
                self.pkg("uninstall dupdirp2")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10315
                self.pkg("uninstall dupdirp5 dupdirp6")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10316
                self.pkg("verify")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10317
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10318
                # Add everything back in, remove everything but one variant of
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10319
                # the directory and an implicit directory, and verify.
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10320
                self.pkg("-D broken-conflicting-action-handling=1 install "
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10321
                    "dupdirp2@1 dupdirp5 dupdirp6 dupdirp7")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10322
                self.pkg("uninstall dupdirp2 dupdirp5 dupdirp6")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10323
                self.pkg("verify")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10324
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10325
                # Get us into a saner state by upgrading.
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10326
                self.pkg("-D broken-conflicting-action-handling=1 install "
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10327
                    "dupdirp2@1 dupdirp5 dupdirp6")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10328
                self.pkg("update dupdirp2@2")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10329
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10330
                # Get us into a sane state by upgrading.
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10331
                self.pkg("uninstall dupdirp2 dupdirp5 dupdirp6")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10332
                self.pkg("-D broken-conflicting-action-handling=1 install "
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10333
                    "dupdirp2@1")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10334
                self.pkg("update dupdirp2@2")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10335
                self.pkg("verify")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10336
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10337
                # We start in a sane state, but the update would result in
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10338
                # conflict, though no more actions deliver the path in
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10339
                # question.
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10340
                self.pkg("uninstall '*'")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10341
                self.pkg("install dupdirp1 dupdirp8@1")
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10342
                self.pkg("update", exit=1)
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10343
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10344
                # How about removing one of the conflicting packages?  We'll
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10345
                # remove the package which doesn't match the state on disk.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10346
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10347
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10348
                    "duppath-nonidenticallinksp1 duppath-nonidenticallinksp2@0")
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10349
                link = os.readlink("%s/dir/pathname" % self.img_path())
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10350
                if link == "dir/something":
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10351
                        self.pkg("uninstall duppath-nonidenticallinksp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10352
                else:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10353
                        self.pkg("uninstall duppath-nonidenticallinksp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10354
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10355
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10356
                # Now we'll try removing the package which *does* match the
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10357
                # state on disk.  The code should clean up after us.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10358
                self.pkg("uninstall '*'")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10359
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10360
                    "duppath-nonidenticallinksp1 duppath-nonidenticallinksp2@0")
2339
aa5954c06b9d 16148 need linked image support for zones, phase 1
Edward Pilatowicz <edward.pilatowicz@oracle.com>
parents: 2336
diff changeset
 10361
                link = os.readlink("%s/dir/pathname" % self.img_path())
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10362
                if link == "dir/something":
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10363
                        self.pkg("uninstall duppath-nonidenticallinksp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10364
                else:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10365
                        self.pkg("uninstall duppath-nonidenticallinksp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10366
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10367
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10368
                # Let's try a duplicate directory delivered with all sorts of
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10369
                # crazy conflicts!
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10370
                self.pkg("uninstall '*'")
2239
64cd1579ce6a 17933 can't uninstall your way one step at a time from a conflicting scenario
Danek Duvall <danek.duvall@oracle.com>
parents: 2232
diff changeset
 10371
                self.pkg("install dupdirp1 dupdirp2@1 dupdirp3 dupdirp4", exit=1)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10372
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10373
                pkgs = " ".join("massivedupdir%d" % x for x in xrange(20))
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10374
                self.pkg("install %s" % pkgs, exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10375
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10376
                # Trigger bug 17943: we install packages with conflicts in two
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10377
                # directories (p9, p10).  We also install a package (p11) which
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10378
                # delivers those directories implicitly.  Then remove the last,
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10379
                # triggering the stack trace associated with the bug.
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10380
                self.pkg("-D broken-conflicting-action-handling=1 install "
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10381
                    "dupdirp9 dupdirp10 dupdirp11")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10382
                self.pkg("uninstall dupdirp11")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10383
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10384
                # Do the same, but with a package that delivers var implicitly
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10385
                # via a legacy action.
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10386
                self.pkg("-D broken-conflicting-action-handling=1 install "
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10387
                    "dupdirp12")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10388
                self.pkg("uninstall dupdirp12")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10389
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10390
        def test_conflicting_attrs_fs_varcets(self):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10391
                """Test the behavior of pkg(1) when multiple non-file actions of
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10392
                the same type deliver to the same pathname, but differ in their
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10393
                variants or facets."""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10394
3063
bbaaf1579de3 15744850 no actuators are run when pkg manipulates a booted NGZ image from the GZ
thejaswini.k@oracle.com
parents: 3048
diff changeset
 10395
                install_cmd = "install"
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10396
                self.image_create(self.rurl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10397
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10398
                # Two packages delivering the same directory, one under the
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10399
                # current architecture, the other not tagged with an arch
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10400
                # variant.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10401
                self.pkg("%s dupfilesv1 dupfilesv2" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10402
                self.dir_exists("dir/pathname")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10403
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10404
                # Two packages delivering the same directory with different
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10405
                # attributes -- one under the current architecture, the other
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10406
                # tagged with another arch variant.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10407
                self.pkg("uninstall '*'")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10408
                self.pkg("%s dupfilesv1 dupfilesv3" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10409
                if platform.processor() == "sparc":
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10410
                        self.dir_exists("dir/pathname", mode=0777)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10411
                else:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10412
                        self.dir_exists("dir/pathname", mode=0755)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10413
2211
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10414
                # Two packages delivering a file at the same path where one is
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10415
                # tagged only for non-global zones should install successfully
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10416
                # together in a global zone.
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10417
                self.pkg("uninstall '*'")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10418
                self.pkg("%s dupfilesv5 dupfilesv6" % install_cmd)
2211
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10419
                path = os.path.join(self.get_img_path(), "dir/pathname")
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10420
                try:
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10421
                        f = open(path)
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10422
                except OSError, e:
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10423
                        if e.errno == errno.ENOENT:
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10424
                                self.assert_(False, "File dir/pathname does not exist")
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10425
                        else:
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10426
                                raise
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10427
                self.assertEqual(f.read().rstrip(), "tmp/file2")
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10428
                f.close()
550bbcf39f88 17851 test that NGZ-marked action doesn't conflict with zone-unmarked action in GZ
Danek Duvall <danek.duvall@oracle.com>
parents: 2205
diff changeset
 10429
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10430
                # Two packages delivering the same directory, one with the
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10431
                # devel facet false, the other true.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10432
                self.pkg("uninstall '*'")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10433
                self.pkg("%s dupfilesf1 dupfilesf2" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10434
                self.dir_exists("dir/pathname")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10435
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10436
                # Two packages delivering the same directory, one with the
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10437
                # devel facet true, the other without.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10438
                self.pkg("uninstall '*'")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10439
                self.pkg("%s dupfilesf1 dupfilesf3" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10440
                self.dir_exists("dir/pathname")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10441
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10442
                # Two packages delivering the same directory, one with the
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10443
                # devel facet false, the other without.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10444
                self.pkg("uninstall '*'")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10445
                self.pkg("%s dupfilesf2 dupfilesf3" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10446
                self.dir_exists("dir/pathname")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10447
2261
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10448
        def test_conflicting_uninstall_publisher(self):
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10449
                """Test the behaviour of pkg(1) when attempting to remove
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10450
                conflicting packages from a publisher which has also been
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10451
                removed."""
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10452
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10453
                self.conflicting_uninstall_publisher_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10454
                self.conflicting_uninstall_publisher_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10455
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10456
        def conflicting_uninstall_publisher_helper(self, install_cmd):
2261
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10457
                self.image_create(self.rurl)
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10458
                # Dummy publisher so test publisher can be removed.
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10459
                self.pkg("set-publisher -P ignored")
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10460
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10461
                # If packages with conflicting actions are found during
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10462
                # uninstall, and the publisher of the package has been
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10463
                # removed, uninstall should still succeed.
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10464
                self.pkg("-D broken-conflicting-action-handling=1 %s "
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10465
                    "dupdirp1 dupdirp2@1" % install_cmd)
2261
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10466
                self.pkg("unset-publisher test")
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10467
                self.pkg("uninstall dupdirp2")
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10468
                self.pkg("verify")
3c66f438398d 17961 pkg verify aborts if a package from a removed publisher is installed
Shawn Walker <shawn.walker@oracle.com>
parents: 2260
diff changeset
 10469
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10470
        def test_change_varcet(self):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10471
                """Test the behavior of pkg(1) when changing a variant or a
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10472
                facet would cause the new image to contain conflicting
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10473
                actions."""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10474
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10475
                # Create the image as an x86 image, as the first test only works
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10476
                # changing variant from x86 to sparc.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10477
                self.image_create(self.rurl, variants={"variant.arch": "i386"})
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10478
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10479
                # The x86 variant is safe, but the sparc variant has two files
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10480
                # with the same pathname.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10481
                self.pkg("install dupfilesv4")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10482
                self.pkg("change-variant arch=sparc", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10483
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10484
                # With the devel facet turned off, the package is safe, but
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10485
                # turning it on would cause a duplicate file to be added.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10486
                self.pkg("change-facet devel=false")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10487
                self.pkg("install dupfilesf4")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10488
                self.pkg("change-facet devel=true", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10489
2608
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10490
        def test_change_variant_removes_package(self):
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10491
                """Test that a change-variant that removes a package and
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10492
                improves but doesn't fix a conflicting action situation is
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10493
                allowed."""
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10494
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10495
                self.image_create(self.rurl, variants={"variant.foo": "one"})
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10496
                self.pkg("install tripledupfileb")
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10497
                self.pkg("-D broken-conflicting-action-handling=1 install "
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10498
                    "tripledupfilec")
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10499
                self.pkg("-D broken-conflicting-action-handling=1 install "
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10500
                    "tripledupfilea")
2910
2bb9f6ffdff9 15654935 pkg facet/variant should also display those implicitly set
Shawn Walker <shawn.walker@oracle.com>
parents: 2909
diff changeset
 10501
                self.pkg("change-variant -vvv variant.foo=two")
2bb9f6ffdff9 15654935 pkg facet/variant should also display those implicitly set
Shawn Walker <shawn.walker@oracle.com>
parents: 2909
diff changeset
 10502
                self.pkg("change-variant -vvv variant.foo=one", exit=1)
2608
2231afa43dc7 19104 CliTestCase.pkgsend needs to display traceback when pkgsend tracesback
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2606
diff changeset
 10503
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10504
        def dir_exists(self, path, mode=None, owner=None, group=None):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10505
                dir_path = os.path.join(self.get_img_path(), path)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10506
                try:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10507
                        st = os.stat(dir_path)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10508
                except OSError, e:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10509
                        if e.errno == errno.ENOENT:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10510
                                self.assert_(False, "Directory %s does not exist" % path)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10511
                        else:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10512
                                raise
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10513
                if mode is not None:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10514
                        self.assert_(stat.S_IMODE(st.st_mode) == mode)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10515
                if owner is not None:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10516
                        self.assert_(st.st_uid == owner)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10517
                if group is not None:
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10518
                        self.assert_(st.st_gid == group)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10519
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10520
        def test_multiple_users_install(self):
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10521
                """Test the behavior of pkg(1) when multiple user actions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10522
                deliver the same user."""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10523
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10524
                # This is largely identical to test_multiple_files; we may want
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10525
                # to commonize in the future.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10526
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10527
                self.image_create(self.rurl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10528
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10529
                self.pkg("install userdb")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10530
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10531
                # Duplicate users in the same package
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10532
                self.pkg("install dupuser", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10533
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10534
                # Duplicate users in different packages, but in the same
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10535
                # transaction
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10536
                self.pkg("install dupuserp1 dupuserp2@0", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10537
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10538
                # Duplicate users in different packages, in different
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10539
                # transactions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10540
                self.pkg("install dupuserp1")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10541
                self.pkg("install dupuserp2@0", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10542
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10543
                # Test that being in a duplicate user situation doesn't break
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10544
                # you completely and allows you to add and remove other packages
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10545
                self.pkg("-D broken-conflicting-action-handling=1 install "
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10546
                    "dupuserp2@0")
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10547
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10548
                self.pkg("install otheruser")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10549
                self.pkg("uninstall otheruser")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10550
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10551
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10552
                # If the packages involved get upgraded but leave the actions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10553
                # themselves alone, we should be okay.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10554
                self.pkg("install dupuserp2 dupuserp3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10555
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10556
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10557
                # Test that removing one of two offending actions reverts the
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10558
                # system to a clean state.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10559
                self.pkg("uninstall dupuserp3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10560
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10561
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10562
                # You should be able to upgrade to a fixed set of packages in
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10563
                # order to move past the problem, too.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10564
                self.pkg("uninstall dupuserp2")
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10565
                self.pkg("-D broken-conflicting-action-handling=1 install "
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10566
                    "dupuserp2@0")
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10567
                self.pkg("update")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10568
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10569
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10570
                # If we upgrade to a version of a conflicting package that no
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10571
                # longer has the conflict, but at the same time introduce a new
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10572
                # conflicting user action, we should fail.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10573
                self.pkg("uninstall dupuserp2")
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10574
                self.pkg("-D broken-conflicting-action-handling=1 install "
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10575
                    "dupuserp2@0")
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10576
                self.pkg("install dupuserp2 dupuserp4", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10577
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10578
                # Removing one of more than two offending actions can't do much
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10579
                # of anything, but should leave the system alone.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10580
                self.image_destroy()
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10581
                self.image_create(self.rurl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10582
                self.pkg("install userdb")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10583
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10584
                    "dupuserp1 dupuserp2@0 dupuserp3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10585
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10586
                out1 = self.output
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10587
                self.pkg("uninstall dupuserp3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10588
                self.pkg("verify", exit=1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10589
                out2 = self.output
3172
243877a6f4b3 18552803 pkg needs optional and debug facets that default to false
saurabh.vyas@oracle.com
parents: 3134
diff changeset
 10590
                out2 = out2[out2.index("STATUS\n") + 7:]
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10591
                self.assert_(out2 in out1)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10592
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10593
                # Removing all but one of the offending actions should get us
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10594
                # back to sanity.
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10595
                self.image_destroy()
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10596
                self.image_create(self.rurl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10597
                self.pkg("install userdb")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10598
                self.pkg("-D broken-conflicting-action-handling=1 install "
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10599
                    "dupuserp1 dupuserp2@0 dupuserp3")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10600
                self.pkg("uninstall dupuserp3 dupuserp2")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10601
                self.pkg("verify")
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10602
2277
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10603
                # Make sure we don't get confused when two actions in different
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10604
                # namespace groups but with the same key attribute value are
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10605
                # adjacent in the action cache.
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10606
                self.pkg("-D broken-conflicting-action-handling=1 install "
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10607
                    "otheruser othergroup@0")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10608
                self.pkg("update othergroup")
8745d06c2826 17943 Traceback when improving, but not fixing, multiple conflicting actions
Danek Duvall <danek.duvall@oracle.com>
parents: 2274
diff changeset
 10609
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10610
        def test_multiple_drivers(self):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10611
                """Test the behavior of pkg(1) when multiple driver actions
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10612
                deliver the same driver."""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10613
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10614
                self.multiple_drivers_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10615
                self.multiple_drivers_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10616
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10617
        def multiple_drivers_helper(self, install_cmd):
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10618
                self.image_create(self.rurl)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10619
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10620
                self.pkg("%s driverdb" % install_cmd)
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10621
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10622
                self.pkg("%s dupdriver" % install_cmd, exit=1)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10623
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10624
        def test_multiple_depend(self):
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10625
                """Test to make sure we can have multiple depend actions on
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10626
                (more or less) the same fmri"""
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10627
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10628
                self.multiple_depend_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10629
                self.multiple_depend_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10630
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10631
        def multiple_depend_helper(self, install_cmd):
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10632
                self.image_create(self.rurl)
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10633
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10634
                # Two identical unversioned require dependencies
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10635
                self.pkg("%s dupdepend1" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10636
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10637
                # Two dependencies of different types on an identical
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10638
                # unversioned fmri
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10639
                self.pkg("%s dupdepend2" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10640
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10641
                # Two identical versioned require dependencies
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10642
                self.pkg("%s dupdepend3" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10643
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10644
                # Two dependencies of different types on an identical versioned
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10645
                # fmri
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10646
                self.pkg("%s dupdepend4" % install_cmd)
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10647
2613
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
 10648
        def test_varianted_types(self):
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
 10649
                """Test that actions which would otherwise conflict but are
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
 10650
                delivered under different variants don't conflict."""
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
 10651
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10652
                self.varianted_types_helper("install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10653
                self.varianted_types_helper("exact-install")
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10654
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10655
        def varianted_types_helper(self, install_cmd):
2613
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
 10656
                self.pkg_image_create(repourl=self.rurl,
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
 10657
                    additional_args="--variant foo=one")
3048
2aecfba95fe8 16986557 prefixes should be omitted from output of facet and variant
saurabh.vyas@oracle.com
parents: 2966
diff changeset
 10658
                self.pkg("%s vpath" % install_cmd)
2613
38becc0c5685 7129625 pkg fails to install install-image/solaris-auto-install for sparc variant in s11u1_07.
Brock Pytlik <brock.pytlik@oracle.com>
parents: 2608
diff changeset
 10659
2205
53d0be594162 3822 image plans should prevent conflicting actions from being installed
Danek Duvall <danek.duvall@oracle.com>
parents: 2200
diff changeset
 10660
3283
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10661
class TestPkgInstallExplicitInstall(pkg5unittest.SingleDepotTestCase):
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10662
        """Test pkg.depend.explicit-install action behaviors."""
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10663
        persistent_setup = True
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10664
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10665
        pkgs = (
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10666
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10667
                    open [email protected],5.11-0
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10668
                    add depend type=group fmri=pkg:/A
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10669
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10670
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10671
                    open [email protected],5.11-0
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10672
                    add depend type=incorporate fmri=pkg:/[email protected],5.11-0.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10673
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10674
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10675
                    open [email protected],5.11-0.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10676
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10677
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10678
                    open [email protected],5.11-0.1.1.0
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10679
                    add depend type=require fmri=pkg:/[email protected],5.11-0.1.1.0
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10680
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10681
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10682
                    open [email protected],5.11-0.1.1.0
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10683
                    add set name=pkg.depend.explicit-install value=true
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10684
                    add depend type=incorporate fmri=pkg:/[email protected],5.11-0.1.1.0
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10685
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10686
        )
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10687
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10688
        pkgs2 = (
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10689
                 """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10690
                    open [email protected],5.11-0.1.1.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10691
                    add depend type=require fmri=pkg:/[email protected],5.11-0.1.1.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10692
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10693
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10694
                    open [email protected],5.11-0.1.1.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10695
                    add set name=pkg.depend.explicit-install value=false
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10696
                    add depend type=incorporate fmri=pkg:/[email protected],5.11-0.1.1.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10697
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10698
        )
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10699
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10700
        pkgs3 = (
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10701
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10702
                    open [email protected],5.11-0.1.1.2
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10703
                    add depend type=require fmri=pkg:/[email protected],5.11-0.1.1.2
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10704
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10705
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10706
                    open [email protected],5.11-0.1.1.2
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10707
                    add depend type=incorporate fmri=pkg:/[email protected],5.11-0.1.1.2
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10708
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10709
        )
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10710
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10711
        pkgs4 = (
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10712
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10713
                    open [email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10714
                    add depend type=require-any fmri=pkg:/[email protected] fmri=pkg:/[email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10715
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10716
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10717
                    open [email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10718
                    add depend type=require fmri=pkg:/[email protected],5.11-0.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10719
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10720
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10721
                    open [email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10722
                    add set name=pkg.depend.explicit-install value=true
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10723
                    add depend type=require fmri=pkg:/[email protected],5.11-0.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10724
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10725
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10726
                    open [email protected],5.11-0.1
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10727
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10728
        )
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10729
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10730
        pkgs5 = (
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10731
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10732
                    open [email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10733
                    add depend type=require fmri=pkg:/[email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10734
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10735
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10736
                    open [email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10737
                    add depend type=require fmri=pkg:/[email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10738
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10739
                """
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10740
                    open [email protected]
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10741
                    add set name=pkg.depend.explicit-install value=true
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10742
                    close """,
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10743
        )
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10744
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10745
        def setUp(self):
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10746
                pkg5unittest.SingleDepotTestCase.setUp(self)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10747
                self.pkgsend_bulk(self.rurl, self.pkgs)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10748
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10749
        def test_01_install(self):
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10750
                self.image_create(self.rurl, prefix="")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10751
                # Test install works as expected.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10752
                # This will fail because [email protected] has
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10753
                # pkg.depend.explicit-install set to true.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10754
                self.pkg("install -v group incorp [email protected]", exit=1)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10755
                self.pkg("install -v group incorp")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10756
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10757
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10758
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10759
                    "A    1.0-0.1    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10760
                    "group    1.0-0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10761
                    "incorp    1.0-0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10762
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10763
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10764
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10765
                self.pkg("uninstall -v group incorp A")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10766
                self.pkg("list -H", exit=1)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10767
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10768
                # Test exact-install works as expected.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10769
                # This will fail because [email protected] has
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10770
                # pkg.depend.explicit-install set to true.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10771
                self.pkg("exact-install -v group incorp [email protected]", exit=1)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10772
                self.pkg("exact-install -v group incorp")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10773
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10774
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10775
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10776
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10777
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10778
                # Test exact-install idr.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10779
                self.pkg("exact-install -v idr")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10780
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10781
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10782
                    "idr    1.0-0.1.1.0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10783
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10784
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10785
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10786
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10787
                self.pkg("install -v group")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10788
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10789
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10790
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10791
                    "A    1.0-0.1.1.0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10792
                    "group    1.0-0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10793
                    "idr    1.0-0.1.1.0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10794
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10795
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10796
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10797
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10798
                self.pkg("uninstall -v group idr A")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10799
                self.pkg("list -H", exit=1)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10800
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10801
                self.pkg("install -v idr")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10802
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10803
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10804
                    "idr    1.0-0.1.1.0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10805
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10806
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10807
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10808
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10809
                self.pkg("install -v group")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10810
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10811
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10812
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10813
                    "A    1.0-0.1.1.0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10814
                    "group    1.0-0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10815
                    "idr    1.0-0.1.1.0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10816
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10817
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10818
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10819
                self.pkg("uninstall '*'")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10820
                self.pkg("list -H", exit=1)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10821
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10822
                self.pkgsend_bulk(self.rurl, self.pkgs2)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10823
                self.pkg("install -v group incorp")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10824
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10825
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10826
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10827
                    "A    1.0-0.1.1.1    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10828
                    "group    1.0-0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10829
                    "idr    1.0-0.1.1.1    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10830
                    "incorp    1.0-0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10831
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10832
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10833
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10834
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10835
                self.pkgsend_bulk(self.rurl, self.pkgs3)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10836
                # test updating all packages.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10837
                self.pkg("update")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10838
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10839
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10840
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10841
                    "A    1.0-0.1.1.2    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10842
                    "group    1.0-0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10843
                    "idr    1.0-0.1.1.2    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10844
                    "incorp    1.0-0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10845
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10846
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10847
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10848
                self.pkg("uninstall '*'")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10849
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10850
                self.pkgsend_bulk(self.rurl, self.pkgs4)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10851
                # test require-any with pkg.depend.explicit-install tag.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10852
                self.pkg("install C1")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10853
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10854
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10855
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10856
                    "C1    1.0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10857
                    "C2    1.0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10858
                    "C3    1.0-0.1    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10859
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10860
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10861
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10862
                self.pkg("uninstall '*'")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10863
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10864
                self.pkg("install C1 C2")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10865
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10866
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10867
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10868
                    "C1    1.0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10869
                    "C2    2.0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10870
                    "C3    1.0-0.1    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10871
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10872
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10873
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10874
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10875
                # Test hierarchic dependencies.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10876
                self.pkgsend_bulk(self.rurl, self.pkgs5)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10877
                self.pkg("install -v [email protected]", exit=1)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10878
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10879
        def test_02_updateReject(self):
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10880
                self.image_create(self.rurl, prefix="")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10881
                self.pkgsend_bulk(self.rurl, self.pkgs2)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10882
                self.pkgsend_bulk(self.rurl, self.pkgs3)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10883
                self.pkg("install -v --reject idr group incorp")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10884
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10885
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10886
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10887
                    "A    1.0-0.1    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10888
                    "group    1.0-0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10889
                    "incorp    1.0-0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10890
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10891
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10892
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10893
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10894
                self.pkg("exact-install -v --reject idr group")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10895
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10896
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10897
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10898
                    "A    1.0-0.1    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10899
                    "group    1.0-0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10900
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10901
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10902
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10903
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10904
                # This will fail, because [email protected] is filtered.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10905
                self.pkg("update -v --reject group [email protected]", exit=1)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10906
                # Explicitly install [email protected].
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10907
                self.pkg("install [email protected]")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10908
                # Update again.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10909
                self.pkg("update -v --reject group [email protected]")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10910
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10911
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10912
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10913
                    "A    1.0-0.1.1.0    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10914
                    "idr    1.0-0.1.1.0    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10915
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10916
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10917
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10918
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10919
                # This will fail.
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10920
                self.pkg("update -v --reject idr", exit=1)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10921
                self.pkg("update")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10922
                self.pkg("verify")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10923
                self.pkg("list -H")
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10924
                expected = \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10925
                    "A    1.0-0.1.1.2    i--\n" \
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10926
                    "idr    1.0-0.1.1.2    i--\n"
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10927
                output = self.reduceSpaces(self.output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10928
                expected = self.reduceSpaces(expected)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10929
                self.assertEqualDiff(expected, output)
e252ccf34944 20533255 pkg should have a mechanism to prevent pkgs from getting installed implicitly
Sowrabha H G<sowrabha.hg@oracle.com>
parents: 3230
diff changeset
 10930
3431
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10931
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10932
class TestPkgUpdateDowngradeIncorp(pkg5unittest.ManyDepotTestCase):
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10933
        persistent_setup = True
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10934
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10935
        pkgs = (
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10936
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10937
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10938
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10939
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10940
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10941
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10942
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10943
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10944
                    add set pkg.depend.install-hold=B
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10945
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10946
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10947
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10948
                    add set pkg.depend.install-hold=B
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10949
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10950
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10951
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10952
                    add set pkg.depend.install-hold=parent.C
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10953
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10954
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10955
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10956
                    add set pkg.depend.install-hold=parent.C
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10957
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10958
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10959
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10960
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10961
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10962
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10963
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10964
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10965
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10966
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10967
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10968
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10969
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10970
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10971
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10972
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10973
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10974
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10975
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10976
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10977
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10978
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10979
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10980
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10981
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10982
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10983
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10984
                    add set pkg.depend.install-hold=parent
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10985
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10986
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10987
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10988
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10989
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10990
                    add set pkg.depend.install-hold=parent
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10991
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10992
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10993
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10994
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10995
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10996
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10997
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10998
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 10999
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11000
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11001
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11002
                    add depend type=incorporate [email protected]
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11003
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11004
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11005
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11006
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11007
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11008
                )
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11009
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11010
        pub2_pkgs = (
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11011
                """
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11012
                    open [email protected],5.11-0
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11013
                    close """,
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11014
                )
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11015
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11016
        def setUp(self):
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11017
                pkg5unittest.ManyDepotTestCase.setUp(self, ["test1", "test2"])
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11018
                self.rurl = self.dcs[1].get_repo_url()
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11019
                self.rurl2 = self.dcs[2].get_repo_url()
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11020
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11021
                self.pkgsend_bulk(self.rurl, self.pkgs)
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11022
                self.pkgsend_bulk(self.rurl2, self.pub2_pkgs)
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11023
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11024
        def test_incorp_downgrade(self):
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11025
                """ Test that downgrades are allowed if they are incorporated
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11026
                by FMRIs which are requested by the user or are about to be
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11027
                updated as part of an update-all operation."""
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11028
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11029
                self.image_create(self.rurl, prefix="")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11030
                self.pkg("install A incorp@1")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11031
                self.pkg("list [email protected] [email protected]")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11032
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11033
                # When incorp moves forward, A should move backwards
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11034
                self.pkg("update incorp@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11035
                self.pkg("list [email protected] [email protected]")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11036
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11037
                # start over and test if that also works if we do an update all
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11038
                self.pkg("update incorp@1")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11039
                self.pkg("update -v")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11040
                self.pkg("list [email protected] [email protected]")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11041
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11042
                # prepare test for nested incorporations
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11043
                self.pkg("uninstall incorp")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11044
                self.pkg("update A@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11045
                self.pkg("install parent_incorp@1 child_incorp@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11046
                self.pkg("list [email protected] child_incorp@2 parent_incorp@1")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11047
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11048
                # test update of nested incorporation supports downgrade
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11049
                self.pkg("update -v parent_incorp@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11050
                self.pkg("list A@1 child_incorp@1 parent_incorp@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11051
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11052
                # prepare test for explicit downgrade of incorp
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11053
                self.pkg("uninstall parent_incorp")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11054
                self.pkg("update child_incorp@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11055
                self.pkg("list A@2 child_incorp@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11056
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11057
                # test explicit downgrade of incorp downgrades incorp'ed pkgs
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11058
                self.pkg("update -v child_incorp@1")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11059
                self.pkg("list A@1 child_incorp@1")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11060
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11061
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11062
        def test_incorp_downgrade_installhold(self):
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11063
                """Test correct handling of install-holds when determining
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11064
                which pkgs are ok to downgrade."""
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11065
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11066
                # prepare test for install-hold
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11067
                self.image_create(self.rurl, prefix="")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11068
                self.pkg("install ihold_incorp@2 B")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11069
                self.pkg("list ihold_incorp@2 B@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11070
                # test that install hold prevents downgrade
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11071
                self.pkg("update -v ihold_incorp@1", exit=1)
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11072
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11073
                # prep test for parent install-hold
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11074
                self.pkg("install --reject B C@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11075
                self.pkg("list ihold_incorp@2 C@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11076
                # test that downgrade is allowed if install-hold is child of
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11077
                # requested FMRI
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11078
                self.pkg("update -v ihold_incorp@1")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11079
                self.pkg("list ihold_incorp@1 C@1")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11080
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11081
        def test_incorp_downgrade_pubswitch(self):
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11082
                """Test that implicit publisher switches of incorporated pkgs
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11083
                are not allowed."""
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11084
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11085
                # prepare test for publisher switch
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11086
                self.image_create(self.rurl, prefix="")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11087
                self.pkg("set-publisher --non-sticky test1")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11088
                self.pkg("set-publisher --non-sticky -p {0}".format(self.rurl2))
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11089
                self.pkg("list -af")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11090
                self.pkg("install p_incorp@1 D@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11091
                self.pkg("list p_incorp@1 D@2")
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11092
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11093
                self.pkg("update p_incorp@2", exit=1)
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11094
986e4ec518b8 17699319 we could make downgrade easier in the case of incorporated packages
saurabh.vyas@oracle.com
parents: 3430
diff changeset
 11095
581
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
 11096
if __name__ == "__main__":
faca6a8e7366 3125 CLI test restructuring
erik.lafever@sun.com
parents:
diff changeset
 11097
        unittest.main()