aboutsummaryrefslogtreecommitdiff
path: root/build-scripts/post-build-lava.py
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2013-02-06 14:27:01 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2013-02-06 14:27:01 +0800
commitd12d59d250e052751382f72b92246120cc952617 (patch)
tree771cfa35903f0500acf808772da435088c9f2f78 /build-scripts/post-build-lava.py
parentd6ac55659c03934b245b7d516332cc0fbaa20ef8 (diff)
fix some errors
Diffstat (limited to 'build-scripts/post-build-lava.py')
-rwxr-xr-xbuild-scripts/post-build-lava.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py
index 218da15..e33fa27 100755
--- a/build-scripts/post-build-lava.py
+++ b/build-scripts/post-build-lava.py
@@ -43,16 +43,17 @@ TIMEOUT_SUFFIX = "_TIMEOUT"
# reboot in between test actions.
REBOOT_TOKEN = '[system-reboot]'
-def gen_lava_test_shell_action(test_para=None):
- if not test_para:
+
+def gen_lava_test_shell_action(test_name=None, test_para=None):
+ if not test_para or not test_name:
return None
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]
+ continue
+ if pair[0]:
key_value_hash[pair[0]] = pair[1]
parameters = {}
if key_value_hash.get('timeout'):
@@ -60,7 +61,7 @@ def gen_lava_test_shell_action(test_para=None):
if test_name == 'lava-test-shell-url':
if key_value_hash.get('url'):
- parameters = {"testdef_urls": [key_value_hash['url']]}
+ parameters["testdef_urls"] = [key_value_hash['url']]
else:
return None
action = {
@@ -68,24 +69,24 @@ def gen_lava_test_shell_action(test_para=None):
"parameters": parameters
}
return action
- else
+ else:
if not key_value_hash.get('repo'):
return None
repo = {}
if test_name == 'lava-test-shell-git':
- repo = { "git-repo": key_value_hash.get('repo')}
+ repo = {"git-repo": key_value_hash.get('repo')}
elif test_name == 'lava-test-shell-bzr':
- repo = { "bzr-repo": key_value_hash.get('repo')}
+ repo = {"bzr-repo": key_value_hash.get('repo')}
else:
return None
if key_value_hash.get('revision'):
- repo = { "revision": key_value_hash.get('revision')}
+ repo["revision"] = key_value_hash.get('revision')
if key_value_hash.get('testdef'):
- repo = { "testdef": key_value_hash.get('testdef')}
+ repo["testdef"] = key_value_hash.get('testdef')
- parameters = {"testdef_repos": [repo]}
+ parameters["testdef_repos"] = [repo]
action = {
"command": "lava_test_shell",
"parameters": parameters
@@ -140,7 +141,8 @@ def gen_lava_android_test_actions(tests=[]):
test = test[:test.find('(')].strip()
if test.startswith('lava-test-shell'):
- run_action = gen_lava_test_shell_action(test_para=test_option))
+ run_action = gen_lava_test_shell_action(test_name=test,
+ test_para=test_option)
if run_action:
actions.append(run_action)
continue
@@ -165,7 +167,7 @@ def gen_lava_android_test_actions(tests=[]):
actions.append(run_action)
elif test == 'hostshell-workload':
config = "config.csv"
- workload_url = "ssh://linaro-lava@linaro-lava@mombin.canonical.com/srv/linaro-private.git.linaro.org/people/bhoj/workload-automation.git"
+ workload_url = "ssh://linaro-lava@mombin.canonical.com/srv/linaro-private.git.linaro.org/people/bhoj/workload-automation.git"
config_list = []
config_prefix = "WORKLOAD_CONFIG_"
url_prefix = "WORKLOAD_URL"