summaryrefslogtreecommitdiffstats
path: root/testcases/VIM
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-01-15 17:31:18 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-01-19 09:10:14 +0000
commit6a9b40697909863f697433b723c1e2a27546a864 (patch)
treef4fee8a6c89b2ecfde435daa73e4a45cc7069d12 /testcases/VIM
parente56ed0ff57a2ed47b856f36462ac633afb94c7ea (diff)
Remove all the unnecessary Rally output
Change-Id: Ic6c719afadae56723ba515eaf9ad5e29be57c129 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com> (cherry picked from commit 29d9df125f30f0fbfd20da687be89603de2b84e1)
Diffstat (limited to 'testcases/VIM')
-rw-r--r--testcases/VIM/OpenStack/CI/libraries/run_rally.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally.py b/testcases/VIM/OpenStack/CI/libraries/run_rally.py
index d5796c1b4..b879758ca 100644
--- a/testcases/VIM/OpenStack/CI/libraries/run_rally.py
+++ b/testcases/VIM/OpenStack/CI/libraries/run_rally.py
@@ -21,6 +21,7 @@ import argparse
import logging
import yaml
import requests
+import subprocess
import sys
from novaclient import client as novaclient
from keystoneclient.v2_0 import client as keystoneclient
@@ -47,7 +48,7 @@ parser.add_argument("-r", "--report",
args = parser.parse_args()
-
+FNULL = open(os.devnull, 'w')
""" logging configuration """
logger = logging.getLogger("run_rally")
logger.setLevel(logging.DEBUG)
@@ -173,8 +174,14 @@ def run_task(test_name):
logger.debug('Scenario fetched from : {}'.format(test_file_name))
cmd_line = "rally task start --abort-on-sla-failure {}".format(test_file_name)
logger.debug('running command line : {}'.format(cmd_line))
- cmd = os.popen(cmd_line)
- task_id = get_task_id(cmd.read())
+ p = subprocess.Popen(cmd_line, stdout=subprocess.PIPE, stderr=FNULL, shell=True)
+ result = ""
+ while p.poll() is None:
+ l = p.stdout.readline()
+ print l.replace('\n', '')
+ result += l
+
+ task_id = get_task_id(result)
logger.debug('task_id : {}'.format(task_id))
if task_id is None: