Make _create_security_group() non-private

_create_security_group() is made public by this commit as
the tempest.scenario.manager interface is meant to be
consumed by tempest plugins.

Implements: blueprint tempest-scenario-manager-stable
Signed-off by: Soniya Vyas<svyas@redhat.com>

Change-Id: I6d862b4dd41ea86a659e6431bcb215e9e12cf35d
This commit is contained in:
Soniya Vyas 2021-02-22 18:26:17 +05:30
parent 85e618faf3
commit 582c170b2c
12 changed files with 17 additions and 17 deletions

View File

@ -589,7 +589,7 @@ class ScenarioTest(tempest.test.BaseTestCase):
rules.append(sg_rule)
return rules
def _create_security_group(self, **kwargs):
def create_security_group(self, **kwargs):
"""Create security group and add rules to security group"""
if not kwargs.get('name'):
kwargs['name'] = data_utils.rand_name(self.__class__.__name__)
@ -1361,10 +1361,10 @@ class NetworkScenarioTest(ScenarioTest):
self.log_console_output()
self.fail(msg)
def _create_security_group(self, security_group_rules_client=None,
project_id=None,
namestart='secgroup-smoke',
security_groups_client=None):
def create_security_group(self, security_group_rules_client=None,
project_id=None,
namestart='secgroup-smoke',
security_groups_client=None):
if security_group_rules_client is None:
security_group_rules_client = self.security_group_rules_client
if security_groups_client is None:

View File

@ -78,7 +78,7 @@ class TestMinimumBasicScenario(manager.ScenarioTest):
self.assertEqual(1, disks.count(CONF.compute.volume_device_name))
def create_and_add_security_group_to_server(self, server):
secgroup = self._create_security_group()
secgroup = self.create_security_group()
self.servers_client.add_security_group(server['id'],
name=secgroup['name'])
self.addCleanup(self.servers_client.remove_security_group,

View File

@ -60,7 +60,7 @@ class TestNetworkAdvancedServerOps(manager.NetworkScenarioTest):
def _setup_server(self, keypair):
security_groups = []
if utils.is_extension_enabled('security-group', 'network'):
security_group = self._create_security_group()
security_group = self.create_security_group()
security_groups = [{'name': security_group['name']}]
network, _, _ = self.create_networks()
server = self.create_server(

View File

@ -159,7 +159,7 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
keypair = self.create_keypair()
self.keypairs[keypair['name']] = keypair
security_groups = [
{'name': self._create_security_group()['name']}
{'name': self.create_security_group()['name']}
]
network = {'uuid': network['id']}
if port_id is not None:

View File

@ -66,7 +66,7 @@ class TestGettingAddress(manager.NetworkScenarioTest):
def setUp(self):
super(TestGettingAddress, self).setUp()
self.keypair = self.create_keypair()
self.sec_grp = self._create_security_group()
self.sec_grp = self.create_security_group()
def prepare_network(self, address6_mode, n_subnets6=1, dualnet=False):
"""Prepare network

View File

@ -128,7 +128,7 @@ class TestServerBasicOps(manager.ScenarioTest):
@utils.services('compute', 'network')
def test_server_basic_ops(self):
keypair = self.create_keypair()
security_group = self._create_security_group()
security_group = self.create_security_group()
self.md = {'meta1': 'data1', 'meta2': 'data2', 'metaN': 'dataN'}
self.instance = self.create_server(
key_name=keypair['name'],

View File

@ -76,7 +76,7 @@ class TestShelveInstance(manager.ScenarioTest):
cold_migrate=False):
keypair = self.create_keypair()
security_group = self._create_security_group()
security_group = self.create_security_group()
security_groups = [{'name': security_group['name']}]
server = self.create_server(

View File

@ -50,7 +50,7 @@ class TestSnapshotPattern(manager.ScenarioTest):
def test_snapshot_pattern(self):
# prepare for booting an instance
keypair = self.create_keypair()
security_group = self._create_security_group()
security_group = self.create_security_group()
# boot an instance and create a timestamp file in it
server = self.create_server(

View File

@ -81,7 +81,7 @@ class TestStampPattern(manager.ScenarioTest):
def test_stamp_pattern(self):
# prepare for booting an instance
keypair = self.create_keypair()
security_group = self._create_security_group()
security_group = self.create_security_group()
# boot an instance and create a timestamp file in it
volume = self.create_volume()

View File

@ -70,7 +70,7 @@ class TestVolumeBackupRestore(manager.ScenarioTest):
# Create keypair and security group
keypair = self.create_keypair()
security_group = self._create_security_group()
security_group = self.create_security_group()
# Boot a server from the restored backup
bd_map_v2 = [{

View File

@ -64,7 +64,7 @@ class TestVolumeBootPattern(manager.EncryptionScenarioTest):
LOG.info("Creating keypair and security group")
keypair = self.create_keypair()
security_group = self._create_security_group()
security_group = self.create_security_group()
# create an instance from volume
LOG.info("Booting instance 1 from volume")

View File

@ -100,7 +100,7 @@ class TestVolumeMigrateRetypeAttached(manager.ScenarioTest):
def test_volume_retype_attached(self):
LOG.info("Creating keypair and security group")
keypair = self.create_keypair()
security_group = self._create_security_group()
security_group = self.create_security_group()
# create volume types
LOG.info("Creating Volume types")
@ -156,7 +156,7 @@ class TestVolumeMigrateRetypeAttached(manager.ScenarioTest):
def test_volume_migrate_attached(self):
LOG.info("Creating keypair and security group")
keypair = self.create_keypair()
security_group = self._create_security_group()
security_group = self.create_security_group()
LOG.info("Creating volume")
# Create a unique volume type to avoid using the backend default