src/tests/cli/t_pkg_install_basics.py
author Bart Smaalders <Bart.Smaalders@Sun.COM>
Fri, 01 Aug 2008 23:57:44 -0700
changeset 443 5ffa5b7dac9c
parent 432 578875da6e04
child 472 9cec1a1677e1
permissions -rw-r--r--
2589 pyc files generate lots of verify chaff 2726 pkg verify doesn't verify file or content hash by default 2680 packagemanager prototype files don't belong in the workspace
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
409
713e20963dc2 2314 shebang lines should use minimum python version
Shawn Walker <swalker@opensolaris.org>
parents: 368
diff changeset
     1
#!/usr/bin/python2.4
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
     2
#
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
     3
# CDDL HEADER START
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
     4
#
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
     8
#
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    12
# and limitations under the License.
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    13
#
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    19
#
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    20
# CDDL HEADER END
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    21
#
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    22
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    23
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    24
# Use is subject to license terms.
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    25
269
7188dcce1a82 639 cli-complete/api-complete need to set PATH
Dan Price <dp@eng.sun.com>
parents: 267
diff changeset
    26
import testutils
7188dcce1a82 639 cli-complete/api-complete need to set PATH
Dan Price <dp@eng.sun.com>
parents: 267
diff changeset
    27
if __name__ == "__main__":
7188dcce1a82 639 cli-complete/api-complete need to set PATH
Dan Price <dp@eng.sun.com>
parents: 267
diff changeset
    28
	testutils.setup_environment("../../../proto")
7188dcce1a82 639 cli-complete/api-complete need to set PATH
Dan Price <dp@eng.sun.com>
parents: 267
diff changeset
    29
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    30
import os
443
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
    31
import time
269
7188dcce1a82 639 cli-complete/api-complete need to set PATH
Dan Price <dp@eng.sun.com>
parents: 267
diff changeset
    32
import unittest
443
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
    33
from stat import *
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    34
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    35
class TestPkgInstallBasics(testutils.SingleDepotTestCase):
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    36
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    37
        foo10 = """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    38
            open [email protected],5.11-0
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    39
            close """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    40
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    41
        foo11 = """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    42
            open [email protected],5.11-0
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    43
            add dir mode=0755 owner=root group=bin path=/lib
443
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
    44
            add file /tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1 timestamp="20080731T024051Z"
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    45
            close """
443
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
    46
        foo11_timestamp = 1217472051
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    47
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    48
        foo12 = """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    49
            open [email protected],5.11-0
289
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    50
            add file /tmp/libc.so.1 mode=0555 owner=root group=bin path=/lib/libc.so.1
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    51
            close """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    52
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    53
        bar10 = """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    54
            open [email protected],5.11-0
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    55
            add depend type=require fmri=pkg:/[email protected]
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    56
            add dir mode=0755 owner=root group=bin path=/bin
289
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    57
            add file /tmp/cat mode=0555 owner=root group=bin path=/bin/cat
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    58
            close """
289
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    59
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    60
        bar11 = """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    61
            open [email protected],5.11-0
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    62
            add depend type=require fmri=pkg:/[email protected]
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    63
            add dir mode=0755 owner=root group=bin path=/bin
289
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    64
            add file /tmp/cat mode=0555 owner=root group=bin path=/bin/cat
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    65
            close """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
    66
368
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    67
        bar12 = """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    68
            open [email protected],5.11-0
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    69
            add depend type=require fmri=pkg:/[email protected]
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    70
            add dir mode=0755 owner=root group=bin path=/bin
443
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
    71
            add file /tmp/cat mode=0555 owner=root group=bin path=/bin/cat 
368
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    72
            close """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    73
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    74
        baz10 = """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    75
            open [email protected],5.11-0
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    76
            add depend type=require fmri=pkg:/[email protected]
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    77
            add dir mode=0755 owner=root group=bin path=/bin
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    78
            add file /tmp/cat mode=0555 owner=root group=bin path=/bin/cat
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    79
            close """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    80
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    81
        deep10 = """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    82
            open [email protected],5.11-0
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    83
            add depend type=require fmri=pkg:/[email protected]
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    84
            add dir mode=0755 owner=root group=bin path=/bin
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    85
            add file /tmp/cat mode=0555 owner=root group=bin path=/bin/cat
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    86
            close """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
    87
        
289
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    88
        misc_files = [ "/tmp/libc.so.1", "/tmp/cat" ]
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    89
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    90
        def setUp(self):
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    91
                testutils.SingleDepotTestCase.setUp(self)
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    92
                for p in self.misc_files:
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    93
                        f = open(p, "w")
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    94
                        # write the name of the file into the file, so that
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    95
                        # all files have differing contents
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    96
                        f.write(p)
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    97
                        f.close
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    98
                        self.debug("wrote %s" % p)
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
    99
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
   100
        def tearDown(self):
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
   101
                testutils.SingleDepotTestCase.tearDown(self)
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
   102
                for p in self.misc_files:
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
   103
                        os.remove(p)
