blob: fe11cd9c9dd324950446809e711f6c13de5feb5d [file] [log] [blame]
Andy Doan61b4d772012-04-24 10:03:28 -05001#!/usr/bin/python
2
Andy Doan61b4d772012-04-24 10:03:28 -05003import os
Andy Doan61b4d772012-04-24 10:03:28 -05004import sys
Fathi Boudrac14068b2012-12-06 17:42:11 +02005import json
Andy Doan61b4d772012-04-24 10:03:28 -05006import xmlrpclib
Fathi Boudrac14068b2012-12-06 17:42:11 +02007import re
Andy Doan61b4d772012-04-24 10:03:28 -05008
Fathi Boudra2486ee12013-06-28 13:39:07 +03009tests_timeout = {
10 'bluetooth-enablement': 7200,
Fathi Boudra63d5cbb2013-08-02 08:55:36 +030011 'bootchart': 800,
12 'busybox': 800,
Fathi Boudra0ce7fd22013-10-16 19:51:24 +030013 'cyclictest': 90000,
Fathi Boudra63d5cbb2013-08-02 08:55:36 +030014 'device-tree': 800,
Fathi Boudra2486ee12013-06-28 13:39:07 +030015 'e2eaudiotest': 7200,
Fathi Boudra63d5cbb2013-08-02 08:55:36 +030016 'ethernet': 800,
Fathi Boudra2486ee12013-06-28 13:39:07 +030017 'gatortests': 1200,
Andrew McDermott51bb8b92013-12-17 09:46:50 +000018 'jtreg-hotspot-compiler': 54000,
19 'jtreg-hotspot-gc': 14400,
20 'jtreg-hotspot-runtime': 14400,
Andrew McDermottec97cb52013-09-24 11:50:57 +010021 'jtreg-hotspot-sanity': 7200,
22 'jtreg-hotspot-serviceability': 7200,
23 'jtreg-hotspot-testlibrary': 7200,
Fathi Boudra63d5cbb2013-08-02 08:55:36 +030024 'kernel-version': 800,
Fathi Boudra2486ee12013-06-28 13:39:07 +030025 'leb-basic-graphics': 7200,
26 'ltp': 7200,
Fathi Boudra63d5cbb2013-08-02 08:55:36 +030027 'mysql': 800,
Fathi Boudrac13926a2013-07-03 11:36:37 +030028 'network-tests-basic': 1200,
Fathi Boudra63d5cbb2013-08-02 08:55:36 +030029 'perf': 800,
30 'phpinfo': 800,
31 'phpmysql': 800,
32 'pwrmgmt': 800,
33 'sdkhelloc': 800,
34 'sdkhellocxx': 800,
Fathi Boudra2486ee12013-06-28 13:39:07 +030035 'smoke-tests-basic': 1200,
Fathi Boudra63d5cbb2013-08-02 08:55:36 +030036 'toolchain': 800,
Fathi Boudra2486ee12013-06-28 13:39:07 +030037 'wifi-enablement': 7200,
38}
39
Fathi Boudrac14068b2012-12-06 17:42:11 +020040tests_nano = [
41 'device-tree',
42 'gatortests',
Fathi Boudrac13926a2013-07-03 11:36:37 +030043 'network-tests-basic',
Fathi Boudrac14068b2012-12-06 17:42:11 +020044 'perf',
45 'pwrmgmt',
Fathi Boudra2486ee12013-06-28 13:39:07 +030046 'smoke-tests-basic',
Fathi Boudra3f7ace92013-04-11 13:06:11 +030047]
Fathi Boudrac14068b2012-12-06 17:42:11 +020048
49tests_alip = [
50 'bootchart',
Fathi Boudra3f7ace92013-04-11 13:06:11 +030051]
Fathi Boudrac14068b2012-12-06 17:42:11 +020052
53tests_desktop = [
54 'e2eaudiotest',
55 'bluetooth-enablement',
56 'wifi-enablement',
57 'leb-basic-graphics',
Fathi Boudra3f7ace92013-04-11 13:06:11 +030058]
Fathi Boudrac14068b2012-12-06 17:42:11 +020059
Fathi Boudra60d0e972013-04-19 10:49:47 +030060tests_openembedded_minimal = [
Marcin Juszkiewicz59172832013-04-18 09:35:00 +020061 'busybox',
Marcin Juszkiewicz1678f112013-04-09 09:55:46 +020062 'device-tree',
Marcin Juszkiewicz59172832013-04-18 09:35:00 +020063 'ethernet',
64 'kernel-version',
Marcin Juszkiewicz1678f112013-04-09 09:55:46 +020065 'perf',
Marcin Juszkiewicz59172832013-04-18 09:35:00 +020066 'toolchain',
Fathi Boudra3f7ace92013-04-11 13:06:11 +030067]
Andy Doan61b4d772012-04-24 10:03:28 -050068
Fathi Boudra60d0e972013-04-19 10:49:47 +030069tests_openembedded_lamp = [
Fathi Boudra60d0e972013-04-19 10:49:47 +030070 'mysql',
71 'phpinfo',
72 'phpmysql',
73 'sdkhelloc',
74 'sdkhellocxx',
75]
76
Andrew McDermottb62dfaf2013-06-26 12:32:30 +010077tests_openembedded_leg_java = [
Andrew McDermottedd9b8d2013-08-24 00:07:53 +010078 'openjdk8-sanity',
Andrew McDermotta4723272013-12-18 09:41:14 +000079 'mauve-setup',
80 'mauve-BinaryCompatibility',
81 'mauve-BinaryCompatibility-altered',
82 'mauve-gnu-java',
83 'mauve-gnu-javax',
84 'mauve-java-awt',
85 'mauve-java-beans',
86 'mauve-java-io',
87 'mauve-java-lang',
88 'mauve-java-math',
89 'mauve-java-net',
90 'mauve-java-nio',
91 'mauve-java-rmi',
92 'mauve-java-security',
93 'mauve-java-sql',
94 'mauve-java-text',
95 'mauve-java-util',
96 'mauve-javax-accessibility',
97 'mauve-javax-crypto',
98 'mauve-javax-imageio',
99 'mauve-javax-management',
100 'mauve-javax-naming',
101 'mauve-javax-net',
102 'mauve-javax-print',
103 'mauve-javax-rmi',
104 'mauve-javax-security',
105 'mauve-javax-sound',
106 'mauve-javax-swing',
107 'mauve-javax-xml',
108 'mauve-locales',
109 'mauve-org-omg',
110 'mauve-org-w3c',
Andrew McDermotte47afbd2013-09-23 19:19:51 +0100111 'jtreg-hotspot-compiler',
112 'jtreg-hotspot-gc',
113 'jtreg-hotspot-runtime',
114 'jtreg-hotspot-sanity',
115 'jtreg-hotspot-serviceability',
116 'jtreg-hotspot-testlibrary',
Andrew McDermottb62dfaf2013-06-26 12:32:30 +0100117]
118
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200119# Mapping device type - bundle stream
Andy Doan3462e4c2012-05-18 10:58:06 -0500120DEVICE_STREAM = {
Fathi Boudra8b59a502013-01-18 10:20:04 +0200121 'arndale': 'arndale',
Koen Kooid401dbd2013-10-11 12:48:01 +0200122 'beaglebone-black': 'beaglebone',
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200123 'beaglexm': 'beaglexm',
Fathi Boudrab97042a2013-04-04 17:49:22 +0300124 'highbank': 'highbank',
Fathi Boudra66a6e9d2013-12-15 10:14:50 +0200125 'midway': 'midway',
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200126 'origen': 'leb-origen',
Andy Doan3462e4c2012-05-18 10:58:06 -0500127 'panda': 'leb-panda-4430',
Paul Larson27308512012-08-17 14:09:05 -0500128 'panda-es': 'leb-panda-es',
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200129 'rtsm_foundation-armv8': 'vexpress64',
Fathi Boudra81c62312013-11-21 13:48:23 +0200130 'rtsm_fvp_base-aemv8a': 'vexpress64',
131 'rtsm_fvp_base_cortex-a57x1-a53x1': 'vexpress64',
132 'rtsm_fvp_base_cortex-a57x4-a53x4': 'vexpress64',
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200133 'rtsm_ve-a15x1-a7x1': 'vexpress',
134 'rtsm_ve-a15x4-a7x4': 'vexpress',
Fathi Boudra81c62312013-11-21 13:48:23 +0200135 'rtsm_ve-armv8': 'vexpress64',
Andy Doan3462e4c2012-05-18 10:58:06 -0500136 'snowball_sd': 'leb-snowball',
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200137 'vexpress-a5': 'vexpress',
Fathi Boudra76551e52012-09-19 17:51:33 +0300138 'vexpress-a9': 'vexpress',
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200139 'vexpress-tc2': 'vexpress',
Andy Doan3462e4c2012-05-18 10:58:06 -0500140}
141
Andy Doan61b4d772012-04-24 10:03:28 -0500142
143def obfuscate_credentials(s):
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300144 return re.sub(r'([^ ]:).+?(@)', r'\1xxx\2', s)
Andy Doan61b4d772012-04-24 10:03:28 -0500145
Fathi Boudrac14068b2012-12-06 17:42:11 +0200146
Andy Doan61b4d772012-04-24 10:03:28 -0500147def main():
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200148 """Script entry point: return some JSON based on calling args.
149 We should be called from Jenkins and expect the following to be defined:
150 $HWPACK_BUILD_NUMBER $HWPACK_JOB_NAME HWPACK_FILE_NAME $DEVICE_TYPE
151 """
Andy Doan61b4d772012-04-24 10:03:28 -0500152
Fathi Boudrad1f9a862012-12-28 14:46:04 +0200153 # CI base URL
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300154 ci_base_url = 'https://ci.linaro.org/jenkins/job/'
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200155 # Snapshots base URL
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300156 snapshots_url = 'http://snapshots.linaro.org'
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200157
158 # Name of the hardware pack project
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300159 hwpack_job_name = os.environ.get('HWPACK_JOB_NAME')
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200160 # The hardware pack build number
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300161 hwpack_build_number = os.environ.get('HWPACK_BUILD_NUMBER')
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200162 # Hardware pack file name
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300163 hwpack_file_name = os.environ.get('HWPACK_FILE_NAME', 'Undefined')
164 if hwpack_file_name == 'Undefined':
165 sys.exit('Hardware pack is not defined.')
166
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200167 # Device type
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300168 device_type = os.environ.get('DEVICE_TYPE', 'Undefined')
169 if device_type == 'Undefined':
170 sys.exit('Device type is not defined.')
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200171
172 # Distribution, architecture and hardware pack type
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300173 ret_split = hwpack_job_name.split('-', 2)
174 (distribution, architecture, hwpack_type) = \
175 ret_split[0], ret_split[1], ret_split[2]
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200176 if hwpack_type.startswith('pre-built-images-'):
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300177 hwpack_type = hwpack_type[(len('pre-built-images-')):]
Fathi Boudra65aaf1a2013-01-10 10:35:57 +0200178 if '=' in hwpack_type:
Fathi Boudra5cae8992013-10-19 15:46:31 +0300179 hwpack_type = hwpack_type[(len('pre-built-images/')):]
180 ret_split = dict(
181 token.split('=') for token in hwpack_type.split(','))
182 hwpack_type = ret_split['hwpack']
183
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200184 # Rootfs type, default is developer
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300185 rootfs_type = os.getenv('ROOTFS_TYPE', 'developer')
Fathi Boudrac14068b2012-12-06 17:42:11 +0200186
187 # Bundle stream name
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300188 bundle_stream_name = os.environ.get(
189 'BUNDLE_STREAM_NAME',
190 '/private/team/linaro/pre-built-%s/' % DEVICE_STREAM[device_type])
191
Fathi Boudrac14068b2012-12-06 17:42:11 +0200192 # LAVA user
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300193 lava_user = os.environ.get('LAVA_USER')
194 if lava_user is None:
Fathi Boudrac14068b2012-12-06 17:42:11 +0200195 f = open('/var/run/lava/lava-user')
196 lava_user = f.read().strip()
197 f.close()
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300198
Fathi Boudrac14068b2012-12-06 17:42:11 +0200199 # LAVA token
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300200 lava_token = os.environ.get('LAVA_TOKEN')
201 if lava_token is None:
Fathi Boudrac14068b2012-12-06 17:42:11 +0200202 f = open('/var/run/lava/lava-token')
203 lava_token = f.read().strip()
204 f.close()
Fathi Boudrac14068b2012-12-06 17:42:11 +0200205
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300206 # LAVA server URL
207 lava_server = os.environ.get('LAVA_SERVER',
Fathi Boudra62997d92013-07-27 09:58:28 +0300208 'validation.linaro.org/RPC2/')
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300209 # LAVA server base URL
210 lava_server_root = lava_server.rstrip('/')
211 if lava_server_root.endswith('/RPC2'):
212 lava_server_root = lava_server_root[:-len('/RPC2')]
213
214 image_url = '%s/%s/pre-built/%s/%s/%s' % \
215 (snapshots_url,
216 distribution,
217 hwpack_type,
218 hwpack_build_number,
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200219 hwpack_file_name)
220
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300221 git_repo = 'git://git.linaro.org/qa/test-definitions.git'
Senthil Kumaran672ac4d2012-12-19 15:10:59 +0530222
Fathi Boudra0293e672013-12-03 20:14:54 +0200223 lava_test_plan = os.environ.get('LAVA_TEST_PLAN')
224 if lava_test_plan is None:
225 # tests set specific to an image
226 if distribution == 'openembedded':
227 tests = tests_openembedded_minimal
228 if 'lamp' in rootfs_type:
229 tests += tests_openembedded_lamp
230 if 'leg-java' in rootfs_type:
231 tests += tests_openembedded_leg_java
232 elif distribution == 'ubuntu' or distribution == 'quantal' or distribution == 'raring':
233 tests = tests_nano
234 # if ubuntu-desktop, cover more test cases (LEB)
235 if rootfs_type == 'ubuntu-desktop':
236 tests += tests_desktop
237 # if alip, specific tests like bootchart (which should be first)
238 if rootfs_type == 'alip':
239 tests = tests_alip + tests
240 else:
241 lava_test_plan = lava_test_plan.strip("'")
242 tests = lava_test_plan.split()
Andrew McDermottb62dfaf2013-06-26 12:32:30 +0100243
Ricardo Salveti de Araujoacf28542012-06-27 18:56:00 -0300244 # removing bluetooth and wifi for devices that don't support it
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200245 if device_type in ['beaglexm', 'vexpress-a9', 'mx53loco']:
Ricardo Salveti de Araujodd780972012-06-29 11:48:47 -0300246 try:
247 tests.remove('bluetooth-enablement')
248 tests.remove('wifi-enablement')
249 except ValueError:
250 pass
Ricardo Salveti de Araujoacf28542012-06-27 18:56:00 -0300251
252 # vexpress doesn't support PM, so disable pwrmgmt
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200253 if device_type in ['vexpress-a9']:
Ricardo Salveti de Araujodd780972012-06-29 11:48:47 -0300254 try:
255 tests.remove('pwrmgmt')
256 except ValueError:
257 pass
Andy Doane9bf2152012-06-12 15:42:10 -0500258
Fathi Boudra62eb6a92012-12-06 19:02:56 +0200259 if distribution == 'openembedded':
Fathi Boudra4079a582012-12-06 19:42:58 +0200260 actions = [{
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300261 'command': 'deploy_linaro_image',
262 'parameters': {
263 'image': '%s' % image_url,
264 },
265 'metadata': {
266 'hwpack.type': '%s' % hwpack_type,
267 'hwpack.build': '%s' % hwpack_build_number,
268 'rootfs.type': '%s' % rootfs_type,
269 'distribution': '%s' % distribution,
270 }
271 },
272 {
273 'command': 'boot_linaro_image',
274 'parameters': {
275 'options': ['boot_cmds=boot_cmds_oe']
276 }
277 }]
Fathi Boudrad2bd08b2013-05-06 15:00:00 +0300278 elif distribution == 'ubuntu' or distribution == 'quantal' or distribution == 'raring':
Fathi Boudra4079a582012-12-06 19:42:58 +0200279 actions = [{
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300280 'command': 'deploy_linaro_image',
281 'parameters': {
282 'image': '%s' % image_url,
283 },
284 'metadata': {
285 'ubuntu.name': '%s' % hwpack_type,
286 'ubuntu.build': '%s' % hwpack_build_number,
287 'rootfs.type': '%s' % rootfs_type,
288 'ubuntu.distribution': '%s' % distribution,
289 }
290 }]
Fathi Boudra4079a582012-12-06 19:42:58 +0200291
Fathi Boudraa9bbadb2012-12-07 16:10:29 +0200292 if len(tests) > 0:
Fathi Boudrad2bd08b2013-05-06 15:00:00 +0300293 if distribution == 'quantal' or distribution == 'raring':
Fathi Boudra60d0e972013-04-19 10:49:47 +0300294 distribution = 'ubuntu'
Senthil Kumaranb30d7382012-12-19 15:11:47 +0530295 for test in tests:
Fathi Boudraebb2f192013-06-17 10:01:09 +0300296 test_list = [(
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300297 {'git-repo': git_repo,
298 'testdef': '{distribution:>s}/{test:>s}.yaml'.format(
Fathi Boudraebb2f192013-06-17 10:01:09 +0300299 distribution=distribution, test=test)})]
Senthil Kumaran007181c2013-04-16 14:43:19 +0530300
Fathi Boudraebb2f192013-06-17 10:01:09 +0300301 actions.append({
302 'command': 'lava_test_shell',
303 'parameters': {
Fathi Boudrab088b142013-07-19 09:54:04 +0300304 'timeout': tests_timeout.get(test, 18000),
Fathi Boudraebb2f192013-06-17 10:01:09 +0300305 'testdef_repos': test_list
306 }
307 })
Fathi Boudrac14068b2012-12-06 17:42:11 +0200308
309 actions.append({
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300310 'command': 'submit_results',
311 'parameters': {
312 'stream': bundle_stream_name,
313 'server': '%s%s' % ('http://', lava_server)
Fathi Boudrac14068b2012-12-06 17:42:11 +0200314 }
315 })
316
Fathi Boudra4c0dd222013-11-21 13:34:35 +0200317 # XXX Global timeout in LAVA is hardcoded to 24h (24 * 60 60)
318 # https://bugs.launchpad.net/bugs/1226017
319 # Set to 172800s (48h) to workaround the limitation
320 # A sane default is 900s (15m)
321 config = json.dumps({'timeout': 172800,
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300322 'actions': actions,
323 'job_name': '%s%s/%s/' % (ci_base_url,
324 hwpack_job_name,
Fathi Boudrad1f9a862012-12-28 14:46:04 +0200325 hwpack_build_number),
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300326 'device_type': device_type,
Fathi Boudrac14068b2012-12-06 17:42:11 +0200327 }, indent=2)
Fathi Boudra79c1e8b2012-12-02 10:36:57 +0200328
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200329 print config
330
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300331 skip_lava = os.environ.get('SKIP_LAVA')
332 if skip_lava is None:
Fathi Boudra79c1e8b2012-12-02 10:36:57 +0200333 try:
Fathi Boudrac14068b2012-12-06 17:42:11 +0200334 server_url = \
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300335 'https://{lava_user:>s}:{lava_token:>s}@{lava_server:>s}'
Fathi Boudrac14068b2012-12-06 17:42:11 +0200336 server = \
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300337 xmlrpclib.ServerProxy(server_url.format(
338 lava_user=lava_user,
339 lava_token=lava_token,
Fathi Boudrac14068b2012-12-06 17:42:11 +0200340 lava_server=lava_server))
341 lava_job_id = server.scheduler.submit_job(config)
Fathi Boudra79c1e8b2012-12-02 10:36:57 +0200342 except xmlrpclib.ProtocolError, e:
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300343 print 'Error making a LAVA request:', obfuscate_credentials(str(e))
Fathi Boudra79c1e8b2012-12-02 10:36:57 +0200344 sys.exit(1)
Fathi Boudrac14068b2012-12-06 17:42:11 +0200345
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300346 print 'LAVA Job Id: %s, URL: http://%s/scheduler/job/%s' % \
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200347 (lava_job_id, lava_server_root, lava_job_id)
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300348 json.dump({'lava_url': 'http://' + lava_server_root,
Fathi Boudrac14068b2012-12-06 17:42:11 +0200349 'job_id': lava_job_id},
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300350 open('lava-job-info', 'w'))
Fathi Boudra8e4ce562012-12-08 14:35:17 +0200351
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300352 lava_job_info_orig = hwpack_file_name.replace('.img.gz', '.html')
353 top_dir = os.environ.get('WORKSPACE', '.')
Fathi Boudrade020592012-12-10 13:25:14 +0200354 for root, dirs, files in os.walk(top_dir):
355 for file in files:
356 if file == lava_job_info_orig:
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300357 lava_job_info_orig = os.path.join(root, file)
Fathi Boudra5e481022012-12-08 19:21:16 +0200358
Fathi Boudrade020592012-12-10 13:25:14 +0200359 with open(lava_job_info_orig) as f:
360 buffer = f.read()
Fathi Boudra5e481022012-12-08 19:21:16 +0200361
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300362 buffer = buffer.replace(
363 'var lavaJobId = 0',
364 'var lavaJobId = ' + str(lava_job_id), 1)
Fathi Boudrade020592012-12-10 13:25:14 +0200365
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300366 lava_job_info = lava_job_info_orig.replace(
367 '.html',
368 '-' + device_type + '.html')
Fathi Boudrade020592012-12-10 13:25:14 +0200369 with open(lava_job_info, 'w') as f:
370 f.write(buffer)
371 os.remove(lava_job_info_orig)
Fathi Boudra79c1e8b2012-12-02 10:36:57 +0200372 else:
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300373 print 'LAVA job submission skipped.'
Andy Doan61b4d772012-04-24 10:03:28 -0500374
Fathi Boudra3f7ace92013-04-11 13:06:11 +0300375
376if __name__ == '__main__':
Andy Doan61b4d772012-04-24 10:03:28 -0500377 main()