From 8706cc5bf79a2c556d4746d6e776c8beec287229 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Wed, 27 Mar 2013 15:41:55 +0800 Subject: add support for specifying the adb_check option for system-reboot action --- build-scripts/post-build-lava.py | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 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 e33fa27..f5778df 100755 --- a/build-scripts/post-build-lava.py +++ b/build-scripts/post-build-lava.py @@ -95,6 +95,28 @@ def gen_lava_test_shell_action(test_name=None, test_para=None): return action +def gen_reboot_action(test_para=None): + action = {"command": "boot_linaro_android_image"} + if not test_para: + return action + key_value_ary = test_para.split() + key_value_hash = {} + for pair_line in key_value_ary: + pair = pair_line.split('=', 1) + if len(pair) != 2: + continue + if pair[0]: + key_value_hash[pair[0]] = pair[1] + + parameters = {} + adb_check_val = key_value_hash.get('adb_check') + if adb_check_val and adb_check_val.lower() == 'true': + parameters['adb_check'] = True + action['parameters'] = parameters + + return action + + def gen_lava_android_test_actions(tests=[]): actions = [] if len(tests) == 0: @@ -110,7 +132,7 @@ def gen_lava_android_test_actions(tests=[]): if test.startswith("lava-test-shell"): continue - if test == REBOOT_TOKEN: + if test.startswith(REBOOT_TOKEN): continue ## support for test that specified with option like methanol,methanol(DEFAULT) if test.find('(') >= 0\ @@ -147,6 +169,12 @@ def gen_lava_android_test_actions(tests=[]): actions.append(run_action) continue + if test.startswith(REBOOT_TOKEN): + run_action = gen_reboot_action(test_para=test_option) + if run_action: + actions.append(run_action) + continue + parameters = {} if not test_option: test_option = os.environ.get('%s%s' % (test.upper(), OPTION_SUFFIX)) @@ -188,15 +216,13 @@ def gen_lava_android_test_actions(tests=[]): } actions.append(run_action) actions.append({"command": "boot_linaro_android_image"}) - elif test != REBOOT_TOKEN: + else: parameters['test_name'] = test run_action = { "command": "lava_android_test_run", "parameters": parameters } actions.append(run_action) - else: - actions.append({"command": "boot_linaro_android_image"}) return actions -- cgit v1.2.3