Inherit from tempest's BaseTestCase
among other things, the tempest.test.BaseTestCase implements
'serial' code execution via interprocess lock - while a test
marked as 'serial' runs, no other test can run.
Heat-tempest-plugin currently completely ignores that, resulting
in heat tests running together with 'serial' tests,
sometimes breaking the latter (e.g. aggregate tests can not add
host to aggregate because the host is unexpectedly not empty).
This commit makes heat-tempest-plugin's BaseTestCase inherit from
tempest.test.BaseTestCase, thus making heat tests respect the
'serial' flag.
Some methods were renamed to not shadow over the same named ones
from tempest.
Related-Issue: PRODX-56296
Change-Id: If4f12f2ff7132046afa8c7ee7028d7a6b5d2d549
(cherry picked from commit 34df52767e176c551a6e0112ff443f6ce660b169)
diff --git a/heat_tempest_plugin/common/test.py b/heat_tempest_plugin/common/test.py
index 177477a..d2cb133 100644
--- a/heat_tempest_plugin/common/test.py
+++ b/heat_tempest_plugin/common/test.py
@@ -29,6 +29,7 @@
from heat_tempest_plugin.common import remote_client
from heat_tempest_plugin.services import clients
from tempest import config
+from tempest import test
LOG = logging.getLogger(__name__)
_LOG_FORMAT = "%(levelname)8s [%(name)s] %(message)s"
@@ -178,9 +179,7 @@
return decorator
-class HeatIntegrationTest(testtools.testcase.WithAttributes,
- testscenarios.WithScenarios,
- testtools.TestCase):
+class HeatIntegrationTest(test.BaseTestCase, testscenarios.WithScenarios):
def setUp(self):
super(HeatIntegrationTest, self).setUp()
@@ -196,14 +195,14 @@
'No username configured')
self.assertIsNotNone(self.conf.password,
'No password configured')
- self.setup_clients(self.conf)
+ self.setup_plugin_clients(self.conf)
self.useFixture(fixtures.FakeLogger(format=_LOG_FORMAT))
if self.conf.disable_ssl_certificate_validation:
self.verify_cert = False
else:
self.verify_cert = self.conf.ca_file or True
- def setup_clients(self, conf, admin_credentials=False):
+ def setup_plugin_clients(self, conf, admin_credentials=False):
self.manager = clients.ClientManager(conf, admin_credentials)
self.identity_client = self.manager.identity_client
self.orchestration_client = self.manager.orchestration_client
@@ -216,7 +215,7 @@
self.client = self.orchestration_client
def setup_clients_for_admin(self):
- self.setup_clients(self.conf, True)
+ self.setup_plugin_clients(self.conf, True)
def get_remote_client(self, server_or_ip, username, private_key=None):
if isinstance(server_or_ip, str):