author | Rich Burridge <rich.burridge@sun.com> |
Mon, 30 Nov 2009 13:01:40 -0800 | |
changeset 1516 | 8c950a3b4171 |
parent 1297 | 2924ade539eb |
child 1715 | 8f305f0a6864 |
permissions | -rw-r--r-- |
1516
8c950a3b4171
10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents:
1297
diff
changeset
|
1 |
#!/usr/bin/python |
1297
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
2 |
# |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
3 |
# CDDL HEADER START |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
4 |
# |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
5 |
# The contents of this file are subject to the terms of the |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
6 |
# Common Development and Distribution License (the "License"). |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
7 |
# You may not use this file except in compliance with the License. |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
8 |
# |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
10 |
# or http://www.opensolaris.org/os/licensing. |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
11 |
# See the License for the specific language governing permissions |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
12 |
# and limitations under the License. |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
13 |
# |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
16 |
# If applicable, add the following below this CDDL HEADER, with the |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
19 |
# |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
20 |
# CDDL HEADER END |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
21 |
# |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
22 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
23 |
# Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
24 |
# Use is subject to license terms. |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
25 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
26 |
from cli import testutils |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
27 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
28 |
if __name__ == "__main__": |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
29 |
testutils.setup_environment("../../../proto") |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
30 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
31 |
try: |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
32 |
import ldtp |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
33 |
except ImportError: |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
34 |
raise ImportError, "SUNWldtp package not installed." |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
35 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
36 |
class TestPkgGuiHelp(testutils.SingleDepotTestCase): |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
37 |
# Only start/stop the depot once (instead of for every test) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
38 |
persistent_depot = True |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
39 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
40 |
foo10 = """ |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
41 |
open [email protected],5.11-0 |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
42 |
add set name="description" value="Some package1 description" |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
43 |
close """ |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
44 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
45 |
def setUp(self, debug_features=None): |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
46 |
testutils.SingleDepotTestCase.setUp(self) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
47 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
48 |
def tearDown(self): |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
49 |
testutils.SingleDepotTestCase.tearDown(self) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
50 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
51 |
def testPmHelp(self): |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
52 |
repo_url = self.dc.get_depot_url() |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
53 |
self.pkgsend_bulk(repo_url, self.foo10) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
54 |
self.image_create(repo_url) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
55 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
56 |
ldtp.launchapp("%s/usr/bin/packagemanager" % testutils.g_proto_area) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
57 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
58 |
ldtp.click('frmPackageManager', 'mnuContents') |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
59 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
60 |
# Verify result |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
61 |
ldtp.waittillguiexist('*Online Help') |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
62 |
self.assertEqual(ldtp.guiexist('*Online Help'), 1) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
63 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
64 |
ldtp.selectmenuitem('*Online Help', 'mnuCloseWindow') |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
65 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
66 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
67 |
# Quit UpdateManager |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
68 |
ldtp.click('frmPackageManager', 'mnuQuit') |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
69 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
70 |
def testPmAbout(self): |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
71 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
72 |
ldtp.launchapp("%s/usr/bin/packagemanager" % testutils.g_proto_area) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
73 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
74 |
ldtp.selectmenuitem('frmPackageManager', 'mnuAbout') |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
75 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
76 |
# Verify result |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
77 |
self.assertEqual(ldtp.guiexist('About Package Manager'), 1) |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
78 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
79 |
ldtp.waittillguiexist('dlgAboutPackageManager') |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
80 |
ldtp.click('dlgAboutPackageManager', 'btnClose') |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
81 |
|
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
82 |
# Quit Package Manager |
2924ade539eb
10580 Include automated tests for the Package Manager
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff
changeset
|
83 |
ldtp.selectmenuitem('frmPackageManager', 'mnuQuit') |