From 115a04aa0d101b50ef17cb416412f68f709c8c38 Mon Sep 17 00:00:00 2001 From: Roman Popelka Date: Thu, 3 Mar 2022 13:20:25 +0100 Subject: [PATCH] Oswin scenario manager cleanup As tempest.scenario.manager was announced stable interface in Tempest 27.0.0[1] it can be now reused in plugins. Replaced methods: * create_keypair Etherpad concerning this effort: https://etherpad.opendev.org/p/tempest-scenario-manager-cleanup [1] https://docs.openstack.org/releasenotes/tempest/v27.0.0.html#release-notes-27-0-0 Change-Id: Ib540c643882e7dc656c81b9fe9e113ee569a5fd2 --- oswin_tempest_plugin/tests/test_base.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/oswin_tempest_plugin/tests/test_base.py b/oswin_tempest_plugin/tests/test_base.py index 87ccfce..9eb7657 100644 --- a/oswin_tempest_plugin/tests/test_base.py +++ b/oswin_tempest_plugin/tests/test_base.py @@ -22,7 +22,7 @@ from tempest.common import waiters from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import test_utils from tempest.lib import exceptions -import tempest.test +import tempest.scenario.manager from oswin_tempest_plugin import config @@ -35,7 +35,7 @@ Server_tuple = collections.namedtuple( ['server', 'floating_ip', 'keypair', 'security_groups']) -class TestBase(tempest.test.BaseTestCase): +class TestBase(tempest.scenario.manager.ScenarioTest): """Base class for tests.""" credentials = ['primary', 'admin'] @@ -105,12 +105,6 @@ class TestBase(tempest.test.BaseTestCase): floating_ip['ip'], server['id']) return floating_ip - def create_keypair(self): - name = data_utils.rand_name(self.__class__.__name__) - body = self.keypairs_client.create_keypair(name=name) - self.addCleanup(self.keypairs_client.delete_keypair, name) - return body['keypair'] - def _get_image_ref(self): return self._IMAGE_REF