aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/rally
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2018-12-19 16:09:53 +0200
committerJuha Kosonen <juha.kosonen@nokia.com>2018-12-19 16:09:53 +0200
commitdd9eb03be634eaa46a89b85cd0c640ec99533b77 (patch)
treeda3e8b7c3d0e3946ceb51e86d301c195ba0f9925 /functest/opnfv_tests/openstack/rally
parent471d030673b2008502c3f5d83d1a16743695bcf4 (diff)
Add task arguments to rally_jobs
Define floating network as a Rally task argument. Enable rally_jobs subtest. Change-Id: I37d7c4718cfb3de3ad1980878e0529d652013ccb Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/rally')
-rw-r--r--functest/opnfv_tests/openstack/rally/rally.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py
index 594905b26..d40645972 100644
--- a/functest/opnfv_tests/openstack/rally/rally.py
+++ b/functest/opnfv_tests/openstack/rally/rally.py
@@ -94,9 +94,9 @@ class RallyBase(singlevm.VmReady2):
self.run_cmd = ''
self.network_extensions = []
- def _build_task_args(self, test_file_name):
+ def build_task_args(self, test_name):
"""Build arguments for the Rally task."""
- task_args = {'service_list': [test_file_name]}
+ task_args = {'service_list': [test_name]}
task_args['image_name'] = str(self.image.name)
task_args['flavor_name'] = str(self.flavor.name)
task_args['flavor_alt_name'] = str(self.flavor_alt.name)
@@ -456,7 +456,7 @@ class RallyBase(singlevm.VmReady2):
return False
self.run_cmd = (["rally", "task", "start", "--abort-on-sla-failure",
"--task", self.task_file, "--task-args",
- str(self._build_task_args(test_name))])
+ str(self.build_task_args(test_name))])
return True
def run_tests(self):
@@ -662,6 +662,15 @@ class RallyJobs(RallyBase):
with open(result_file_name, 'w') as fname:
template.dump(cases, fname)
+ def build_task_args(self, test_name):
+ """Build arguments for the Rally task."""
+ task_args = {}
+ if self.ext_net:
+ task_args['floating_network'] = str(self.ext_net.name)
+ else:
+ task_args['floating_network'] = ''
+ return task_args
+
@staticmethod
def _remove_plugins_extra():
inst_dir = getattr(config.CONF, 'dir_rally_inst')
@@ -692,7 +701,8 @@ class RallyJobs(RallyBase):
os.makedirs(self.TEMP_DIR)
task_file_name = os.path.join(self.TEMP_DIR, task_name)
self.apply_blacklist(task, task_file_name)
- self.run_cmd = (["rally", "task", "start", "--task", task_file_name])
+ self.run_cmd = (["rally", "task", "start", "--task", task_file_name,
+ "--task-args", str(self.build_task_args(test_name))])
return True
def clean(self):