Merge lp:~jibel/ubuntu-server-iso-testing/flavor+desktop_fixes into lp:ubuntu-server-iso-testing
- flavor+desktop_fixes
- Merge into trunk
Proposed by
Jean-Baptiste Lallement
Status: | Merged |
---|---|
Merge reported by: | C de-Avillez |
Merged at revision: | not available |
Proposed branch: | lp:~jibel/ubuntu-server-iso-testing/flavor+desktop_fixes |
Merge into: | lp:ubuntu-server-iso-testing |
Diff against target: |
213 lines (+48/-17) 5 files modified
debian/changelog (+14/-0) download-latest-test-iso.py (+11/-2) run-test.py (+4/-6) templates.desktop/run_test.wrapper (+2/-0) templates.desktop/test_cases/ubiquity/test (+17/-9) |
To merge this branch: | bzr merge lp:~jibel/ubuntu-server-iso-testing/flavor+desktop_fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
C de-Avillez (community) | Approve | ||
Review via email: mp+58252@code.launchpad.net |
Commit message
expands support for desktop testing
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2011-03-10 09:01:45 +0000 | |||
3 | +++ debian/changelog 2011-04-19 09:32:24 +0000 | |||
4 | @@ -1,3 +1,17 @@ | |||
5 | 1 | ubuntu-server-iso-testing (1.0-1~ppa16) natty; urgency=low | ||
6 | 2 | |||
7 | 3 | * Desktop Testing: | ||
8 | 4 | - Increase wait time between steps in Ubiquity | ||
9 | 5 | - Start a basic http server to collect syslog | ||
10 | 6 | * Add support for flavor | ||
11 | 7 | * Added option --no-act to download-latest-test-iso.py to show what will | ||
12 | 8 | actually be downloaded | ||
13 | 9 | * run_test.py: calculate the timeout by a time difference rather than | ||
14 | 10 | decrementing a counter. On an heavy loaded environment the time shift | ||
15 | 11 | could reach 10 minutes per hour. | ||
16 | 12 | |||
17 | 13 | -- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Tue, 19 Apr 2011 11:24:35 +0200 | ||
18 | 14 | |||
19 | 1 | ubuntu-server-iso-testing (1.0-1~ppa15) natty; urgency=low | 15 | ubuntu-server-iso-testing (1.0-1~ppa15) natty; urgency=low |
20 | 2 | 16 | ||
21 | 3 | * Desktop Testing: | 17 | * Desktop Testing: |
22 | 4 | 18 | ||
23 | === modified file 'download-latest-test-iso.py' | |||
24 | --- download-latest-test-iso.py 2011-01-12 22:01:21 +0000 | |||
25 | +++ download-latest-test-iso.py 2011-04-19 09:32:24 +0000 | |||
26 | @@ -35,7 +35,7 @@ | |||
27 | 35 | DEFAULT_VARIANT = 'server' | 35 | DEFAULT_VARIANT = 'server' |
28 | 36 | DEFAULT_RELEASE = 'maverick' | 36 | DEFAULT_RELEASE = 'maverick' |
29 | 37 | DEFAULT_ARCH = 'all' | 37 | DEFAULT_ARCH = 'all' |
31 | 38 | DEFAULT_FLAVOR= 'ubuntu' | 38 | DEFAULT_FLAVOR= 'ubuntu-server' |
32 | 39 | DEFAULT_ISOROOT = os.path.expanduser('~/isos') | 39 | DEFAULT_ISOROOT = os.path.expanduser('~/isos') |
33 | 40 | 40 | ||
34 | 41 | # URLS | 41 | # URLS |
35 | @@ -102,6 +102,9 @@ | |||
36 | 102 | help="location to store iso images (default=%s)" % DEFAULT_ISOROOT) | 102 | help="location to store iso images (default=%s)" % DEFAULT_ISOROOT) |
37 | 103 | parser.add_option("-f", "--flavor", dest="flavor", default=DEFAULT_FLAVOR, | 103 | parser.add_option("-f", "--flavor", dest="flavor", default=DEFAULT_FLAVOR, |
38 | 104 | help="flavor of Ubuntu to download (default=%s)" % DEFAULT_FLAVOR) | 104 | help="flavor of Ubuntu to download (default=%s)" % DEFAULT_FLAVOR) |
39 | 105 | parser.add_option('-n', '--no-act', default=False, action='store_true', | ||
40 | 106 | dest='no_act', help='compute everything but don\'t actually download') | ||
41 | 107 | |||
42 | 105 | (options, args) = parser.parse_args() | 108 | (options, args) = parser.parse_args() |
43 | 106 | 109 | ||
44 | 107 | if options.debug: | 110 | if options.debug: |
45 | @@ -155,7 +158,7 @@ | |||
46 | 155 | l_iso_name = options.release + '-' + options.variant + '-' + arch + '.iso' | 158 | l_iso_name = options.release + '-' + options.variant + '-' + arch + '.iso' |
47 | 156 | lock = FileLock('/tmp/' + l_iso_name) | 159 | lock = FileLock('/tmp/' + l_iso_name) |
48 | 157 | with lock: | 160 | with lock: |
50 | 158 | l_iso_dir = options.flavor + '-' + options.variant | 161 | l_iso_dir = options.flavor |
51 | 159 | l_iso_location = os.path.join(options.isoroot, l_iso_dir, l_iso_name) | 162 | l_iso_location = os.path.join(options.isoroot, l_iso_dir, l_iso_name) |
52 | 160 | # If iso does not exists then mark for retrieval | 163 | # If iso does not exists then mark for retrieval |
53 | 161 | if os.path.exists(l_iso_location): | 164 | if os.path.exists(l_iso_location): |
54 | @@ -180,6 +183,12 @@ | |||
55 | 180 | cmd = ['dl-ubuntu-test-iso', '--variant=%s' % options.variant, | 183 | cmd = ['dl-ubuntu-test-iso', '--variant=%s' % options.variant, |
56 | 181 | '--arch=%s' % arch, '--release=%s' % options.release, | 184 | '--arch=%s' % arch, '--release=%s' % options.release, |
57 | 182 | '--build=%s' % l_build,'--isoroot=%s' % options.isoroot, '-P'] | 185 | '--build=%s' % l_build,'--isoroot=%s' % options.isoroot, '-P'] |
58 | 186 | if options.flavor: | ||
59 | 187 | cmd.append('--flavor=%s' % options.flavor) | ||
60 | 188 | |||
61 | 189 | if options.no_act: | ||
62 | 190 | cmd.append('-n') | ||
63 | 191 | |||
64 | 183 | logging.debug("Cmd: %s" % (cmd)) | 192 | logging.debug("Cmd: %s" % (cmd)) |
65 | 184 | subprocess.check_call(cmd) | 193 | subprocess.check_call(cmd) |
66 | 185 | # Write out build version to file for later use - needs to be refactored | 194 | # Write out build version to file for later use - needs to be refactored |
67 | 186 | 195 | ||
68 | === modified file 'run-test.py' | |||
69 | --- run-test.py 2011-03-04 13:50:04 +0000 | |||
70 | +++ run-test.py 2011-04-19 09:32:24 +0000 | |||
71 | @@ -65,7 +65,7 @@ | |||
72 | 65 | DEFAULT_VARIANT = 'server' | 65 | DEFAULT_VARIANT = 'server' |
73 | 66 | DEFAULT_RELEASE = 'maverick' | 66 | DEFAULT_RELEASE = 'maverick' |
74 | 67 | DEFAULT_ARCH = 'i386' | 67 | DEFAULT_ARCH = 'i386' |
76 | 68 | DEFAULT_FLAVOR= 'ubuntu' | 68 | DEFAULT_FLAVOR= 'ubuntu-server' |
77 | 69 | DEFAULT_ISOROOT = os.path.expanduser('~/isos') | 69 | DEFAULT_ISOROOT = os.path.expanduser('~/isos') |
78 | 70 | DEFAULT_TMPL_DIR = "/usr/share/ubuntu-server-iso-testing/templates" | 70 | DEFAULT_TMPL_DIR = "/usr/share/ubuntu-server-iso-testing/templates" |
79 | 71 | DEFAULT_TEST_TIMEOUT = 1200 | 71 | DEFAULT_TEST_TIMEOUT = 1200 |
80 | @@ -173,7 +173,7 @@ | |||
81 | 173 | 173 | ||
82 | 174 | # Create useful handles to ISO location | 174 | # Create useful handles to ISO location |
83 | 175 | iso_name = options.release + '-' + options.variant + '-' + options.arch + '.iso' | 175 | iso_name = options.release + '-' + options.variant + '-' + options.arch + '.iso' |
85 | 176 | iso_dir = options.flavor + '-' + options.variant | 176 | iso_dir = options.flavor |
86 | 177 | iso_location = os.path.join(options.isoroot, iso_dir, iso_name) | 177 | iso_location = os.path.join(options.isoroot, iso_dir, iso_name) |
87 | 178 | 178 | ||
88 | 179 | # Extract kernel and initrd from ISO to build new initrd including | 179 | # Extract kernel and initrd from ISO to build new initrd including |
89 | @@ -425,7 +425,6 @@ | |||
90 | 425 | 425 | ||
91 | 426 | # Monitor the state of the virtual machine to determine | 426 | # Monitor the state of the virtual machine to determine |
92 | 427 | # completion of execution of test scripts | 427 | # completion of execution of test scripts |
93 | 428 | l_timeout = TEST_TIMEOUT | ||
94 | 429 | l_macAddress = None | 428 | l_macAddress = None |
95 | 430 | l_ipAddress = None | 429 | l_ipAddress = None |
96 | 431 | 430 | ||
97 | @@ -510,6 +509,7 @@ | |||
98 | 510 | output = proc.communicate()[0].strip() | 509 | output = proc.communicate()[0].strip() |
99 | 511 | return output | 510 | return output |
100 | 512 | 511 | ||
101 | 512 | start_time = time.time() | ||
102 | 513 | while True: | 513 | while True: |
103 | 514 | if l_ipAddress is None: | 514 | if l_ipAddress is None: |
104 | 515 | l_ipAddress = get_ipAddress(test['_id'], mac_address) | 515 | l_ipAddress = get_ipAddress(test['_id'], mac_address) |
105 | @@ -532,7 +532,7 @@ | |||
106 | 532 | if l_retcode == 0 and l_output == "shut off": | 532 | if l_retcode == 0 and l_output == "shut off": |
107 | 533 | logging.debug("VM powered off for test case %s" % test['_id']) | 533 | logging.debug("VM powered off for test case %s" % test['_id']) |
108 | 534 | break | 534 | break |
110 | 535 | elif l_timeout <= 0: | 535 | elif start_time + TEST_TIMEOUT < time.time(): |
111 | 536 | logging.debug("Test %s failed to execute within %d minutes" % (test['_id'], TEST_TIMEOUT / 60)) | 536 | logging.debug("Test %s failed to execute within %d minutes" % (test['_id'], TEST_TIMEOUT / 60)) |
112 | 537 | logging.debug("Terminating test case %s" % (test['_id'])) | 537 | logging.debug("Terminating test case %s" % (test['_id'])) |
113 | 538 | cmd = [ "virsh", "destroy", test['_id']] | 538 | cmd = [ "virsh", "destroy", test['_id']] |
114 | @@ -542,8 +542,6 @@ | |||
115 | 542 | else: | 542 | else: |
116 | 543 | # Have another look in SLEEP_TIME seconds | 543 | # Have another look in SLEEP_TIME seconds |
117 | 544 | time.sleep(SLEEP_TIME) | 544 | time.sleep(SLEEP_TIME) |
118 | 545 | # Decrement the timeout | ||
119 | 546 | l_timeout = l_timeout - SLEEP_TIME | ||
120 | 547 | 545 | ||
121 | 548 | # Retrieve latest copy of data | 546 | # Retrieve latest copy of data |
122 | 549 | test = db[test['_id']] | 547 | test = db[test['_id']] |
123 | 550 | 548 | ||
124 | === modified file 'templates.desktop/run_test.wrapper' | |||
125 | --- templates.desktop/run_test.wrapper 2011-03-09 21:10:39 +0000 | |||
126 | +++ templates.desktop/run_test.wrapper 2011-04-19 09:32:24 +0000 | |||
127 | @@ -53,6 +53,8 @@ | |||
128 | 53 | RUNTEST=/usr/local/bin/run_test | 53 | RUNTEST=/usr/local/bin/run_test |
129 | 54 | 54 | ||
130 | 55 | if [ -x "$RUNTEST" ]; then | 55 | if [ -x "$RUNTEST" ]; then |
131 | 56 | # Start a local http server to grab the logs | ||
132 | 57 | cd /var/log; sudo python -m SimpleHTTPServer 80 & | ||
133 | 56 | sleep 5 | 58 | sleep 5 |
134 | 57 | # Sometimes at-spi hangs with no reason, refresh it | 59 | # Sometimes at-spi hangs with no reason, refresh it |
135 | 58 | sudo pkill /usr/lib/at-spi/at-spi-registryd | 60 | sudo pkill /usr/lib/at-spi/at-spi-registryd |
136 | 59 | 61 | ||
137 | === modified file 'templates.desktop/test_cases/ubiquity/test' | |||
138 | --- templates.desktop/test_cases/ubiquity/test 2011-03-09 21:10:39 +0000 | |||
139 | +++ templates.desktop/test_cases/ubiquity/test 2011-04-19 09:32:24 +0000 | |||
140 | @@ -27,6 +27,7 @@ | |||
141 | 27 | 27 | ||
142 | 28 | logging.basicConfig(level=logging.DEBUG) | 28 | logging.basicConfig(level=logging.DEBUG) |
143 | 29 | 29 | ||
144 | 30 | |||
145 | 30 | class DefaultTest(unittest.TestCase): | 31 | class DefaultTest(unittest.TestCase): |
146 | 31 | main_window = 'frmlive_installer' | 32 | main_window = 'frmlive_installer' |
147 | 32 | btn_forward = 'btnnext' | 33 | btn_forward = 'btnnext' |
148 | @@ -41,13 +42,14 @@ | |||
149 | 41 | txt_password1 = 'txtpassword' # Password | 42 | txt_password1 = 'txtpassword' # Password |
150 | 42 | txt_password2 = 'txtverifiedpassword' # Password confirmation | 43 | txt_password2 = 'txtverifiedpassword' # Password confirmation |
151 | 43 | 44 | ||
152 | 45 | |||
153 | 44 | def _waittillenabled(self, ui, component_name, timeout = 300): | 46 | def _waittillenabled(self, ui, component_name, timeout = 300): |
155 | 45 | ldtp.wait(5) # UI is slow to react sometimes | 47 | ldtp.wait(15) # UI is slow to react sometimes |
156 | 46 | component = ui.getchild(component_name) | 48 | component = ui.getchild(component_name) |
157 | 47 | while not component.stateenabled(): | 49 | while not component.stateenabled(): |
158 | 48 | logging.debug("SMOKETEST: Waiting for %s. Till %d to go" % (component_name, timeout)) | 50 | logging.debug("SMOKETEST: Waiting for %s. Till %d to go" % (component_name, timeout)) |
161 | 49 | ldtp.wait(1) | 51 | ldtp.wait(15) |
162 | 50 | timeout =- 1 | 52 | timeout -= 15 |
163 | 51 | if timeout < 0: return False | 53 | if timeout < 0: return False |
164 | 52 | #ldtp.wait(2) | 54 | #ldtp.wait(2) |
165 | 53 | return True | 55 | return True |
166 | @@ -71,12 +73,12 @@ | |||
167 | 71 | logging.info("SMOKETEST: Launching Ubiquity") | 73 | logging.info("SMOKETEST: Launching Ubiquity") |
168 | 72 | ldtp.launchapp('ubiquity', ['gtk_ui']) | 74 | ldtp.launchapp('ubiquity', ['gtk_ui']) |
169 | 73 | ldtp.waittillguiexist(self.main_window) | 75 | ldtp.waittillguiexist(self.main_window) |
171 | 74 | ldtp.wait(15) # Ubiquity in a VM is sooo sloooow | 76 | ldtp.wait(30) # Ubiquity in a VM is sooo sloooow |
172 | 75 | ui = ooldtp.context(self.main_window) | 77 | ui = ooldtp.context(self.main_window) |
173 | 76 | 78 | ||
174 | 77 | # First Screen | 79 | # First Screen |
175 | 78 | logging.info("SMOKETEST: Welcome Screen") | 80 | logging.info("SMOKETEST: Welcome Screen") |
177 | 79 | ldtp.wait(2) | 81 | ldtp.wait(30) |
178 | 80 | ui.click(self.btn_forward) | 82 | ui.click(self.btn_forward) |
179 | 81 | self._waittillenabled(ui, self.btn_forward) | 83 | self._waittillenabled(ui, self.btn_forward) |
180 | 82 | 84 | ||
181 | @@ -91,9 +93,9 @@ | |||
182 | 91 | logging.info("SMOKETEST: Use entire partition") | 93 | logging.info("SMOKETEST: Use entire partition") |
183 | 92 | ui.click(self.rbtn_useentiredisk) | 94 | ui.click(self.rbtn_useentiredisk) |
184 | 93 | ui.click(self.btn_forward) | 95 | ui.click(self.btn_forward) |
186 | 94 | ldtp.wait(5) | 96 | ldtp.wait(30) |
187 | 95 | ui.remap() | 97 | ui.remap() |
189 | 96 | ldtp.wait(2) | 98 | ldtp.wait(30) |
190 | 97 | self._waittillenabled(ui, self.btn_installnow) | 99 | self._waittillenabled(ui, self.btn_installnow) |
191 | 98 | 100 | ||
192 | 99 | logging.info("SMOKETEST: Allocate Drive Space") | 101 | logging.info("SMOKETEST: Allocate Drive Space") |
193 | @@ -122,12 +124,18 @@ | |||
194 | 122 | ui.settextvalue(self.txt_password1, data['password1']) | 124 | ui.settextvalue(self.txt_password1, data['password1']) |
195 | 123 | ui.settextvalue(self.txt_password2, data['password2']) | 125 | ui.settextvalue(self.txt_password2, data['password2']) |
196 | 124 | ui.click(self.rbtn_loginautomatically) | 126 | ui.click(self.rbtn_loginautomatically) |
198 | 125 | ldtp.wait(2) | 127 | ldtp.wait(30) |
199 | 126 | ui.click(self.btn_forward) | 128 | ui.click(self.btn_forward) |
200 | 127 | 129 | ||
201 | 130 | ldtp.wait(30) | ||
202 | 131 | #if ui.guiexist(self.btn_forward): | ||
203 | 132 | # component = ui.getchild(self.btn_forward) | ||
204 | 133 | # if component.stateenabled(): | ||
205 | 134 | # ui.click(self.btn_forward) | ||
206 | 135 | |||
207 | 128 | ldtp.waittillguiexist('dlgfinished_dialog', guiTimeOut = 60 * 20) | 136 | ldtp.waittillguiexist('dlgfinished_dialog', guiTimeOut = 60 * 20) |
208 | 129 | 137 | ||
210 | 130 | ldtp.wait(1) | 138 | ldtp.wait(30) |
211 | 131 | 139 | ||
212 | 132 | # Don't reboot just verify that ubiquity is done | 140 | # Don't reboot just verify that ubiquity is done |
213 | 133 | self.assertTrue(ldtp.guiexist('dlgfinished_dialog', 'btnrebootbutton')) | 141 | self.assertTrue(ldtp.guiexist('dlgfinished_dialog', 'btnrebootbutton')) |
approved