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

Subscribers

People subscribed via source and target branches