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
This commit is contained in:
Roman Popelka 2022-03-03 13:20:25 +01:00
parent 59e6a14d01
commit 115a04aa0d
1 changed files with 2 additions and 8 deletions

View File

@ -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