summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2019-01-26 12:53:26 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2019-01-26 23:04:22 +0100
commit3b7b393ca643bcf7db0361bcc4414b74fff953be (patch)
tree86952f04a2542e2f89771ea5643e2b6d2a6047a3
parent5f9e4a4fa74d9de129528313b3acb87ee3e0edde (diff)
Set Gnocchi scenario as optional in rally tests
The execution of an optional scenario is skipped if the corresponding openstack service does not exist. Change-Id: I8721f26ebc253ce02138b85d6c88e659c5afae80 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
-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 6322f1257..a811257a1 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 d40645972..7ff6cd2f8 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_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