aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2018-07-11 12:45:42 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-07-11 12:45:42 +0000
commit06ee8307aed7f30ba493c0494cfd82cead465b56 (patch)
tree27ccf01b55339529e0467fd91b604e07523bae31
parent6bbf0075ccdeb014eda01c9ab18048e8321f9070 (diff)
parent8c5703e4e2382f7091aa7f8008d65ce68fa0bf56 (diff)
Merge "Update rally image name regex"
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py11
-rw-r--r--functest/tests/unit/openstack/tempest/test_tempest.py3
2 files changed, 13 insertions, 1 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index 3701e485f..9e200bbd6 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -19,6 +19,7 @@ import shutil
import subprocess
import time
+from six.moves import configparser
from xtesting.core import testcase
import yaml
@@ -249,6 +250,15 @@ class TempestCommon(singlevm.VmReady1):
subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
+ def update_rally_regex(self, rally_conf='/etc/rally/rally.conf'):
+ """Set image name as tempest img_name_regex"""
+ rconfig = configparser.RawConfigParser()
+ rconfig.read(rally_conf)
+ rconfig.set('tempest', 'img_name_regex', '^{}$'.format(
+ self.image.name))
+ with open(rally_conf, 'wb') as config_file:
+ rconfig.write(config_file)
+
def configure(self, **kwargs): # pylint: disable=unused-argument
"""
Create all openstack resources for tempest-based testcases and write
@@ -277,6 +287,7 @@ class TempestCommon(singlevm.VmReady1):
self.start_time = time.time()
try:
super(TempestCommon, self).run(**kwargs)
+ self.update_rally_regex()
self.configure(**kwargs)
self.generate_test_list(**kwargs)
self.apply_tempest_blacklist()
diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py
index 14ba9f75f..3dd05abb6 100644
--- a/functest/tests/unit/openstack/tempest/test_tempest.py
+++ b/functest/tests/unit/openstack/tempest/test_tempest.py
@@ -249,7 +249,8 @@ class OSTempestTesting(unittest.TestCase):
self._test_run(testcase.TestCase.EX_RUN_ERROR)
def test_run(self):
- with mock.patch.object(self.tempestcommon, 'generate_test_list'), \
+ with mock.patch.object(self.tempestcommon, 'update_rally_regex'), \
+ mock.patch.object(self.tempestcommon, 'generate_test_list'), \
mock.patch.object(self.tempestcommon,
'apply_tempest_blacklist'), \
mock.patch.object(self.tempestcommon, 'run_verifier_tests'), \