summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docker/components/testcases.yaml3
-rw-r--r--docker/smoke/testcases.yaml6
-rw-r--r--functest/opnfv_tests/openstack/rally/rally.py16
3 files changed, 19 insertions, 6 deletions
diff --git a/docker/components/testcases.yaml b/docker/components/testcases.yaml
index 73a88aeb7..d0bfa0afe 100644
--- a/docker/components/testcases.yaml
+++ b/docker/components/testcases.yaml
@@ -50,3 +50,6 @@ tiers:
OpenStack Rally suite using several threads and iterations.
run:
name: rally_full
+ args:
+ optional:
+ - 'gnocchi'
diff --git a/docker/smoke/testcases.yaml b/docker/smoke/testcases.yaml
index 381791ac6..feaa383b7 100644
--- a/docker/smoke/testcases.yaml
+++ b/docker/smoke/testcases.yaml
@@ -51,6 +51,9 @@ tiers:
Rally suite in smoke mode.
run:
name: rally_sanity
+ args:
+ optional:
+ - 'gnocchi'
-
case_name: rally_jobs
@@ -62,6 +65,9 @@ tiers:
OpenStack gating
run:
name: rally_jobs
+ args:
+ optional:
+ - 'gnocchi'
-
case_name: refstack_defcore
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py
index 594905b26..52a5223f7 100644
--- a/functest/opnfv_tests/openstack/rally/rally.py
+++ b/functest/opnfv_tests/openstack/rally/rally.py
@@ -25,7 +25,6 @@ import prettytable
from ruamel.yaml import YAML
from six.moves import configparser
from xtesting.core import testcase
-from xtesting.energy import energy
import yaml
from functest.core import singlevm
@@ -93,6 +92,7 @@ class RallyBase(singlevm.VmReady2):
self.tests = []
self.run_cmd = ''
self.network_extensions = []
+ self.services = []
def _build_task_args(self, test_file_name):
"""Build arguments for the Rally task."""
@@ -446,6 +446,9 @@ class RallyBase(singlevm.VmReady2):
self.compute_cnt = len(self.cloud.list_hypervisors())
self.network_extensions = self.cloud.get_network_extensions()
self.flavor_alt = self.create_flavor_alt()
+ self.services = [service.name for service in
+ self.cloud.list_services()]
+
LOGGER.debug("flavor: %s", self.flavor_alt)
def prepare_task(self, test_name):
@@ -459,11 +462,13 @@ class RallyBase(singlevm.VmReady2):
str(self._build_task_args(test_name))])
return True
- def run_tests(self):
+ def run_tests(self, **kwargs):
"""Execute tests."""
+ optional = kwargs.get('optional', [])
for test in self.tests:
- if self.prepare_task(test):
- self.run_task(test)
+ if test in self.services or test not in optional:
+ if self.prepare_task(test):
+ self.run_task(test)
def _generate_report(self):
"""Generate test execution summary report."""
@@ -537,7 +542,6 @@ class RallyBase(singlevm.VmReady2):
return super(RallyBase, self).is_successful()
- @energy.enable_recording
def run(self, **kwargs):
"""Run testcase."""
self.start_time = time.time()
@@ -557,7 +561,7 @@ class RallyBase(singlevm.VmReady2):
pass
conf_utils.create_rally_deployment(environ=environ)
self.prepare_run()
- self.run_tests()
+ self.run_tests(**kwargs)
self._generate_report()
res = testcase.TestCase.EX_OK
except Exception as exc: # pylint: disable=broad-except