Merge lp:~asac/linaro-android-build-tools/select-lava-device-through-build-config into lp:linaro-android-build-tools

Proposed by Alexander Sack
Status: Merged
Merged at revision: 467
Proposed branch: lp:~asac/linaro-android-build-tools/select-lava-device-through-build-config
Merge into: lp:linaro-android-build-tools
Diff against target: 82 lines (+28/-14)
1 file modified
build-scripts/post-build-lava.py (+28/-14)
To merge this branch: bzr merge lp:~asac/linaro-android-build-tools/select-lava-device-through-build-config
Reviewer Review Type Date Requested Status
Paul Sokolovsky Approve
Review via email: mp+105905@code.launchpad.net

Description of the change

add support for selecting device type and even a concrete device in android build jobs.

 -> the latter is particularly interesting for running multiple benchmarks and repetitionms on the same machine!

Note: this code was not run... just developed dry. Please try out and fix potential syntax etc. and ping me when you are unhappy as I might not see the email :)...

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

might want to update:

 https://wiki.linaro.org/Platform/Android/AndroidBuild-LavaIntegration

once the code is merged

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

+ config_json["device"] = test_device

This needs to be config_json["target"] (yay consistency)

Revision history for this message
Alexander Sack (asac) wrote :

repushed with michaels fix

465. By Alexander Sack

add support to pass LAVA_DEVICE_TYPE and LAVA_DEVICE through build config

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

My understanding that now LAVA allows to specify specific board ID to run test on (like panda-2, meaning board #2 in panda cluster).

Then comment to LAVA that indeed, could be more consistency for "device_type" and "target" keys...

The code logic appears to ok otherwise, though I'd rewrite it a bit to be more clear (will do myself later I guess).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build-scripts/post-build-lava.py'
2--- build-scripts/post-build-lava.py 2012-05-03 12:38:30 +0000
3+++ build-scripts/post-build-lava.py 2012-05-16 13:22:20 +0000
4@@ -11,37 +11,37 @@
5 # Map a TARGET_PRODUCT to LAVA parameters.
6 PRODUCT_MAP = {
7 "pandaboard": {
8- "test_target": "panda",
9+ "test_device_type": "panda",
10 "image_path": "%s%s" % (
11 "target/product/",
12 "pandaboard")},
13 "full_panda": {
14- "test_target": "panda",
15+ "test_device_type": "panda",
16 "image_path": "%s%s" % (
17 "target/product/",
18 "panda")},
19 "beagleboard": {
20- "test_target": "beaglexm",
21+ "test_device_type": "beaglexm",
22 "image_path": "%s%s" % (
23 "target/product/",
24 "beagleboard")},
25 "snowball": {
26- "test_target": "snowball_sd",
27+ "test_device_type": "snowball_sd",
28 "image_path": "%s%s" % (
29 "target/product/",
30 "snowball")},
31 "iMX53": {
32- "test_target": "mx53loco",
33+ "test_device_type": "mx53loco",
34 "image_path": "%s%s" % (
35 "target/product/",
36 "iMX53")},
37 "origen": {
38- "test_target": "origen",
39+ "test_device_type": "origen",
40 "image_path": "%s%s" % (
41 "target/product/",
42 "origen")},
43 "vexpress" : {
44- "test_target": "vexpress",
45+ "test_device_type": "vexpress",
46 "image_path": "%s%s" % (
47 "target/product/",
48 "vexpress")},
49@@ -200,13 +200,27 @@
50 }
51 })
52
53- config = json.dumps({"job_name": build_url,
54- "image_type": 'android',
55- "device_type": PRODUCT_MAP[target_product]["test_target"],
56- "timeout": 18000,
57- "actions": actions
58- },
59- indent=4)
60+ # allow overload lava device_type by build config
61+ test_device_type = os.environ.get("LAVA_DEVICE_TYPE")
62+ if test_device_type == None:
63+ test_device_type = PRODUCT_MAP[target_product]["test_device_type"]
64+
65+ # allow to submit to a specific device
66+ test_device = os.environ.get("LAVA_DEVICE")
67+
68+ config_json = {"job_name": build_url,
69+ "image_type": 'android',
70+ "timeout": 18000,
71+ "actions": actions
72+ }
73+
74+ # test_device set will win over test_device_type
75+ if test_device is None:
76+ config_json["device_type"] = test_device_type
77+ else
78+ config_json["target"] = test_device
79+
80+ config = json.dumps(config_json, indent=4)
81
82 print config
83

Subscribers

People subscribed via source and target branches