diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-01-21 12:37:17 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-01-21 12:37:17 +0000 |
commit | a063f3152f808c747a319b17f97dda452ebb4ae9 (patch) | |
tree | 09b592a8e1e3c65e67e4815937f9b4d3369fa145 /testcases/VIM | |
parent | 2520c3221bdbb5ca75ad0c2d70f30388528d01de (diff) | |
parent | c2fcca7373e4b65d4eec221e020bc49c9e443a70 (diff) |
Merge "Add control to redirect rally stderr"
Diffstat (limited to 'testcases/VIM')
-rwxr-xr-x | testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py | 11 | ||||
-rwxr-xr-x[-rw-r--r--] | testcases/VIM/OpenStack/CI/libraries/run_rally.py | 10 |
2 files changed, 17 insertions, 4 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py index 17a6596d3..1c27b0273 100755 --- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py @@ -49,12 +49,19 @@ parser.add_argument("-r", "--report", parser.add_argument("-s", "--smoke", help="Smoke test mode", action="store_true") +parser.add_argument("-v", "--verbose", + help="Print verbose info about the progress", + action="store_true") args = parser.parse_args() client_dict = {} -FNULL = open(os.devnull, 'w') +if args.verbose: + RALLY_STDERR = subprocess.STDOUT +else: + RALLY_STDERR = open(os.devnull, 'w') + """ logging configuration """ logger = logging.getLogger("run_rally") logger.setLevel(logging.DEBUG) @@ -211,7 +218,7 @@ def run_task(test_name): "--task-args \"{}\" ".format(build_task_args(test_name)) logger.debug('running command line : {}'.format(cmd_line)) - p = subprocess.Popen(cmd_line, stdout=subprocess.PIPE, stderr=FNULL, shell=True) + p = subprocess.Popen(cmd_line, stdout=subprocess.PIPE, stderr=RALLY_STDERR, shell=True) result = "" while p.poll() is None: l = p.stdout.readline() diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally.py b/testcases/VIM/OpenStack/CI/libraries/run_rally.py index a7f1db13a..d1088014c 100644..100755 --- a/testcases/VIM/OpenStack/CI/libraries/run_rally.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_rally.py @@ -44,11 +44,17 @@ parser.add_argument("-d", "--debug", help="Debug mode", action="store_true") parser.add_argument("-r", "--report", help="Create json result file", action="store_true") +parser.add_argument("-v", "--verbose", + help="Print verbose info about the progress", + action="store_true") args = parser.parse_args() +if args.verbose: + RALLY_STDERR = subprocess.STDOUT +else: + RALLY_STDERR = open(os.devnull, 'w') -FNULL = open(os.devnull, 'w') """ logging configuration """ logger = logging.getLogger("run_rally") logger.setLevel(logging.DEBUG) @@ -164,7 +170,7 @@ 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)) - p = subprocess.Popen(cmd_line, stdout=subprocess.PIPE, stderr=FNULL, shell=True) + p = subprocess.Popen(cmd_line, stdout=subprocess.PIPE, stderr=RALLY_STDERR, shell=True) result = "" while p.poll() is None: l = p.stdout.readline() |