44
44
REBOOT_TOKEN = '[system-reboot]'
47
def gen_lava_test_shell_action(test_name=None, test_para=None):
48
if not test_para or not test_name:
50
key_value_ary = test_para.split()
52
for pair_line in key_value_ary:
53
pair = pair_line.split('=', 1)
57
key_value_hash[pair[0]] = pair[1]
59
if key_value_hash.get('timeout'):
60
parameters['timeout'] = int(key_value_hash.get('timeout'))
62
if test_name == 'lava-test-shell-url':
63
if key_value_hash.get('url'):
64
parameters["testdef_urls"] = [key_value_hash['url']]
68
"command": "lava_test_shell",
69
"parameters": parameters
73
if not key_value_hash.get('repo'):
77
if test_name == 'lava-test-shell-git':
78
repo = {"git-repo": key_value_hash.get('repo')}
79
elif test_name == 'lava-test-shell-bzr':
80
repo = {"bzr-repo": key_value_hash.get('repo')}
84
if key_value_hash.get('revision'):
85
repo["revision"] = key_value_hash.get('revision')
86
if key_value_hash.get('testdef'):
87
repo["testdef"] = key_value_hash.get('testdef')
89
parameters["testdef_repos"] = [repo]
91
"command": "lava_test_shell",
92
"parameters": parameters
47
98
def gen_lava_android_test_actions(tests=[]):
49
100
if len(tests) == 0:
55
106
if test.startswith("android_"):
109
#skip lava-test-shell test
110
if test.startswith("lava-test-shell"):
58
113
if test == REBOOT_TOKEN:
60
115
## support for test that specified with option like methanol,methanol(DEFAULT)
85
140
test_option = test[test.find('(') + 1 : test.rfind(')')]
86
141
test = test[:test.find('(')].strip()
143
if test.startswith('lava-test-shell'):
144
run_action = gen_lava_test_shell_action(test_name=test,
145
test_para=test_option)
147
actions.append(run_action)
90
151
if not test_option:
106
167
actions.append(run_action)
107
168
elif test == 'hostshell-workload':
108
169
config = "config.csv"
109
workload_url = "ssh://linaro-lava@linaro-lava@mombin.canonical.com/srv/linaro-private.git.linaro.org/people/bhoj/workload-automation.git"
170
workload_url = "ssh://linaro-lava@mombin.canonical.com/srv/linaro-private.git.linaro.org/people/bhoj/workload-automation.git"
111
172
config_prefix = "WORKLOAD_CONFIG_"
112
173
url_prefix = "WORKLOAD_URL"