summaryrefslogtreecommitdiffstats
path: root/testcases/VIM/OpenStack
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-01-19 10:19:31 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-01-19 10:26:01 +0000
commit2ddb13d4109c10c54bde252dec50ea49a8f8e165 (patch)
treee99eb8357deee9883bbf52c15a0dec9e59394af3 /testcases/VIM/OpenStack
parent26b4223528d35019de8cefb0f6bacddae0d00ff8 (diff)
Remove rally stderr output from rally-cert
Change-Id: I2a5bb72989639059f082eedfb4abe8d582bef35c Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com> (cherry picked from commit 79a23744af12da7163e3a142dd44f60d46cbfd41)
Diffstat (limited to 'testcases/VIM/OpenStack')
-rwxr-xr-xtestcases/VIM/OpenStack/CI/libraries/run_rally-cert.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
index b5fcd7218..13066b3df 100755
--- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
+++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
@@ -21,6 +21,7 @@ import argparse
import logging
import yaml
import requests
+import subprocess
import sys
from novaclient import client as novaclient
from glanceclient import client as glanceclient
@@ -53,6 +54,7 @@ args = parser.parse_args()
client_dict = {}
+FNULL = open(os.devnull, 'w')
""" logging configuration """
logger = logging.getLogger("run_rally")
logger.setLevel(logging.DEBUG)
@@ -208,8 +210,15 @@ def run_task(test_name):
"--task {} ".format(task_file) + \
"--task-args \"{}\" ".format(build_task_args(test_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: