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:
@@ -589,7 +589,7 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
|||||||
rules.append(sg_rule)
|
rules.append(sg_rule)
|
||||||
return rules
|
return rules
|
||||||
|
|
||||||
def _create_security_group(self, **kwargs):
|
def create_security_group(self, **kwargs):
|
||||||
"""Create security group and add rules to security group"""
|
"""Create security group and add rules to security group"""
|
||||||
if not kwargs.get('name'):
|
if not kwargs.get('name'):
|
||||||
kwargs['name'] = data_utils.rand_name(self.__class__.__name__)
|
kwargs['name'] = data_utils.rand_name(self.__class__.__name__)
|
||||||
@@ -1361,7 +1361,7 @@ class NetworkScenarioTest(ScenarioTest):
|
|||||||
self.log_console_output()
|
self.log_console_output()
|
||||||
self.fail(msg)
|
self.fail(msg)
|
||||||
|
|
||||||
def _create_security_group(self, security_group_rules_client=None,
|
def create_security_group(self, security_group_rules_client=None,
|
||||||
project_id=None,
|
project_id=None,
|
||||||
namestart='secgroup-smoke',
|
namestart='secgroup-smoke',
|
||||||
security_groups_client=None):
|
security_groups_client=None):
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class TestMinimumBasicScenario(manager.ScenarioTest):
|
|||||||
self.assertEqual(1, disks.count(CONF.compute.volume_device_name))
|
self.assertEqual(1, disks.count(CONF.compute.volume_device_name))
|
||||||
|
|
||||||
def create_and_add_security_group_to_server(self, server):
|
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'],
|
self.servers_client.add_security_group(server['id'],
|
||||||
name=secgroup['name'])
|
name=secgroup['name'])
|
||||||
self.addCleanup(self.servers_client.remove_security_group,
|
self.addCleanup(self.servers_client.remove_security_group,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class TestNetworkAdvancedServerOps(manager.NetworkScenarioTest):
|
|||||||
def _setup_server(self, keypair):
|
def _setup_server(self, keypair):
|
||||||
security_groups = []
|
security_groups = []
|
||||||
if utils.is_extension_enabled('security-group', 'network'):
|
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']}]
|
security_groups = [{'name': security_group['name']}]
|
||||||
network, _, _ = self.create_networks()
|
network, _, _ = self.create_networks()
|
||||||
server = self.create_server(
|
server = self.create_server(
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
|
|||||||
keypair = self.create_keypair()
|
keypair = self.create_keypair()
|
||||||
self.keypairs[keypair['name']] = keypair
|
self.keypairs[keypair['name']] = keypair
|
||||||
security_groups = [
|
security_groups = [
|
||||||
{'name': self._create_security_group()['name']}
|
{'name': self.create_security_group()['name']}
|
||||||
]
|
]
|
||||||
network = {'uuid': network['id']}
|
network = {'uuid': network['id']}
|
||||||
if port_id is not None:
|
if port_id is not None:
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class TestGettingAddress(manager.NetworkScenarioTest):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestGettingAddress, self).setUp()
|
super(TestGettingAddress, self).setUp()
|
||||||
self.keypair = self.create_keypair()
|
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):
|
def prepare_network(self, address6_mode, n_subnets6=1, dualnet=False):
|
||||||
"""Prepare network
|
"""Prepare network
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class TestServerBasicOps(manager.ScenarioTest):
|
|||||||
@utils.services('compute', 'network')
|
@utils.services('compute', 'network')
|
||||||
def test_server_basic_ops(self):
|
def test_server_basic_ops(self):
|
||||||
keypair = self.create_keypair()
|
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.md = {'meta1': 'data1', 'meta2': 'data2', 'metaN': 'dataN'}
|
||||||
self.instance = self.create_server(
|
self.instance = self.create_server(
|
||||||
key_name=keypair['name'],
|
key_name=keypair['name'],
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class TestShelveInstance(manager.ScenarioTest):
|
|||||||
cold_migrate=False):
|
cold_migrate=False):
|
||||||
keypair = self.create_keypair()
|
keypair = self.create_keypair()
|
||||||
|
|
||||||
security_group = self._create_security_group()
|
security_group = self.create_security_group()
|
||||||
security_groups = [{'name': security_group['name']}]
|
security_groups = [{'name': security_group['name']}]
|
||||||
|
|
||||||
server = self.create_server(
|
server = self.create_server(
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class TestSnapshotPattern(manager.ScenarioTest):
|
|||||||
def test_snapshot_pattern(self):
|
def test_snapshot_pattern(self):
|
||||||
# prepare for booting an instance
|
# prepare for booting an instance
|
||||||
keypair = self.create_keypair()
|
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
|
# boot an instance and create a timestamp file in it
|
||||||
server = self.create_server(
|
server = self.create_server(
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class TestStampPattern(manager.ScenarioTest):
|
|||||||
def test_stamp_pattern(self):
|
def test_stamp_pattern(self):
|
||||||
# prepare for booting an instance
|
# prepare for booting an instance
|
||||||
keypair = self.create_keypair()
|
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
|
# boot an instance and create a timestamp file in it
|
||||||
volume = self.create_volume()
|
volume = self.create_volume()
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class TestVolumeBackupRestore(manager.ScenarioTest):
|
|||||||
|
|
||||||
# Create keypair and security group
|
# Create keypair and security group
|
||||||
keypair = self.create_keypair()
|
keypair = self.create_keypair()
|
||||||
security_group = self._create_security_group()
|
security_group = self.create_security_group()
|
||||||
|
|
||||||
# Boot a server from the restored backup
|
# Boot a server from the restored backup
|
||||||
bd_map_v2 = [{
|
bd_map_v2 = [{
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class TestVolumeBootPattern(manager.EncryptionScenarioTest):
|
|||||||
|
|
||||||
LOG.info("Creating keypair and security group")
|
LOG.info("Creating keypair and security group")
|
||||||
keypair = self.create_keypair()
|
keypair = self.create_keypair()
|
||||||
security_group = self._create_security_group()
|
security_group = self.create_security_group()
|
||||||
|
|
||||||
# create an instance from volume
|
# create an instance from volume
|
||||||
LOG.info("Booting instance 1 from volume")
|
LOG.info("Booting instance 1 from volume")
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class TestVolumeMigrateRetypeAttached(manager.ScenarioTest):
|
|||||||
def test_volume_retype_attached(self):
|
def test_volume_retype_attached(self):
|
||||||
LOG.info("Creating keypair and security group")
|
LOG.info("Creating keypair and security group")
|
||||||
keypair = self.create_keypair()
|
keypair = self.create_keypair()
|
||||||
security_group = self._create_security_group()
|
security_group = self.create_security_group()
|
||||||
|
|
||||||
# create volume types
|
# create volume types
|
||||||
LOG.info("Creating Volume types")
|
LOG.info("Creating Volume types")
|
||||||
@@ -156,7 +156,7 @@ class TestVolumeMigrateRetypeAttached(manager.ScenarioTest):
|
|||||||
def test_volume_migrate_attached(self):
|
def test_volume_migrate_attached(self):
|
||||||
LOG.info("Creating keypair and security group")
|
LOG.info("Creating keypair and security group")
|
||||||
keypair = self.create_keypair()
|
keypair = self.create_keypair()
|
||||||
security_group = self._create_security_group()
|
security_group = self.create_security_group()
|
||||||
|
|
||||||
LOG.info("Creating volume")
|
LOG.info("Creating volume")
|
||||||
# Create a unique volume type to avoid using the backend default
|
# Create a unique volume type to avoid using the backend default
|
||||||
|
|||||||
Reference in New Issue
Block a user