X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=testcases%2FVIM%2FOpenStack%2FCI%2Flibraries%2Frun_rally-cert.py;h=26e6b8c19657313fa033d7e05911c2739beb9120;hb=4bdb6ed6d41aed8763f22aa84155ac810569deb1;hp=4acc432bcb16e2542e614646883d892faa4e3e41;hpb=3aeebe978f0d1821133f8b554e5bed06eb88f9a8;p=functest.git diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py index 4acc432bc..26e6b8c19 100755 --- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py @@ -282,6 +282,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 @@ -316,8 +326,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):