c2e63370fb2b 160 Make IPS cross-platform for use across other supported OS's
Tom Mueller <Tom.Mueller@Sun.COM>
parents: 275
diff changeset
   104
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   105
        def test_basics_1(self):
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   106
                """ Send empty package [email protected], install and uninstall """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   107
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   108
                durl = self.dc.get_depot_url()
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   109
                self.pkgsend_bulk(durl, self.foo10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   110
                self.image_create(durl)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   111
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   112
                self.pkg("list -a")
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   113
                self.pkg("list", exit=1)
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   114
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   115
                self.pkg("install foo")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   116
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   117
                self.pkg("list")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   118
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   119
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   120
                self.pkg("uninstall foo")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   121
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   122
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   123
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   124
        def test_basics_2(self):
275
483b3ea3a704 680 Test case cli/t_pkg_install_basics:test_basics_2 failing in "pkg search -r"
Danek Duvall <danek.duvall@sun.com>
parents: 272
diff changeset
   125
                """ Send package [email protected], containing a directory and a file,
483b3ea3a704 680 Test case cli/t_pkg_install_basics:test_basics_2 failing in "pkg search -r"
Danek Duvall <danek.duvall@sun.com>
parents: 272
diff changeset
   126
                    install, search, and uninstall. """
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   127
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   128
                durl = self.dc.get_depot_url()
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   129
                self.pkgsend_bulk(durl, self.foo10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   130
                self.pkgsend_bulk(durl, self.foo11)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   131
                self.image_create(durl)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   132
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   133
                self.pkg("list -a")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   134
                self.pkg("install foo")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   135
                self.pkg("verify")
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   136
                self.pkg("list")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   137
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   138
                self.pkg("search /lib/libc.so.1")
275
483b3ea3a704 680 Test case cli/t_pkg_install_basics:test_basics_2 failing in "pkg search -r"
Danek Duvall <danek.duvall@sun.com>
parents: 272
diff changeset
   139
                self.pkg("search -r /lib/libc.so.1")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   140
                self.pkg("search blah", exit = 1)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   141
                self.pkg("search -r blah", exit = 1)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   142
443
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   143
                # check to make sure timestamp was set to correct value
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   144
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   145
                libc_path = os.path.join(self.get_img_path(), "lib/libc.so.1")
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   146
                stat = os.stat(libc_path)
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   147
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   148
                assert (stat[ST_MTIME] == self.foo11_timestamp)
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   149
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   150
                # check that verify finds changes
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   151
                now = time.time()
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   152
                os.utime(libc_path, (now, now))
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   153
                self.pkg("verify", exit=1)
5ffa5b7dac9c 2589 pyc files generate lots of verify chaff
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents: 432
diff changeset
   154
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   155
                self.pkg("uninstall foo")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   156
                self.pkg("verify")
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   157
                self.pkg("list -a")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   158
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   159
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   160
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   161
        def test_basics_3(self):
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   162
                """ Install [email protected], upgrade to [email protected], uninstall. """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   163
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   164
                durl = self.dc.get_depot_url()
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   165
                self.pkgsend_bulk(durl, self.foo10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   166
                self.pkgsend_bulk(durl, self.foo11)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   167
                self.image_create(durl)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   168
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   169
                self.pkg("install [email protected]")
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   170
                self.pkg("list [email protected]")
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   171
                self.pkg("list [email protected]", exit = 1)
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   172
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   173
                self.pkg("install [email protected]")
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   174
                self.pkg("list [email protected]")
419
a38f1ed7cf76 1867 'pkg list' takes *WAY* too long
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   175
                self.pkg("list [email protected]", exit = 1)
a38f1ed7cf76 1867 'pkg list' takes *WAY* too long
Danek Duvall <danek.duvall@sun.com>
parents: 409
diff changeset
   176
                self.pkg("list foo@1")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   177
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   178
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   179
                self.pkg("uninstall foo")
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   180
                self.pkg("list -a")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   181
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   182
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   183
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   184
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   185
        def test_basics_4(self):
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   186
                """ Add [email protected], dependent on [email protected], install, uninstall. """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   187
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   188
                durl = self.dc.get_depot_url()
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   189
                self.pkgsend_bulk(durl, self.foo10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   190
                self.pkgsend_bulk(durl, self.foo11)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   191
                self.pkgsend_bulk(durl, self.bar10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   192
                self.image_create(durl)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   193
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   194
                self.pkg("list -a")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   195
                self.pkg("install [email protected]")
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   196
                self.pkg("list")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   197
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   198
                self.pkg("uninstall -v bar foo")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   199
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   200
                # foo and bar should not be installed at this point
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   201
                self.pkg("list bar", exit = 1)
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   202
                self.pkg("list foo", exit = 1)
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   203
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   204
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   205
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   206
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   207
        def test_image_upgrade(self):
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   208
                """ Send package [email protected], dependent on [email protected].  Install [email protected].
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   209
                    List all packages.  Upgrade image. """
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   210
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   211
                durl = self.dc.get_depot_url()
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   212
                self.pkgsend_bulk(durl, self.foo10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   213
                self.pkgsend_bulk(durl, self.foo11)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   214
                self.pkgsend_bulk(durl, self.bar10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   215
                self.image_create(durl)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   216
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   217
                self.pkg("install [email protected]")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   218
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   219
                self.pkgsend_bulk(durl, self.foo12)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   220
                self.pkgsend_bulk(durl, self.bar11)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   221
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   222
                self.pkg("contents -H")
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   223
                self.pkg("list")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   224
                self.pkg("refresh")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   225
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   226
                self.pkg("list")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   227
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   228
                self.pkg("image-update -v")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   229
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   230
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   231
                self.pkg("list [email protected]")
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   232
                self.pkg("list [email protected]")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   233
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   234
                self.pkg("uninstall bar foo")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   235
                self.pkg("verify")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   236
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   237
432
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   238
        def test_recursive_uninstall(self):
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   239
                """Install [email protected], dependent on [email protected], uninstall foo recursively."""
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   240
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   241
                durl = self.dc.get_depot_url()
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   242
                self.pkgsend_bulk(durl, self.foo10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   243
                self.pkgsend_bulk(durl, self.foo11)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   244
                self.pkgsend_bulk(durl, self.bar10)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   245
                self.image_create(durl)
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   246
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   247
                self.pkg("install [email protected]")
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   248
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   249
                # Here's the real part of the regression test;
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   250
                # at this point foo and bar are installed, and
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   251
                # bar depends on foo.  foo and bar should both
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   252
                # be removed by this action.
432
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   253
                self.pkg("uninstall -vr foo")
301
35f03c7a3adc Rework status,list,info subcommands -> list,contents,info
Dan Price <dp@eng.sun.com>
parents: 289
diff changeset
   254
                self.pkg("list bar", exit = 1)
432
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   255
                self.pkg("list foo", exit = 1)
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   256
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   257
        def test_nonrecursive_dependent_uninstall(self):
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   258
                """Trying to remove a package that's a dependency of another
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   259
                package should fail if the uninstall isn't recursive."""
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   260
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   261
                durl = self.dc.get_depot_url()
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   262
                self.pkgsend_bulk(durl, self.foo10)
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   263
                self.pkgsend_bulk(durl, self.bar10)
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   264
                self.image_create(durl)
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   265
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   266
                self.pkg("install [email protected]")
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   267
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   268
                self.pkg("uninstall -v foo", exit = 1)
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   269
                self.pkg("list bar")
578875da6e04 48 Removing a dependency is not flagged, and recovery is not obvious
Danek Duvall <danek.duvall@sun.com>
parents: 419
diff changeset
   270
                self.pkg("list foo")
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   271
368
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   272
        def test_basics_5(self):
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   273
                """ Add [email protected], install [email protected]. """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   274
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   275
                durl = self.dc.get_depot_url()
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   276
                self.pkgsend_bulk(durl, self.bar11)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   277
                self.image_create(durl)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   278
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   279
                self.pkg("install [email protected]", exit = 1)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   280
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   281
        def test_bug_1338(self):
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   282
                """ Add [email protected], dependent on [email protected], install [email protected]. """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   283
                
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   284
                durl = self.dc.get_depot_url()
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   285
                self.pkgsend_bulk(durl, self.bar11)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   286
                self.image_create(durl)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   287
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   288
                self.pkg("install [email protected]", exit = 1)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   289
                
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   290
        def test_bug_1338_2(self):
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   291
                """ Add [email protected], dependent on [email protected], and [email protected], dependent
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   292
                    on [email protected], install [email protected] and [email protected]. """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   293
                
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   294
                durl = self.dc.get_depot_url()
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   295
                self.pkgsend_bulk(durl, self.bar11)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   296
                self.pkgsend_bulk(durl, self.baz10)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   297
                self.image_create(durl)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   298
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   299
                self.pkg("install [email protected] [email protected]", exit = 1)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   300
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   301
        def test_bug_1338_3(self):
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   302
                """ Add [email protected], [email protected]. [email protected] depends on [email protected] which
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   303
                    depends on [email protected], install [email protected]. """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   304
                
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   305
                durl = self.dc.get_depot_url()
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   306
                self.pkgsend_bulk(durl, self.bar10)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   307
                self.pkgsend_bulk(durl, self.deep10)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   308
                self.image_create(durl)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   309
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   310
                self.pkg("install [email protected]", exit = 1)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   311
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   312
        def test_bug_1338_4(self):
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   313
                """ Add [email protected]. [email protected] depends on [email protected] which depends on
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   314
                    [email protected], install [email protected]. """
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   315
                
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   316
                durl = self.dc.get_depot_url()
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   317
                self.pkgsend_bulk(durl, self.deep10)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   318
                self.image_create(durl)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   319
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   320
                self.pkg("install [email protected]", exit = 1)
777fb019e807 1338 traceback when installing a package with a dependency that can not be satisfied
Brock Pytlik <bpytlik@sun.com>
parents: 301
diff changeset
   321
267
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   322
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   323
if __name__ == "__main__":
1700a267bdb1 634 Rewrite CLI tests in python
Dan Price <dp@eng.sun.com>
parents:
diff changeset
   324
        unittest.main()