author | Rich Burridge <rich.burridge@sun.com> |
Mon, 30 Nov 2009 13:01:40 -0800 | |
changeset 1516 | 8c950a3b4171 |
parent 1505 | cc598d70bbbe |
child 1715 | 8f305f0a6864 |
permissions | -rw-r--r-- |
1516
8c950a3b4171
10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents:
1505
diff
changeset
|
1 |
#!/usr/bin/python |
581 | 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 |
||
884
d780afc023ff
3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents:
581
diff
changeset
|
23 |
# Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
581 | 24 |
# Use is subject to license terms. |
25 |
||
26 |
import testutils |
|
27 |
if __name__ == "__main__": |
|
28 |
testutils.setup_environment("../../../proto") |
|
29 |
||
30 |
import unittest |
|
31 |
||
32 |
class TestROption(testutils.SingleDepotTestCase): |
|
33 |
# Only start/stop the depot once (instead of for every test) |
|
34 |
persistent_depot = True |
|
35 |
||
36 |
foo10 = """ |
|
37 |
open [email protected],5.11-0 |
|
38 |
close """ |
|
39 |
||
40 |
def test_bad_cli_options(self): |
|
41 |
durl = self.dc.get_depot_url() |
|
42 |
self.image_create(durl) |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
884
diff
changeset
|
43 |
|
581 | 44 |
self.pkg("-@", exit=2) |
45 |
self.pkg("-s status", exit=2) |
|
46 |
self.pkg("-R status", exit=2) |
|
47 |
||
48 |
def test_1(self): |
|
49 |
durl = self.dc.get_depot_url() |
|
50 |
self.pkgsend_bulk(durl, self.foo10) |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
884
diff
changeset
|
51 |
|
581 | 52 |
self.image_create(durl) |
53 |
||
54 |
imgpath = self.img_path |
|
55 |
badpath = "/this/dir/should/not/ever/exist/foo/bar/afsddfas" |
|
56 |
||
57 |
self.pkg("-R %s list" % badpath, exit=1) |
|
58 |
self.pkg("-R %s list" % imgpath, exit=1) |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
884
diff
changeset
|
59 |
|
581 | 60 |
self.pkg("-R %s install foo" % badpath, exit=1) |
61 |
self.pkg("-R %s install foo" % imgpath) |
|
62 |
||
63 |
self.pkg("-R %s list" % badpath, exit=1) |
|
64 |
self.pkg("-R %s list" % imgpath) |
|
65 |
||
66 |
self.pkgsend_bulk(durl, self.foo10) |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
884
diff
changeset
|
67 |
self.pkg("-R %s refresh" % imgpath) |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
884
diff
changeset
|
68 |
|
581 | 69 |
self.pkg("-R %s image-update" % badpath, exit=1) |
884
d780afc023ff
3718 plan_update_all needs to have an optional argument for the new BE name
Brock Pytlik <bpytlik@sun.com>
parents:
581
diff
changeset
|
70 |
self.pkg("-R %s image-update --be-name NEWBENAME" % imgpath, exit=1) |
581 | 71 |
self.pkg("-R %s image-update" % imgpath) |
72 |
||
73 |
self.pkg("-R %s uninstall foo" % badpath, exit=1) |
|
1505
cc598d70bbbe
4425 pkg install should deal w/ complex dependency changes in one install
Bart Smaalders <Bart.Smaalders@Sun.COM>
parents:
996
diff
changeset
|
74 |
self.pkg("-R %s install foo" % imgpath, exit=4) |
581 | 75 |
|
76 |
self.pkg("-R %s info foo" % badpath, exit=1) |
|
77 |
self.pkg("-R %s info foo" % imgpath) |
|
78 |
||
79 |
if __name__ == "__main__": |
|
80 |
unittest.main() |
|
81 |