Merge lp:~jibel/ubuntu-server-iso-testing/flavor+desktop_fixes into lp:ubuntu-server-iso-testing

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
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

To post a comment you must log in.
Revision history for this message
C de-Avillez (hggdh2) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-03-10 09:01:45 +0000
+++ debian/changelog 2011-04-19 09:32:24 +0000
@@ -1,3 +1,17 @@
1ubuntu-server-iso-testing (1.0-1~ppa16) natty; urgency=low
2
3 * Desktop Testing:
4 - Increase wait time between steps in Ubiquity
5 - Start a basic http server to collect syslog
6 * Add support for flavor
7 * Added option --no-act to download-latest-test-iso.py to show what will
8 actually be downloaded
9 * run_test.py: calculate the timeout by a time difference rather than
10 decrementing a counter. On an heavy loaded environment the time shift
11 could reach 10 minutes per hour.
12
13 -- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Tue, 19 Apr 2011 11:24:35 +0200
14
1ubuntu-server-iso-testing (1.0-1~ppa15) natty; urgency=low15ubuntu-server-iso-testing (1.0-1~ppa15) natty; urgency=low
216
3 * Desktop Testing:17 * Desktop Testing:
418
=== modified file 'download-latest-test-iso.py'
--- download-latest-test-iso.py 2011-01-12 22:01:21 +0000
+++ download-latest-test-iso.py 2011-04-19 09:32:24 +0000
@@ -35,7 +35,7 @@
35DEFAULT_VARIANT = 'server'35DEFAULT_VARIANT = 'server'
36DEFAULT_RELEASE = 'maverick'36DEFAULT_RELEASE = 'maverick'
37DEFAULT_ARCH = 'all'37DEFAULT_ARCH = 'all'
38DEFAULT_FLAVOR= 'ubuntu'38DEFAULT_FLAVOR= 'ubuntu-server'
39DEFAULT_ISOROOT = os.path.expanduser('~/isos')39DEFAULT_ISOROOT = os.path.expanduser('~/isos')
4040
41# URLS41# URLS
@@ -102,6 +102,9 @@
102 help="location to store iso images (default=%s)" % DEFAULT_ISOROOT)102 help="location to store iso images (default=%s)" % DEFAULT_ISOROOT)
103parser.add_option("-f", "--flavor", dest="flavor", default=DEFAULT_FLAVOR, 103parser.add_option("-f", "--flavor", dest="flavor", default=DEFAULT_FLAVOR,
104 help="flavor of Ubuntu to download (default=%s)" % DEFAULT_FLAVOR)104 help="flavor of Ubuntu to download (default=%s)" % DEFAULT_FLAVOR)
105parser.add_option('-n', '--no-act', default=False, action='store_true',
106 dest='no_act', help='compute everything but don\'t actually download')
107
105(options, args) = parser.parse_args()108(options, args) = parser.parse_args()
106109
107if options.debug:110if options.debug:
@@ -155,7 +158,7 @@
155 l_iso_name = options.release + '-' + options.variant + '-' + arch + '.iso'158 l_iso_name = options.release + '-' + options.variant + '-' + arch + '.iso'
156 lock = FileLock('/tmp/' + l_iso_name)159 lock = FileLock('/tmp/' + l_iso_name)
157 with lock:160 with lock:
158 l_iso_dir = options.flavor + '-' + options.variant161 l_iso_dir = options.flavor
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)
160 # If iso does not exists then mark for retrieval163 # If iso does not exists then mark for retrieval
161 if os.path.exists(l_iso_location):164 if os.path.exists(l_iso_location):
@@ -180,6 +183,12 @@
180 cmd = ['dl-ubuntu-test-iso', '--variant=%s' % options.variant, 183 cmd = ['dl-ubuntu-test-iso', '--variant=%s' % options.variant,
181 '--arch=%s' % arch, '--release=%s' % options.release, 184 '--arch=%s' % arch, '--release=%s' % options.release,
182 '--build=%s' % l_build,'--isoroot=%s' % options.isoroot, '-P']185 '--build=%s' % l_build,'--isoroot=%s' % options.isoroot, '-P']
186 if options.flavor:
187 cmd.append('--flavor=%s' % options.flavor)
188
189 if options.no_act:
190 cmd.append('-n')
191
183 logging.debug("Cmd: %s" % (cmd))192 logging.debug("Cmd: %s" % (cmd))
184 subprocess.check_call(cmd)193 subprocess.check_call(cmd)
185 # Write out build version to file for later use - needs to be refactored194 # Write out build version to file for later use - needs to be refactored
186195
=== modified file 'run-test.py'
--- run-test.py 2011-03-04 13:50:04 +0000
+++ run-test.py 2011-04-19 09:32:24 +0000
@@ -65,7 +65,7 @@
65DEFAULT_VARIANT = 'server'65DEFAULT_VARIANT = 'server'
66DEFAULT_RELEASE = 'maverick'66DEFAULT_RELEASE = 'maverick'
67DEFAULT_ARCH = 'i386'67DEFAULT_ARCH = 'i386'
68DEFAULT_FLAVOR= 'ubuntu'68DEFAULT_FLAVOR= 'ubuntu-server'
69DEFAULT_ISOROOT = os.path.expanduser('~/isos')69DEFAULT_ISOROOT = os.path.expanduser('~/isos')
70DEFAULT_TMPL_DIR = "/usr/share/ubuntu-server-iso-testing/templates"70DEFAULT_TMPL_DIR = "/usr/share/ubuntu-server-iso-testing/templates"
71DEFAULT_TEST_TIMEOUT = 120071DEFAULT_TEST_TIMEOUT = 1200
@@ -173,7 +173,7 @@
173173
174# Create useful handles to ISO location174# Create useful handles to ISO location
175iso_name = options.release + '-' + options.variant + '-' + options.arch + '.iso'175iso_name = options.release + '-' + options.variant + '-' + options.arch + '.iso'
176iso_dir = options.flavor + '-' + options.variant176iso_dir = options.flavor
177iso_location = os.path.join(options.isoroot, iso_dir, iso_name)177iso_location = os.path.join(options.isoroot, iso_dir, iso_name)
178178
179# Extract kernel and initrd from ISO to build new initrd including179# Extract kernel and initrd from ISO to build new initrd including
@@ -425,7 +425,6 @@
425425
426# Monitor the state of the virtual machine to determine426# Monitor the state of the virtual machine to determine
427# completion of execution of test scripts427# completion of execution of test scripts
428l_timeout = TEST_TIMEOUT
429l_macAddress = None428l_macAddress = None
430l_ipAddress = None429l_ipAddress = None
431430
@@ -510,6 +509,7 @@
510 output = proc.communicate()[0].strip()509 output = proc.communicate()[0].strip()
511 return output510 return output
512511
512start_time = time.time()
513while True:513while True:
514 if l_ipAddress is None:514 if l_ipAddress is None:
515 l_ipAddress = get_ipAddress(test['_id'], mac_address)515 l_ipAddress = get_ipAddress(test['_id'], mac_address)
@@ -532,7 +532,7 @@
532 if l_retcode == 0 and l_output == "shut off":532 if l_retcode == 0 and l_output == "shut off":
533 logging.debug("VM powered off for test case %s" % test['_id'])533 logging.debug("VM powered off for test case %s" % test['_id'])
534 break534 break
535 elif l_timeout <= 0:535 elif start_time + TEST_TIMEOUT < time.time():
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))
537 logging.debug("Terminating test case %s" % (test['_id']))537 logging.debug("Terminating test case %s" % (test['_id']))
538 cmd = [ "virsh", "destroy", test['_id']]538 cmd = [ "virsh", "destroy", test['_id']]
@@ -542,8 +542,6 @@
542 else:542 else:
543 # Have another look in SLEEP_TIME seconds543 # Have another look in SLEEP_TIME seconds
544 time.sleep(SLEEP_TIME)544 time.sleep(SLEEP_TIME)
545 # Decrement the timeout
546 l_timeout = l_timeout - SLEEP_TIME
547545
548# Retrieve latest copy of data546# Retrieve latest copy of data
549test = db[test['_id']]547test = db[test['_id']]
550548
=== modified file 'templates.desktop/run_test.wrapper'
--- templates.desktop/run_test.wrapper 2011-03-09 21:10:39 +0000
+++ templates.desktop/run_test.wrapper 2011-04-19 09:32:24 +0000
@@ -53,6 +53,8 @@
53RUNTEST=/usr/local/bin/run_test53RUNTEST=/usr/local/bin/run_test
5454
55if [ -x "$RUNTEST" ]; then55if [ -x "$RUNTEST" ]; then
56 # Start a local http server to grab the logs
57 cd /var/log; sudo python -m SimpleHTTPServer 80 &
56 sleep 558 sleep 5
57 # Sometimes at-spi hangs with no reason, refresh it59 # Sometimes at-spi hangs with no reason, refresh it
58 sudo pkill /usr/lib/at-spi/at-spi-registryd60 sudo pkill /usr/lib/at-spi/at-spi-registryd
5961
=== modified file 'templates.desktop/test_cases/ubiquity/test'
--- templates.desktop/test_cases/ubiquity/test 2011-03-09 21:10:39 +0000
+++ templates.desktop/test_cases/ubiquity/test 2011-04-19 09:32:24 +0000
@@ -27,6 +27,7 @@
2727
28logging.basicConfig(level=logging.DEBUG)28logging.basicConfig(level=logging.DEBUG)
2929
30
30class DefaultTest(unittest.TestCase):31class DefaultTest(unittest.TestCase):
31 main_window = 'frmlive_installer'32 main_window = 'frmlive_installer'
32 btn_forward = 'btnnext'33 btn_forward = 'btnnext'
@@ -41,13 +42,14 @@
41 txt_password1 = 'txtpassword' # Password42 txt_password1 = 'txtpassword' # Password
42 txt_password2 = 'txtverifiedpassword' # Password confirmation 43 txt_password2 = 'txtverifiedpassword' # Password confirmation
4344
45
44 def _waittillenabled(self, ui, component_name, timeout = 300):46 def _waittillenabled(self, ui, component_name, timeout = 300):
45 ldtp.wait(5) # UI is slow to react sometimes47 ldtp.wait(15) # UI is slow to react sometimes
46 component = ui.getchild(component_name)48 component = ui.getchild(component_name)
47 while not component.stateenabled():49 while not component.stateenabled():
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))
49 ldtp.wait(1)51 ldtp.wait(15)
50 timeout =- 152 timeout -= 15
51 if timeout < 0: return False53 if timeout < 0: return False
52 #ldtp.wait(2)54 #ldtp.wait(2)
53 return True55 return True
@@ -71,12 +73,12 @@
71 logging.info("SMOKETEST: Launching Ubiquity")73 logging.info("SMOKETEST: Launching Ubiquity")
72 ldtp.launchapp('ubiquity', ['gtk_ui'])74 ldtp.launchapp('ubiquity', ['gtk_ui'])
73 ldtp.waittillguiexist(self.main_window)75 ldtp.waittillguiexist(self.main_window)
74 ldtp.wait(15) # Ubiquity in a VM is sooo sloooow76 ldtp.wait(30) # Ubiquity in a VM is sooo sloooow
75 ui = ooldtp.context(self.main_window)77 ui = ooldtp.context(self.main_window)
7678
77 # First Screen79 # First Screen
78 logging.info("SMOKETEST: Welcome Screen")80 logging.info("SMOKETEST: Welcome Screen")
79 ldtp.wait(2)81 ldtp.wait(30)
80 ui.click(self.btn_forward)82 ui.click(self.btn_forward)
81 self._waittillenabled(ui, self.btn_forward)83 self._waittillenabled(ui, self.btn_forward)
8284
@@ -91,9 +93,9 @@
91 logging.info("SMOKETEST: Use entire partition")93 logging.info("SMOKETEST: Use entire partition")
92 ui.click(self.rbtn_useentiredisk)94 ui.click(self.rbtn_useentiredisk)
93 ui.click(self.btn_forward)95 ui.click(self.btn_forward)
94 ldtp.wait(5)96 ldtp.wait(30)
95 ui.remap()97 ui.remap()
96 ldtp.wait(2)98 ldtp.wait(30)
97 self._waittillenabled(ui, self.btn_installnow)99 self._waittillenabled(ui, self.btn_installnow)
98100
99 logging.info("SMOKETEST: Allocate Drive Space")101 logging.info("SMOKETEST: Allocate Drive Space")
@@ -122,12 +124,18 @@
122 ui.settextvalue(self.txt_password1, data['password1'])124 ui.settextvalue(self.txt_password1, data['password1'])
123 ui.settextvalue(self.txt_password2, data['password2'])125 ui.settextvalue(self.txt_password2, data['password2'])
124 ui.click(self.rbtn_loginautomatically)126 ui.click(self.rbtn_loginautomatically)
125 ldtp.wait(2)127 ldtp.wait(30)
126 ui.click(self.btn_forward)128 ui.click(self.btn_forward)
127129
130 ldtp.wait(30)
131 #if ui.guiexist(self.btn_forward):
132 # component = ui.getchild(self.btn_forward)
133 # if component.stateenabled():
134 # ui.click(self.btn_forward)
135
128 ldtp.waittillguiexist('dlgfinished_dialog', guiTimeOut = 60 * 20)136 ldtp.waittillguiexist('dlgfinished_dialog', guiTimeOut = 60 * 20)
129137
130 ldtp.wait(1)138 ldtp.wait(30)
131139
132 # Don't reboot just verify that ubiquity is done140 # Don't reboot just verify that ubiquity is done
133 self.assertTrue(ldtp.guiexist('dlgfinished_dialog', 'btnrebootbutton'))141 self.assertTrue(ldtp.guiexist('dlgfinished_dialog', 'btnrebootbutton'))

Subscribers

People subscribed via source and target branches