diff options
author | Juha Kosonen <juha.kosonen@nokia.com> | 2016-04-29 13:23:12 +0000 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2016-04-29 14:32:15 +0000 |
commit | 55a13b0e1de1e8d776168354ec64d165cb468442 (patch) | |
tree | e756c0250cda0f015be66c1c3ab4c53c4c9fd234 /testcases/VIM | |
parent | 620c987f338dbe9e3fd379b9a2e4134401ea33b8 (diff) |
Execute successive scenarios after task failure
Log the result of task validation and proceed executing next rally
scenario when the current task start-up fails.
JIRA: FUNCTEST-230
Change-Id: I5544a9559636f671035578f9cc5cf6f934bcbcd8
Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
(cherry picked from commit 4bdb6ed6d41aed8763f22aa84155ac810569deb1)
Diffstat (limited to 'testcases/VIM')
-rwxr-xr-x | testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py | 22 |
1 files changed, 20 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 2137e9493..2176c25c2 100755 --- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py @@ -284,6 +284,16 @@ def get_output(proc, test_name): return result +def get_cmd_output(proc): + result = "" + + while proc.poll() is None: + line = proc.stdout.readline() + result += line + + return result + + def run_task(test_name): # # the "main" function of the script who launch rally for a task @@ -318,8 +328,16 @@ def run_task(test_name): logger.debug('task_id : {}'.format(task_id)) if task_id is None: - logger.error("Failed to retrieve task_id.") - exit(-1) + logger.error('Failed to retrieve task_id, validating task...') + cmd_line = ("rally task validate " + + "--task {} ".format(task_file) + + "--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=subprocess.STDOUT, shell=True) + output = get_cmd_output(p) + logger.error("Task validation result:" + "\n" + output) + return # check for result directory and create it otherwise if not os.path.exists(RESULTS_DIR): |