From ac0b2d8b8328a7d67de8bbb5835a4a45a31f3590 Mon Sep 17 00:00:00 2001 From: Alexander Sack Date: Wed, 16 May 2012 15:14:01 +0200 Subject: add support to pass LAVA_DEVICE_TYPE and LAVA_DEVICE through build config --- build-scripts/post-build-lava.py | 42 ++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'build-scripts/post-build-lava.py') 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 -- cgit v1.2.3