Merge lp:~fboudra/linaro-ci/convert-template-to-lava-test-shell-lp1194435 into lp:linaro-ci

Proposed by Fathi Boudra
Status: Merged
Approved by: Fathi Boudra
Approved revision: 158
Merged at revision: 158
Proposed branch: lp:~fboudra/linaro-ci/convert-template-to-lava-test-shell-lp1194435
Merge into: lp:linaro-ci
Diff against target: 132 lines (+37/-42)
1 file modified
get_latest_ci_hwpack (+37/-42)
To merge this branch: bzr merge lp:~fboudra/linaro-ci/convert-template-to-lava-test-shell-lp1194435
Reviewer Review Type Date Requested Status
Linaro Infrastructure Pending
Review via email: mp+172198@code.launchpad.net

Description of the change

Convert LAVA template to lava-test-shell (LP:#1194435)

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 'get_latest_ci_hwpack'
2--- get_latest_ci_hwpack 2013-02-11 22:00:07 +0000
3+++ get_latest_ci_hwpack 2013-06-29 13:34:26 +0000
4@@ -17,30 +17,26 @@
5 hwpacktype = os.getenv("HWPACK_TYPE", "unknown")
6 imagetype = os.getenv("ROOTFS_TYPE", "unknown")
7 job_name = os.getenv("KERNEL_JOB_NAME", "unknown") + '_' + \
8- os.getenv("HWPACK_BUILD_DATE", "unknown") + '_daily test'
9+ os.getenv("HWPACK_BUILD_DATE", "unknown") + '_daily test'
10
11 testplan = os.getenv("LAVA_TEST_PLAN", "ltp, pwrmgmt")
12 osdevicetags = os.getenv("DEVICE_TAGS", "none")
13
14 template = {
15- "timeout": 20000,
16- "actions": [
17- {
18- "command": "deploy_linaro_image"
19- },
20- {
21- "command": "boot_linaro_image"
22- },
23- {
24- "command": "submit_results",
25- "parameters": {
26- "stream": os.getenv("BUNDLE_STREAM_NAME", "/anonymous/plars/"),
27- "server": "http://validation.linaro.org/lava-server/RPC2/"
28- }
29- }
30- ],
31- "job_name": job_name,
32- "device_type": board
33+ "timeout": 18000,
34+ "actions": [{
35+ "command": "deploy_linaro_image"
36+ },
37+ {
38+ "command": "submit_results",
39+ "parameters": {
40+ "stream": os.getenv("BUNDLE_STREAM_NAME",
41+ "/anonymous/plars/"),
42+ "server": "http://validation.linaro.org/lava-server/RPC2/"
43+ }
44+ }],
45+ "job_name": job_name,
46+ "device_type": board
47 }
48
49 if osdevicetags != "none":
50@@ -55,11 +51,11 @@
51
52 latest_hwpack = os.getenv('HWPACK_NAME', 'unknown')
53 hwpack_url = find_ci_latest(hwpack_url_path, latest_hwpack)
54- if hwpack_url == None:
55+ if hwpack_url is None:
56 sys.exit(1)
57 rootfs_url = find_latest_rootfs(imagetype)
58- rootfs_name, rootfsdate, rootfsbuild = os.path.basename(rootfs_url).\
59- rsplit(".", 2)[0].rsplit("-", 2)
60+ rootfs_name, rootfsdate, rootfsbuild = os.path.basename(rootfs_url). \
61+ rsplit(".", 2)[0].rsplit("-", 2)
62
63 deploy_params = {'hwpack': hwpack_url, 'rootfs': rootfs_url}
64 template['actions'][0]['parameters'] = deploy_params
65@@ -67,7 +63,8 @@
66 metadata = {}
67 hwpack_filename = os.path.basename(hwpack_url)
68 hwpackdate, hwpackbuild = hwpack_filename.rsplit('_', 4)[1].split('-')
69- metadata['git_url'] = os.getenv("KERNEL_GIT", "git://git.linaro.org/kernel/unknown")
70+ metadata['git_url'] = os.getenv("KERNEL_GIT",
71+ "git://git.linaro.org/kernel/unknown")
72 metadata['kernel.gitweb_url'] = os.getenv("GIT_WEB_URL", "unknown")
73 metadata['git_commitid'] = os.getenv("KERNEL_COMMIT", "unknown")
74 metadata['kernel_name'] = os.getenv("KERNEL_NAME", "unknown")
75@@ -88,42 +85,40 @@
76
77 testcases = testplan.split(',')
78 testcases = [tc.strip() for tc in testplan.split(',')]
79- regex = re.compile("(?P<testcase>^\w+)(\((?P<options>[^\)]+)\))?"\
80+ regex = re.compile("(?P<testcase>^\w+)(\((?P<options>[^\)]+)\))?"
81 "(:(?P<timeout>\d+))?")
82
83- # Dict for lava_test_install
84- lava_test_install_command = {}
85- lava_test_install_command["command"] = "lava_test_install"
86- lava_test_install_command["parameters"] = {"tests": [], "timeout": 4000}
87-
88 # The positions in the template dict to insert test install/run commands
89- install_cmd_pos = 1
90- run_cmd_pos = 2
91+ run_cmd_pos = 1
92
93 for testcase in testcases:
94 r = regex.search(testcase)
95- if r.group("testcase") != None:
96- lava_test_install_command["parameters"]["tests"].\
97- append(r.group("testcase"))
98-
99- # append lava_test_run commands
100- timeout = 4800
101+ if r.group("testcase") is not None:
102+ # append commands
103+ timeout = 1200
104 if r.group('timeout'):
105 timeout = int(r.group('timeout'))
106
107+ test_list = [({
108+ 'git-repo': 'git://git.linaro.org/qa/test-definitions.git',
109+ 'testdef': '{distribution:>s}/{test:>s}.yaml'.format(
110+ distribution='ubuntu', test=r.group('testcase'))})]
111+
112 lava_test_run_command = {}
113- lava_test_run_command["command"] = "lava_test_run"
114- lava_test_run_command["parameters"] = {"test_name": r.group('testcase'),
115- "timeout": timeout}
116+ lava_test_run_command["command"] = "lava_test_shell"
117+ lava_test_run_command["parameters"] = {
118+ "timeout": timeout,
119+ 'testdef_repos': test_list
120+ }
121
122 if r.group("options"):
123- lava_test_run_command["parameters"]["test_options"] = r.group("options")
124+ lava_test_run_command["parameters"]["test_options"] = \
125+ r.group("options")
126
127 template['actions'].insert(run_cmd_pos, lava_test_run_command)
128 run_cmd_pos = run_cmd_pos + 1
129
130 # append the lava test install command
131- template['actions'].insert(install_cmd_pos, lava_test_install_command)
132 print json.dumps(template, indent=2)
133
134

Subscribers

People subscribed via source and target branches