aboutsummaryrefslogtreecommitdiff
path: root/build-scripts/post-build-lava.py
diff options
context:
space:
mode:
authorAlexander Sack <asac@linaro.org>2012-05-16 15:14:01 +0200
committerAlexander Sack <asac@linaro.org>2012-05-16 15:14:01 +0200
commitac0b2d8b8328a7d67de8bbb5835a4a45a31f3590 (patch)
tree309e3368ef0da399b68d13b7d0d3b4e594755361 /build-scripts/post-build-lava.py
parent70d179c2653f00a5e1e7b78ba2635fd36f87e25e (diff)
add support to pass LAVA_DEVICE_TYPE and LAVA_DEVICE through build config
Diffstat (limited to 'build-scripts/post-build-lava.py')
-rwxr-xr-xbuild-scripts/post-build-lava.py42
1 files changed, 28 insertions, 14 deletions
diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py
index 8843b98..81ab348 100755
--- a/build-scripts/post-build-lava.py
+++ b/build-scripts/post-build-lava.py
@@ -11,37 +11,37 @@ def obfuscate_credentials(s):
# Map a TARGET_PRODUCT to LAVA parameters.
PRODUCT_MAP = {
"pandaboard": {
- "test_target": "panda",
+ "test_device_type": "panda",
"image_path": "%s%s" % (
"target/product/",
"pandaboard")},
"full_panda": {
- "test_target": "panda",
+ "test_device_type": "panda",
"image_path": "%s%s" % (
"target/product/",
"panda")},
"beagleboard": {
- "test_target": "beaglexm",
+ "test_device_type": "beaglexm",
"image_path": "%s%s" % (
"target/product/",
"beagleboard")},
"snowball": {
- "test_target": "snowball_sd",
+ "test_device_type": "snowball_sd",
"image_path": "%s%s" % (
"target/product/",
"snowball")},
"iMX53": {
- "test_target": "mx53loco",
+ "test_device_type": "mx53loco",
"image_path": "%s%s" % (
"target/product/",
"iMX53")},
"origen": {
- "test_target": "origen",
+ "test_device_type": "origen",
"image_path": "%s%s" % (
"target/product/",
"origen")},
"vexpress" : {
- "test_target": "vexpress",
+ "test_device_type": "vexpress",
"image_path": "%s%s" % (
"target/product/",
"vexpress")},
@@ -200,13 +200,27 @@ def main():
}
})
- config = json.dumps({"job_name": build_url,
- "image_type": 'android',
- "device_type": PRODUCT_MAP[target_product]["test_target"],
- "timeout": 18000,
- "actions": actions
- },
- indent=4)
+ # allow overload lava device_type by build config
+ test_device_type = os.environ.get("LAVA_DEVICE_TYPE")
+ if test_device_type == None:
+ test_device_type = PRODUCT_MAP[target_product]["test_device_type"]
+
+ # allow to submit to a specific device
+ test_device = os.environ.get("LAVA_DEVICE")
+
+ config_json = {"job_name": build_url,
+ "image_type": 'android',
+ "timeout": 18000,
+ "actions": actions
+ }
+
+ # test_device set will win over test_device_type
+ if test_device is None:
+ config_json["device_type"] = test_device_type
+ else
+ config_json["target"] = test_device
+
+ config = json.dumps(config_json, indent=4)
print config