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-- |
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 | 2 |
# |
3 |
# CDDL HEADER START |
|
4 |
# |
|
5 |
# The contents of this file are subject to the terms of the |
|
6 |
# Common Development and Distribution License (the "License"). |
|
7 |
# You may not use this file except in compliance with the License. |
|
8 |
# |
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
10 |
# or http://www.opensolaris.org/os/licensing. |
|
11 |
# See the License for the specific language governing permissions |
|
12 |
# and limitations under the License. |
|
13 |
# |
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
16 |
# If applicable, add the following below this CDDL HEADER, with the |
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
19 |
# |
|
20 |
# CDDL HEADER END |
|
21 |
# |
|
22 |
||
23 |
# Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
|
24 |
# Use is subject to license terms. |
|
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 | 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 | 34 |
|
35 |
class TestPkgInstallBasics(testutils.SingleDepotTestCase): |
|
36 |
||
37 |
foo10 = """ |
|
38 |
open [email protected],5.11-0 |
|
39 |
close """ |
|
40 |
||
41 |
foo11 = """ |
|
42 |
open [email protected],5.11-0 |
|
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 | 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 | 47 |
|
48 |
foo12 = """ |
|
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 | 51 |
close """ |
52 |
||
53 |
bar10 = """ |
|
54 |
open [email protected],5.11-0 |
|
55 |
add depend type=require fmri=pkg:/[email protected] |
|
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 | 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 | 60 |
bar11 = """ |
61 |
open [email protected],5.11-0 |
|
62 |
add depend type=require fmri=pkg:/[email protected] |
|
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 | 65 |
close """ |
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 | 105 |
def test_basics_1(self): |
106 |
""" Send empty package [email protected], install and uninstall """ |
|
107 |
||
108 |
durl = self.dc.get_depot_url() |
|
109 |
self.pkgsend_bulk(durl, self.foo10) |
|
110 |
self.image_create(durl) |
|
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 | 114 |
|
115 |
self.pkg("install foo") |
|
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 | 118 |
self.pkg("verify") |
119 |
||
120 |
self.pkg("uninstall foo") |
|
121 |
self.pkg("verify") |
|
122 |
||
123 |
||
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 | 127 |
|
128 |
durl = self.dc.get_depot_url() |
|
129 |
self.pkgsend_bulk(durl, self.foo10) |
|
130 |
self.pkgsend_bulk(durl, self.foo11) |
|
131 |
self.image_create(durl) |
|
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 | 134 |
self.pkg("install foo") |
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 | 137 |
|
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 | 140 |
self.pkg("search blah", exit = 1) |
141 |
self.pkg("search -r blah", exit = 1) |
|
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 | 155 |
self.pkg("uninstall foo") |
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 | 158 |
self.pkg("verify") |
159 |
||
160 |
||
161 |
def test_basics_3(self): |
|
162 |
""" Install [email protected], upgrade to [email protected], uninstall. """ |
|
163 |
||
164 |
durl = self.dc.get_depot_url() |
|
165 |
self.pkgsend_bulk(durl, self.foo10) |
|
166 |
self.pkgsend_bulk(durl, self.foo11) |
|
167 |
self.image_create(durl) |
|
168 |
||
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 | 172 |
|
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 | 177 |
self.pkg("verify") |
178 |
||
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 | 181 |
self.pkg("verify") |
182 |
||
183 |
||
184 |
||
185 |
def test_basics_4(self): |
|
186 |
""" Add [email protected], dependent on [email protected], install, uninstall. """ |
|
187 |
||
188 |
durl = self.dc.get_depot_url() |
|
189 |
self.pkgsend_bulk(durl, self.foo10) |
|
190 |
self.pkgsend_bulk(durl, self.foo11) |
|
191 |
self.pkgsend_bulk(durl, self.bar10) |
|
192 |
self.image_create(durl) |
|
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 | 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 | 197 |
self.pkg("verify") |
198 |
self.pkg("uninstall -v bar foo") |
|
199 |
||
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 | 203 |
self.pkg("verify") |
204 |
||
205 |
||
206 |
||
207 |
def test_image_upgrade(self): |
|
208 |
""" Send package [email protected], dependent on [email protected]. Install [email protected]. |
|
209 |
List all packages. Upgrade image. """ |
|
210 |
||
211 |
durl = self.dc.get_depot_url() |
|
212 |
self.pkgsend_bulk(durl, self.foo10) |
|
213 |
self.pkgsend_bulk(durl, self.foo11) |
|
214 |
self.pkgsend_bulk(durl, self.bar10) |
|
215 |
self.image_create(durl) |
|
216 |
||
217 |
self.pkg("install [email protected]") |
|
218 |
||
219 |
self.pkgsend_bulk(durl, self.foo12) |
|
220 |
self.pkgsend_bulk(durl, self.bar11) |
|
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 | 224 |
self.pkg("refresh") |
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 | 227 |
self.pkg("verify") |
228 |
self.pkg("image-update -v") |
|
229 |
self.pkg("verify") |
|
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 | 233 |
|
234 |
self.pkg("uninstall bar foo") |
|
235 |
self.pkg("verify") |
|
236 |
||
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 | 240 |
|
241 |
durl = self.dc.get_depot_url() |
|
242 |
self.pkgsend_bulk(durl, self.foo10) |
|
243 |
self.pkgsend_bulk(durl, self.foo11) |
|
244 |
self.pkgsend_bulk(durl, self.bar10) |
|
245 |
self.image_create(durl) |
|
246 |
||
247 |
self.pkg("install [email protected]") |
|
248 |
||
249 |
# Here's the real part of the regression test; |
|
250 |
# at this point foo and bar are installed, and |
|
251 |
# bar depends on foo. foo and bar should both |
|
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 | 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 | 322 |
|
323 |
if __name__ == "__main__": |
|
324 |
unittest.main() |