From d432d751425b74cb92b7371934862849778e9649 Mon Sep 17 00:00:00 2001 From: Shubham Naik Date: Wed, 6 Oct 2021 10:01:26 +0000 Subject: [PATCH] Fixed SG create override issue in IPv6RouterTests {0} vmware_nsx_tempest_plugin.tests.nsxv3.scenario.test_ipv6_router.IPv6RoutersTest.test_ipv6_interface_and_ipv4_interface_to_rtr [178.567412s] ... ok {0} vmware_nsx_tempest_plugin.tests.nsxv3.scenario.test_ipv6_router.IPv6RoutersTest.test_ipv4_interface_and_ipv6_interface_to_rtr [176.489470s] ... ok {0} vmware_nsx_tempest_plugin.tests.nsxv3.scenario.test_ipv6_router.IPv6RoutersTest.test_deletion_router_ipv6_slacc_interface_use [283.302551s] ... ok {0} vmware_nsx_tempest_plugin.tests.nsxv3.scenario.test_ipv6_router.IPv6RoutersTest.test_deletion_router_ipv6_slacc_use [183.033987s] ... ok {0} vmware_nsx_tempest_plugin.tests.nsxv3.scenario.test_ipv6_router.IPv6RoutersTest.test_deletion_router_ipv6_static_interface_use [195.068963s] ... ok {0} vmware_nsx_tempest_plugin.tests.nsxv3.scenario.test_ipv6_router.IPv6RoutersTest.test_deletion_router_ipv6_static_use [205.896675s] ... ok Change-Id: I5eabe6c01257c8d2d17438a8ca999f07cc7e8ff2 --- .../tests/nsxv3/scenario/test_ipv6_router.py | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_router.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_router.py index 999f7e7..5a4b241 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_router.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_router.py @@ -74,25 +74,6 @@ class IPv6RoutersTest(feature_manager.FeatureManager): cidr=cidr, router_id=router_id) return subnet - def _create_security_group(self, network): - sec_rule_client = self.cmgr_adm.security_group_rules_client - sec_client = self.cmgr_adm.security_groups_client - sg = self._create_empty_security_group( - namestart="tempest-ipv6-", client=sec_client) - common_ruleset = [dict(direction='ingress', ethertype='IPv6'), - dict(direction='ingress', ethertype='IPv4'), - dict(direction='ingress', protocol='tcp', - port_range_min=22, port_range_max=22), - dict(direction='egress', protocol='icmp'), - dict(direction='ingress', protocol='icmp')] - for rule in common_ruleset: - self._create_security_group_rule( - sec_group_rules_client=sec_rule_client, - security_groups_client=sec_client, - secgroup=sg, - **rule) - return sg - def create_topo_single_network(self, namestart, create_instance=True, set_gateway=True, slaac=True, **kwargs): """ @@ -766,7 +747,12 @@ class IPv6RoutersTest(feature_manager.FeatureManager): networks_client = self.cmgr_adm.networks_client network = self.create_topology_network( name, networks_client=networks_client) - sg = self._create_security_group(network) + sec_rule_client = self.cmgr_adm.security_group_rules_client + sec_client = self.cmgr_adm.security_groups_client + sg = self.create_topology_security_group( + tenant_id=network['tenant_id'], + security_groups_client=sec_client, + security_group_rules_client=sec_rule_client) subnet_ipv6 = self._create_ipv6_subnet( network, cidr="4200::/64", ipv6_ra_mode="dhcpv6-stateful", @@ -827,7 +813,12 @@ class IPv6RoutersTest(feature_manager.FeatureManager): networks_client = self.cmgr_adm.networks_client network = self.create_topology_network( name, networks_client=networks_client) - sg = self._create_security_group(network) + sec_rule_client = self.cmgr_adm.security_group_rules_client + sec_client = self.cmgr_adm.security_groups_client + sg = self.create_topology_security_group( + tenant_id=network['tenant_id'], + security_groups_client=sec_client, + security_group_rules_client=sec_rule_client) subnet_client = self.cmgr_adm.subnets_client subnet_ipv4_name = network['name'] + 'dual-ipv4-sub' subnet_ipv4 = self.create_topology_subnet(