summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2017-10-23 00:33:10 +0200
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2017-10-23 00:41:48 +0200
commitfaa343d036b5889a520a53250b8a4c3f1a8ba9bd (patch)
treeae3632e22d3e2039b3a7249678ec71c96122313e
parent920fca1f08e39e014414a3c8d105c0f3ab49b3a3 (diff)
test-runner: ResultParser: handle custom params from command line
When setting test params on the command line with -r, they are correctly passed down into run.sh script, however at the end of the test run when we print the result, the custom params from command line are ignored, and we incorrectly print the test params from the .yaml file. e.g. $ test-runner -d automated/linux/wlan-smoke/wlan-smoke.yaml -e -r BOOT=disabled incorrectly prints the following: name,test_case_id,result,measurement,units,test_params wlan-smoke,ip-link,pass,,,DEVICE=wlan0;BOOT=enabled wlan-smoke,wlan-boot,fail,,,DEVICE=wlan0;BOOT=enabled wlan-smoke,wlan-down,pass,,,DEVICE=wlan0;BOOT=enabled wlan-smoke,wlan-up,pass,,,DEVICE=wlan0;BOOT=enabled When parsing the result, we need to override the test params with any param from the command line. After this patch, the same command produces: name,test_case_id,result,measurement,units,test_params wlan-smoke,ip-link,pass,,,DEVICE=wlan0;BOOT=disabled wlan-smoke,wlan-boot,fail,,,DEVICE=wlan0;BOOT=disabled wlan-smoke,wlan-down,pass,,,DEVICE=wlan0;BOOT=disabled wlan-smoke,wlan-up,pass,,,DEVICE=wlan0;BOOT=disabled And for fun: $ test-runner -d automated/linux/wlan-smoke/wlan-smoke.yaml -e -r BOOT=disabled THEBUGISGONE=yes name,test_case_id,result,measurement,units,test_params wlan-smoke,ip-link,pass,,,DEVICE=wlan0;THEBUGISGONE=yes;BOOT=disabled wlan-smoke,wlan-boot,fail,,,DEVICE=wlan0;THEBUGISGONE=yes;BOOT=disabled wlan-smoke,wlan-down,pass,,,DEVICE=wlan0;THEBUGISGONE=yes;BOOT=disabled wlan-smoke,wlan-up,pass,,,DEVICE=wlan0;THEBUGISGONE=yes;BOOT=disabled Change-Id: Ib561620f73e868d53653aa158f35e7804d7e13f3 Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rwxr-xr-xautomated/utils/test-runner.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/automated/utils/test-runner.py b/automated/utils/test-runner.py
index 7783850..267a74a 100755
--- a/automated/utils/test-runner.py
+++ b/automated/utils/test-runner.py
@@ -604,6 +604,9 @@ class ResultParser(object):
self.results['name'] = self.testdef['metadata']['name']
if 'params' in self.testdef.keys():
self.results['params'] = self.testdef['params']
+ if self.args.test_def_params:
+ for param_name, param_value in self.args.test_def_params.items():
+ self.results['params'][param_name] = param_value
if 'parse' in self.testdef.keys() and 'pattern' in self.testdef['parse'].keys():
self.pattern = self.testdef['parse']['pattern']
self.logger.info("Enabling log parse pattern: %s" % self.pattern)