From 582c170b2ccf0f5bf08ae9ea08b1eaf3bc4bc93c Mon Sep 17 00:00:00 2001 From: Soniya Vyas Date: Mon, 22 Feb 2021 18:26:17 +0530 Subject: [PATCH] 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 Change-Id: I6d862b4dd41ea86a659e6431bcb215e9e12cf35d --- tempest/scenario/manager.py | 10 +++++----- tempest/scenario/test_minimum_basic.py | 2 +- tempest/scenario/test_network_advanced_server_ops.py | 2 +- tempest/scenario/test_network_basic_ops.py | 2 +- tempest/scenario/test_network_v6.py | 2 +- tempest/scenario/test_server_basic_ops.py | 2 +- tempest/scenario/test_shelve_instance.py | 2 +- tempest/scenario/test_snapshot_pattern.py | 2 +- tempest/scenario/test_stamp_pattern.py | 2 +- tempest/scenario/test_volume_backup_restore.py | 2 +- tempest/scenario/test_volume_boot_pattern.py | 2 +- tempest/scenario/test_volume_migrate_attached.py | 4 ++-- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index 99a3f327c3..d51cba0248 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -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: diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py index fe42583d2a..5201315672 100644 --- a/tempest/scenario/test_minimum_basic.py +++ b/tempest/scenario/test_minimum_basic.py @@ -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, diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py index dbab212acd..20d2e80a5c 100644 --- a/tempest/scenario/test_network_advanced_server_ops.py +++ b/tempest/scenario/test_network_advanced_server_ops.py @@ -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( diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py index 6c1b3fa83a..274daddf8e 100644 --- a/tempest/scenario/test_network_basic_ops.py +++ b/tempest/scenario/test_network_basic_ops.py @@ -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: diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py index 9be28c4faa..6a591df72a 100644 --- a/tempest/scenario/test_network_v6.py +++ b/tempest/scenario/test_network_v6.py @@ -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 diff --git a/tempest/scenario/test_server_basic_ops.py b/tempest/scenario/test_server_basic_ops.py index 60242d5c76..4c82d84c88 100644 --- a/tempest/scenario/test_server_basic_ops.py +++ b/tempest/scenario/test_server_basic_ops.py @@ -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'], diff --git a/tempest/scenario/test_shelve_instance.py b/tempest/scenario/test_shelve_instance.py index ed06898990..29612ec530 100644 --- a/tempest/scenario/test_shelve_instance.py +++ b/tempest/scenario/test_shelve_instance.py @@ -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( diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py index a062d40d57..d04cb9a1a6 100644 --- a/tempest/scenario/test_snapshot_pattern.py +++ b/tempest/scenario/test_snapshot_pattern.py @@ -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( diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py index a8e4c308b0..4b81b9efae 100644 --- a/tempest/scenario/test_stamp_pattern.py +++ b/tempest/scenario/test_stamp_pattern.py @@ -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() diff --git a/tempest/scenario/test_volume_backup_restore.py b/tempest/scenario/test_volume_backup_restore.py index 8a8c54e56d..71e6b537ba 100644 --- a/tempest/scenario/test_volume_backup_restore.py +++ b/tempest/scenario/test_volume_backup_restore.py @@ -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 = [{ diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py index 3b4bbdaaef..5a5cc2704a 100644 --- a/tempest/scenario/test_volume_boot_pattern.py +++ b/tempest/scenario/test_volume_boot_pattern.py @@ -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") diff --git a/tempest/scenario/test_volume_migrate_attached.py b/tempest/scenario/test_volume_migrate_attached.py index 106500e5ad..57d2a1a353 100644 --- a/tempest/scenario/test_volume_migrate_attached.py +++ b/tempest/scenario/test_volume_migrate_attached.py @@ -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