summaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/tempest/tempest.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-07-11 11:35:33 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-07-11 14:48:14 +0200
commitd3f4ac51cb1b3485e6d86b2d5d079456b0f056fd (patch)
tree50df6ddf0d0e31a418423466b52a6643578be72a /functest/opnfv_tests/openstack/tempest/tempest.py
parentb878157942c27d6ba50f0cafd11dfbafdc3b6a00 (diff)
Update rally image name regex
The default value doesn't conform with our image names. Else it downloads the image from internet which may be not possible (offline testing, proxy or deployment l3 issues [1]) [1] https://build.opnfv.org/ci/view/functest/job/functest-apex-virtual-suite-master/113/console Change-Id: I7d951967784d591e7155fe8582299aaa9b680b10 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 8c5703e4e2382f7091aa7f8008d65ce68fa0bf56)
Diffstat (limited to 'functest/opnfv_tests/openstack/tempest/tempest.py')
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index 686711f8d..eb3469112 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
@@ -257,6 +258,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
@@ -285,6 +295,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()
self.apply_tempest_blacklist()