diff options
author | Juha Kosonen <juha.kosonen@nokia.com> | 2018-08-10 16:43:24 +0300 |
---|---|---|
committer | Juha Kosonen <juha.kosonen@nokia.com> | 2018-08-10 16:43:24 +0300 |
commit | 38a61f9112cec92be1103276798f8500871b62e4 (patch) | |
tree | e56a4be0f52a16b623d4f2c129a8f08f64fd62de /functest/opnfv_tests/openstack/rally/rally.py | |
parent | ddf30512b98745460c1d162a54a18b0a8a814912 (diff) |
Remove explicit Rally task validation
Utilize the output of Rally task execution since it internally
validates the task.
Use Popen.communicate to get the output from the running Rally task.
Change-Id: I9b1299bc26129ff4f89adccec611c78195a3ab02
Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/rally/rally.py')
-rw-r--r-- | functest/opnfv_tests/openstack/rally/rally.py | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py index efee15aee..4a6362903 100644 --- a/functest/opnfv_tests/openstack/rally/rally.py +++ b/functest/opnfv_tests/openstack/rally/rally.py @@ -169,14 +169,6 @@ class RallyBase(singlevm.VmReady1): return False @staticmethod - def get_cmd_output(proc): - """Get command stdout.""" - result = "" - for line in proc.stdout: - result += line - return result - - @staticmethod def excl_scenario(): """Exclude scenario.""" black_tests = [] @@ -345,23 +337,15 @@ class RallyBase(singlevm.VmReady1): task_file, "--task-args", str(self._build_task_args(test_name))]) LOGGER.debug('running command: %s', cmd) - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - output = self.get_cmd_output(proc) - task_id = self.get_task_id(output) + output = proc.communicate()[0] + task_id = self.get_task_id(output) LOGGER.debug('task_id : %s', task_id) - if task_id is None: - LOGGER.error('Failed to retrieve task_id, validating task...') - cmd = (["rally", "task", "validate", "--task", task_file, - "--task-args", str(self._build_task_args(test_name))]) - LOGGER.debug('running command: %s', cmd) - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - output = self.get_cmd_output(proc) - LOGGER.error("Task validation result:" + "\n" + output) + LOGGER.error("Failed to retrieve task_id") + LOGGER.error("Result:\n%s", output) raise Exception("Failed to retrieve task id") self._save_results(test_name, task_id) |