aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/VIM/OpenStack/CI/libraries
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2016-02-01 14:47:41 +0000
committerJuha Kosonen <juha.kosonen@nokia.com>2016-02-01 14:47:41 +0000
commite75f34706a8d72ee440d7f94363d4909a02f5293 (patch)
tree85711bddadf9e0a2a5e1f3bde5e4212f763da59b /testcases/VIM/OpenStack/CI/libraries
parent63c77f27ec173fc3684ed980e82a4a7ed97beb6b (diff)
Enable all rally outputs in verbose mode
In verbose mode the complete output of rally tests is shown. Change-Id: I315c89b270312b13b3630b97cc24e5f529952645 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'testcases/VIM/OpenStack/CI/libraries')
-rwxr-xr-xtestcases/VIM/OpenStack/CI/libraries/run_rally-cert.py47
1 files changed, 28 insertions, 19 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
index efdde671..71bf743f 100755
--- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
+++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
@@ -192,6 +192,32 @@ def build_task_args(test_file_name):
return task_args
+def get_output(proc):
+ result = ""
+ if args.verbose:
+ while proc.poll() is None:
+ line = proc.stdout.readline()
+ print line.replace('\n', '')
+ result += line
+ else:
+ while proc.poll() is None:
+ line = proc.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)
+
+ return result
+
+
def run_task(test_name):
#
# the "main" function of the script who launch rally for a task
@@ -219,25 +245,8 @@ def run_task(test_name):
logger.debug('running command line : {}'.format(cmd_line))
p = subprocess.Popen(cmd_line, stdout=subprocess.PIPE, stderr=RALLY_STDERR, shell=True)
- result = ""
- while p.poll() is None:
- #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)
+ output = get_output(p)
+ task_id = get_task_id(output)
logger.debug('task_id : {}'.format(task_id))
if task_id is None: