From b0365d10fda5018721d012602077dddda948a6d9 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Thu, 28 Jan 2016 01:08:59 +0100 Subject: Reduce Rally output This patch intends to reduce the output of Rally test, showing only the important information of the tests, which is the scenario name and the table with results. Showing the scenario json/yaml is unnecessary since it is already in the repo. Change-Id: Iff0ba3fed17212bb4a695c4155747c8aaf683da3 Signed-off-by: jose.lausuch --- .../VIM/OpenStack/CI/libraries/run_rally-cert.py | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'testcases/VIM') diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py index d2128d9ac..72d70abd6 100755 --- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py @@ -218,10 +218,22 @@ def run_task(test_name): p = subprocess.Popen(cmd_line, stdout=subprocess.PIPE, stderr=RALLY_STDERR, shell=True) result = "" while p.poll() is None: - l = p.stdout.readline() - print l.replace('\n', '') - result += l - + #l = p.stdout.readline() + #line = l.replace('\n', '') + line = p.stdout.readline() + if "Load duration" in line or \ + "started" in line or \ + "finished" in line or \ + " Preparing" in line or \ + "+-" in line or \ + "|" in line: + result += line + elif "test scenario" in line: + result += "\n" + line + elif "Full duration" in line: + result += line + "\n\n" + + logger.info("\n" + result) task_id = get_task_id(result) logger.debug('task_id : {}'.format(task_id)) @@ -262,9 +274,9 @@ def run_task(test_name): """ parse JSON operation result """ if task_succeed(json_results): - print 'Test OK' + logger.info("Test OK.") else: - print 'Test KO' + logger.info("Test Failed.") def main(): @@ -307,7 +319,6 @@ def main(): for test_name in tests: if not (test_name == 'all' or test_name == 'vm'): - print(test_name) run_task(test_name) else: print(args.test_name) -- cgit 1.2.3-korg