diff --git a/vmware_nsx_tempest_plugin/common/constants.py b/vmware_nsx_tempest_plugin/common/constants.py index 79771c2..bbc7d2f 100644 --- a/vmware_nsx_tempest_plugin/common/constants.py +++ b/vmware_nsx_tempest_plugin/common/constants.py @@ -45,6 +45,7 @@ NSX_BACKEND_TIME_INTERVAL = 40 NSX_BACKEND_SMALL_TIME_INTERVAL = 15 NSX_BACKEND_VERY_SMALL_TIME_INTERVAL = 10 NSXP_BACKEND_SMALL_TIME_INTERVAL = 25 +NSX_NETWORK_REALISE_TIMEOUT = 3 # DFW NSX_FIREWALL_REALIZED_TIMEOUT = 120 diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_allowed_address_pair.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_allowed_address_pair.py index 755c0d1..5e3bfc6 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_allowed_address_pair.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_allowed_address_pair.py @@ -180,6 +180,7 @@ class TestAllowedAddressPair(manager.NetworkScenarioTest): self.network = self._create_network() self.subnet = self._create_subnet(self.network, cidr='14.168.1.0/24') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-default1'), external_network_id=CONF.network.public_network_id) @@ -224,6 +225,7 @@ class TestAllowedAddressPair(manager.NetworkScenarioTest): cidr='14.168.1.0/24') self.subnet_v6 = self._create_subnet_v6(self.network, cidr='3010::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-default1'), external_network_id=CONF.network.public_network_id) diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_network_ops.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_network_ops.py index a243527..2204130 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_network_ops.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_network_ops.py @@ -11,11 +11,14 @@ # License for the specific language governing permissions and limitations # under the License. +import time + from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import decorators from tempest.lib import exceptions +from vmware_nsx_tempest_plugin.common import constants from vmware_nsx_tempest_plugin.lib import feature_manager CONF = config.CONF @@ -55,7 +58,8 @@ class NetworkOpsTest(feature_manager.FeatureManager): allocation_pools = {'allocation_pools': [{ 'start': str(address_cidr).split('/')[0] + '2', 'end':str(address_cidr).split('/')[0] + '70'}]} - subnet = self.create_topology_subnet(subnet_name, network, + subnet = self.create_topology_subnet( + subnet_name, network, subnets_client=subnet_client, routers_client=self.cmgr_adm.routers_client, router_id=router['id'], @@ -63,7 +67,8 @@ class NetworkOpsTest(feature_manager.FeatureManager): ipv6_address_mode='slaac', **allocation_pools) else: - subnet = self.create_topology_subnet(subnet_name, network, + subnet = self.create_topology_subnet( + subnet_name, network, subnets_client=subnet_client, routers_client=self.cmgr_adm.routers_client, router_id=router['id'], @@ -79,7 +84,8 @@ class NetworkOpsTest(feature_manager.FeatureManager): """ name = data_utils.rand_name("dual-network") networks_client = self.cmgr_adm.networks_client - network = self.create_topology_network(name, + network = self.create_topology_network( + name, networks_client=networks_client) sg = self._create_security_group(network) rtr_name = data_utils.rand_name("dual-rtr") @@ -87,12 +93,14 @@ class NetworkOpsTest(feature_manager.FeatureManager): rtr_name, routers_client=self.cmgr_adm.routers_client) subnet_client = self.cmgr_adm.subnets_client subnet_name = network['name'] + 'ipv4-sub' - self.create_topology_subnet(subnet_name, network, + self.create_topology_subnet( + subnet_name, network, subnets_client=subnet_client, routers_client=self.cmgr_adm.routers_client, router_id=router['id'], cidr='20.20.0.0/16') subnet_v6 = self._create_ipv6_subnet(network, router) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) return network, router, sg, subnet_v6 def _create_single_rtr_multiple_net_topology(self): @@ -102,32 +110,40 @@ class NetworkOpsTest(feature_manager.FeatureManager): """ name = data_utils.rand_name("dual-network-1") networks_client = self.cmgr_adm.networks_client - network_1 = self.create_topology_network(name, + network_1 = self.create_topology_network( + name, networks_client=networks_client) sg = self._create_security_group(network_1) name = data_utils.rand_name("dual-network-2") - network_2 = self.create_topology_network(name, + network_2 = self.create_topology_network( + name, networks_client=networks_client) rtr_name = data_utils.rand_name("dual-rtr") router = self.create_topology_router( rtr_name, routers_client=self.cmgr_adm.routers_client) subnet_client = self.cmgr_adm.subnets_client subnet_name = network_1['name'] + 'ipv4-sub' - self.create_topology_subnet(subnet_name, network_1, + self.create_topology_subnet( + subnet_name, network_1, subnets_client=subnet_client, routers_client=self.cmgr_adm.routers_client, router_id=router['id'], cidr='10.10.0.0/16') - self._create_ipv6_subnet(network_1, router, + self._create_ipv6_subnet( + network_1, router, cidr='2010::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) subnet_name = network_2['name'] + 'ipv4-sub' - self.create_topology_subnet(subnet_name, network_2, + self.create_topology_subnet( + subnet_name, network_2, subnets_client=subnet_client, routers_client=self.cmgr_adm.routers_client, router_id=router['id'], cidr='20.20.0.0/16') - self._create_ipv6_subnet(network_2, router, + self._create_ipv6_subnet( + network_2, router, cidr='2011::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) networks = [network_1, network_2] return networks, router, sg @@ -138,7 +154,8 @@ class NetworkOpsTest(feature_manager.FeatureManager): """ name = data_utils.rand_name("dual-network-1") networks_client = self.cmgr_adm.networks_client - network_1 = self.create_topology_network(name, + network_1 = self.create_topology_network( + name, networks_client=networks_client) sg = self._create_security_group(network_1) rtr_name = data_utils.rand_name("dual-rtr-1") @@ -146,27 +163,34 @@ class NetworkOpsTest(feature_manager.FeatureManager): rtr_name, routers_client=self.cmgr_adm.routers_client) subnet_client = self.cmgr_adm.subnets_client subnet_name = network_1['name'] + 'ipv4-sub' - self.create_topology_subnet(subnet_name, network_1, + self.create_topology_subnet( + subnet_name, network_1, subnets_client=subnet_client, routers_client=self.cmgr_adm.routers_client, router_id=router_1['id'], cidr='10.10.0.0/16') - self._create_ipv6_subnet(network_1, router_1, + self._create_ipv6_subnet( + network_1, router_1, cidr='2012::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) name = data_utils.rand_name("dual-network-2") - network_2 = self.create_topology_network(name, + network_2 = self.create_topology_network( + name, networks_client=networks_client) rtr_name = data_utils.rand_name("dual-rtr-2") router_2 = self.create_topology_router( rtr_name, routers_client=self.cmgr_adm.routers_client) subnet_name = network_2['name'] + 'ipv4-sub' - self.create_topology_subnet(subnet_name, network_2, + self.create_topology_subnet( + subnet_name, network_2, subnets_client=subnet_client, routers_client=self.cmgr_adm.routers_client, router_id=router_2['id'], cidr='20.20.0.0/16') - self._create_ipv6_subnet(network_2, router_2, + self._create_ipv6_subnet( + network_2, router_2, cidr='2013::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) networks = [network_1, network_2] routers = [router_1, router_2] return networks, routers, sg @@ -194,9 +218,9 @@ class NetworkOpsTest(feature_manager.FeatureManager): """Test IPv4 and IPv6 connectivity across VMs connected across same network """ - #Create topology with single router + # Create topology with single router network, rtr, sg, subnet_v6 = self._create_single_ipv6_rtr_topology() - #Boot two VMs on the same network + # Boot two VMs on the same network image_id = self.get_glance_image_id(['cirros', 'esx']) self.create_topology_instance( "vm_1", [network], @@ -212,18 +236,18 @@ class NetworkOpsTest(feature_manager.FeatureManager): clients=self.cmgr_adm) vm2_server_floatingip = self.topology_servers["vm_2"][ "floating_ips"][0] - #Check IPv4 connectivity across the same network + # Check IPv4 connectivity across the same network vm1_server = self.topology_servers["vm_1"] vm2_server = self.topology_servers["vm_2"] - self.check_vm_internal_connectivity(network, - vm1_server_floatingip, vm1_server) - self.check_vm_internal_connectivity(network, - vm2_server_floatingip, vm2_server) - #Check IPv6 connectivity across the same network - self.check_vm_internal_ipv6_connectivity(network, - vm1_server_floatingip, vm1_server) - self.check_vm_internal_ipv6_connectivity(network, - vm2_server_floatingip, vm2_server) + self.check_vm_internal_connectivity( + network, vm1_server_floatingip, vm1_server) + self.check_vm_internal_connectivity( + network, vm2_server_floatingip, vm2_server) + # Check IPv6 connectivity across the same network + self.check_vm_internal_ipv6_connectivity( + network, vm1_server_floatingip, vm1_server) + self.check_vm_internal_ipv6_connectivity( + network, vm2_server_floatingip, vm2_server) @decorators.attr(type=['nsxv3', 'positive']) @decorators.idempotent_id('0074ae58-2de9-4cb2-a225-12a2b093f8d2') @@ -232,9 +256,9 @@ class NetworkOpsTest(feature_manager.FeatureManager): VMs connected across different networks on the same router """ - #Create topology with single router + # Create topology with single router networks, rtr, sg = self._create_single_rtr_multiple_net_topology() - #Boot two VMs on the different network + # Boot two VMs on the different network image_id = self.get_glance_image_id(['cirros', 'esx']) self.create_topology_instance( "vm_1", [networks[0]], @@ -250,20 +274,20 @@ class NetworkOpsTest(feature_manager.FeatureManager): "floating_ips"][0] vm1_server = self.topology_servers["vm_1"] vm2_server = self.topology_servers["vm_2"] - #Check connectivity across differnet network - #checking VM2 Connectivity with VM1's network + # Check connectivity across differnet network + # checking VM2 Connectivity with VM1's network self.check_cross_network_connectivity( networks[0], vm2_server_floatingip, vm2_server, should_connect=True) - #checking VM1 Connectivity with VM2's network + # checking VM1 Connectivity with VM2's network self.check_cross_network_connectivity( networks[1], vm1_server_floatingip, vm1_server, should_connect=True) - #checking VM2 IPv6 Connectivity with VM1's network + # checking VM2 IPv6 Connectivity with VM1's network self.check_cross_network_ipv6_connectivity( networks[0], vm2_server_floatingip, vm2_server, should_connect=True) - #checking VM1 IPv6 Connectivity with VM2's network + # checking VM1 IPv6 Connectivity with VM2's network self.check_cross_network_ipv6_connectivity( networks[1], vm1_server_floatingip, vm1_server, should_connect=True) @@ -275,9 +299,9 @@ class NetworkOpsTest(feature_manager.FeatureManager): VMs connected across different networks on different router """ - #Create topology with two router + # Create topology with two router networks, rtrs, sg = self._create_multiple_rtr_multiple_net_topology() - #Boot two VMs on the different network + # Boot two VMs on the different network image_id = self.get_glance_image_id(['cirros', 'esx']) self.create_topology_instance( "vm_1", [networks[0]], @@ -293,12 +317,12 @@ class NetworkOpsTest(feature_manager.FeatureManager): "floating_ips"][0] vm1_server = self.topology_servers["vm_1"] vm2_server = self.topology_servers["vm_2"] - #Check connectivity across differnet network - #checking VM2 IPv6 Connectivity with VM1's network + # Check connectivity across differnet network + # checking VM2 IPv6 Connectivity with VM1's network self.check_cross_network_ipv6_connectivity( networks[0], vm2_server_floatingip, vm2_server, should_connect=True) - #checking VM1 IPv6 Connectivity with VM2's network + # checking VM1 IPv6 Connectivity with VM2's network self.check_cross_network_ipv6_connectivity( networks[1], vm1_server_floatingip, vm1_server, should_connect=True) @@ -310,9 +334,9 @@ class NetworkOpsTest(feature_manager.FeatureManager): Verify the deletion of an IPv6 subnet is not possible while port is attached to the subnet """ - #Create topology with single router + # Create topology with single router network, rtr, sg, subnet_v6 = self._create_single_ipv6_rtr_topology() - #Boot two VMs on the same network + # Boot two VMs on the same network image_id = self.get_glance_image_id(['cirros', 'esx']) self.create_topology_instance( "vm_1", [network], diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_provider_networks.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_provider_networks.py index c3788c0..0c64bf9 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_provider_networks.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_ipv6_provider_networks.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +import time + from tempest import config from tempest.lib import decorators from tempest import test @@ -161,6 +163,7 @@ class ProviderNetworks(feature_manager.FeatureManager): routers_client=self.cmgr_adm.routers_client, cidr="2023::/64", router_id=router['id']) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.create_topology_instance( "server1", [network], security_groups=[{'name': self.sg['name']}], @@ -247,6 +250,7 @@ class ProviderNetworks(feature_manager.FeatureManager): routers_client=self.cmgr_adm.routers_client, cidr="2024::/64", router_id=router['id']) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.create_topology_instance( "server1", [network1], security_groups=[{'name': self.sg['name']}], @@ -357,6 +361,7 @@ class ProviderNetworks(feature_manager.FeatureManager): routers_client=self.cmgr_adm.routers_client, cidr="2024::/64", router_id=router['id']) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) sec_rule_client = self.cmgr_adm.security_group_rules_client sec_client = self.cmgr_adm.security_groups_client kwargs = dict(tenant_id=provider_network['tenant_id'], 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 9c038bc..af7517a 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 @@ -10,11 +10,14 @@ # License for the specific language governing permissions and limitations # under the License. +import time + from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import decorators from tempest.lib import exceptions +from vmware_nsx_tempest_plugin.common import constants from vmware_nsx_tempest_plugin.lib import feature_manager CONF = config.CONF @@ -90,6 +93,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager): subnet_v6 = self._create_ipv6_subnet(network_state, cidr="5200::/64", slaac=slaac, router_id=router_state["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) if create_instance: image_id = self.get_glance_image_id(["cirros", "esx"]) self.create_topology_instance( @@ -128,6 +132,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager): ipv6_address_mode=ipv6_address_mode, ipv6_ra_mode=ipv6_ra_mode, router_id=router_state["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) if create_instance: image_id = self.get_glance_image_id(["cirros", "esx"]) self.create_topology_instance( diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_mdproxy_policy.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_mdproxy_policy.py index e75d56f..238c14b 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_mdproxy_policy.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_mdproxy_policy.py @@ -11,6 +11,9 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + +import time + from oslo_log import log as logging from tempest.common import utils @@ -128,6 +131,7 @@ class TestMDProxyPolicy(feature_manager.FeatureManager): network_mdproxy = self.create_topology_network("network_mdproxy") self.create_topology_subnet( "subnet_web", network_mdproxy, router_id=router_mdproxy["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.create_topology_instance( "server_mdproxy_1", [network_mdproxy], image_id=glance_image_id) @@ -135,6 +139,7 @@ class TestMDProxyPolicy(feature_manager.FeatureManager): network_mdproxy = self.create_topology_network("network_mdproxy") self.create_topology_subnet( "subnet_web", network_mdproxy) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.create_topology_instance( "server_mdproxy_1", [network_mdproxy], create_floating_ip=False) @@ -143,11 +148,13 @@ class TestMDProxyPolicy(feature_manager.FeatureManager): network_mdproxy_1 = self.create_topology_network("network_mdproxy_1") self.create_topology_subnet( "subnet_web_1", network_mdproxy_1, router_id=router_mdproxy["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.create_topology_instance( "server_mdproxy_1", [network_mdproxy_1]) network_mdproxy_2 = self.create_topology_network("network_mdproxy_2") self.create_topology_subnet("subnet_web_2", network_mdproxy_2, router_id=router_mdproxy["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.create_topology_instance("server_mdproxy_2", [network_mdproxy_2]) def metadata_test_on_various_glance_image(self, image_id): @@ -209,9 +216,11 @@ class TestMDProxyPolicy(feature_manager.FeatureManager): network_mdproxy = self.create_topology_network("network_mdproxy") self.create_topology_subnet("subnet_web", network_mdproxy, router_id=router_mdproxy["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) network2_mdproxy = self.create_topology_network("network2_mdproxy") self.create_topology_subnet("subnet2_web", network2_mdproxy, router_id=router_mdproxy["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) # Instance has 2 network ports. self.create_topology_instance( "server_mdproxy_1", [network_mdproxy, network2_mdproxy]) diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_multiple_networks_ops.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_multiple_networks_ops.py index 2bdd8b1..0d3dcb6 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_multiple_networks_ops.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_multiple_networks_ops.py @@ -14,6 +14,7 @@ # under the License. import collections +import time from oslo_log import log as logging @@ -23,6 +24,7 @@ from tempest.lib.common.utils import test_utils from tempest.lib import decorators from tempest import test +from vmware_nsx_tempest_plugin.common import constants from vmware_nsx_tempest_plugin.tests.scenario import manager CONF = config.CONF @@ -80,6 +82,7 @@ class TestMultiNetworksOps(manager.NetworkScenarioTest): self.security_group = self._create_security_group() self.network = self._create_network() self.subnet = self._create_subnet(self.network) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-smoke'), external_network_id=CONF.network.public_network_id) @@ -89,6 +92,7 @@ class TestMultiNetworksOps(manager.NetworkScenarioTest): self.router['id'], subnet_id=self.subnet['id']) self.network2 = self._create_network() self.subnet2 = self._create_subnet(self.network2) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.routers_client.add_router_interface( self.router['id'], subnet_id=self.subnet2['id']) self.addCleanup(self.routers_client.remove_router_interface, diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_nsx_port_security.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_nsx_port_security.py index 255e271..6ca509d 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_nsx_port_security.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_nsx_port_security.py @@ -259,6 +259,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): self.setup_sec_group(tenant_id) self.subnet = self._create_subnet(self.network, cidr='10.168.1.0/24') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-port-sec'), external_network_id=CONF.network.public_network_id) @@ -279,6 +280,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): cidr='10.168.1.0/24') self.subnet_v6 = self._create_subnet_v6(self.network, cidr='2020::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-port-sec'), external_network_id=CONF.network.public_network_id) @@ -303,6 +305,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): self.setup_sec_group(tenant_id) self.subnet = self._create_subnet(self.network, cidr='10.168.1.0/24') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-port-sec'), external_network_id=CONF.network.public_network_id) @@ -313,6 +316,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): self.network_2 = self._create_network() self.subnet_2 = self._create_subnet(self.network_2, cidr='10.168.2.0/24') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.routers_client.add_router_interface( self.router['id'], subnet_id=self.subnet_2['id']) self.addCleanup(self.routers_client.remove_router_interface, @@ -331,6 +335,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): cidr='10.18.1.0/24') self.subnet_v6 = self._create_subnet_v6(self.network, cidr='3020::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-port-sec'), external_network_id=CONF.network.public_network_id) @@ -347,6 +352,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): cidr='10.18.2.0/24') self.subnet_2_v6 = self._create_subnet_v6(self.network_2, cidr='3021::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.routers_client.add_router_interface( self.router['id'], subnet_id=self.subnet_2['id']) self.routers_client.add_router_interface( @@ -389,6 +395,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): "port_security_enabled": "false", "security_groups": []} port_client = self.ports_client port_id = port_client.create_port(**body) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.addCleanup(test_utils.call_and_ignore_notfound_exc, port_client.delete_port, port_id['port']['id']) @@ -448,6 +455,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): "port_security_enabled": "false", "security_groups": []} port_client = self.ports_client port_id = port_client.create_port(**body) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.addCleanup(test_utils.call_and_ignore_notfound_exc, port_client.delete_port, port_id['port']['id']) @@ -520,6 +528,7 @@ class TestNSXv3PortSecurityScenario(manager.NetworkScenarioTest): "port_security_enabled": "false", "security_groups": []} port_client = self.ports_client port_id = port_client.create_port(**body) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.addCleanup(test_utils.call_and_ignore_notfound_exc, port_client.delete_port, port_id['port']['id']) diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_octavia_loadbalancers.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_octavia_loadbalancers.py index d429bec..2ff0d3b 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_octavia_loadbalancers.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_octavia_loadbalancers.py @@ -159,6 +159,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager): create_floating_ip = True subnet_client = self.cmgr_adm.subnets_client subnet_lbaas = subnet_client.create_subnet(**body) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.addCleanup(test_utils.call_and_ignore_notfound_exc, subnet_client.delete_subnet, subnet_lbaas['subnet']['id']) diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_provider_security_group.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_provider_security_group.py index 274564b..36c895f 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_provider_security_group.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_provider_security_group.py @@ -210,6 +210,7 @@ class TestProviderSecurityGroup(manager.NetworkScenarioTest): self.network = self._create_network() self.subnet = self._create_subnet(self.network, cidr='10.168.1.0/24') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-psg'), external_network_id=CONF.network.public_network_id) @@ -254,6 +255,7 @@ class TestProviderSecurityGroup(manager.NetworkScenarioTest): cidr='10.168.1.0/24') self.subnet_v6 = self._create_subnet_v6(self.network, cidr='2020::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-psg'), external_network_id=CONF.network.public_network_id) @@ -279,11 +281,13 @@ class TestProviderSecurityGroup(manager.NetworkScenarioTest): cidr='10.168.1.0/24') self.subnet_v6 = self._create_subnet_v6(self.network, cidr='2020::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.network_2 = self._create_network() self.subnet_2 = self._create_subnet(self.network_2, cidr='10.168.2.0/24') self.subnet_2_v6 = self._create_subnet_v6(self.network_2, cidr='2021::/64') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-psg'), external_network_id=CONF.network.public_network_id) @@ -316,6 +320,7 @@ class TestProviderSecurityGroup(manager.NetworkScenarioTest): self.network = self._create_network(namestart="net-psg") self.subnet = self._create_subnet(self.network, cidr='10.168.1.0/24') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-psg'), external_network_id=CONF.network.public_network_id) @@ -326,6 +331,7 @@ class TestProviderSecurityGroup(manager.NetworkScenarioTest): self.network_2 = self._create_network() self.subnet_2 = self._create_subnet(self.network_2, cidr='10.168.2.0/24') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.routers_client.add_router_interface( self.router['id'], subnet_id=self.subnet_2['id']) self.addCleanup(self.routers_client.remove_router_interface, diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_router_nonat_ops.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_router_nonat_ops.py index f89ef5e..944d829 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_router_nonat_ops.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_router_nonat_ops.py @@ -88,6 +88,7 @@ class TestRouterNoNATOps(manager.NetworkScenarioTest): self.security_group = self._create_security_group() self.network = self._create_network() self.subnet = self._create_subnet(self.network) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.router = self._create_router( router_name=data_utils.rand_name('router-smoke'), external_network_id=CONF.network.public_network_id, diff --git a/vmware_nsx_tempest_plugin/tests/scenario/test_designate.py b/vmware_nsx_tempest_plugin/tests/scenario/test_designate.py index 8dcfcdb..2118b10 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/test_designate.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/test_designate.py @@ -87,8 +87,9 @@ class TestZonesV2Ops(feature_manager.FeatureManager): port_range_min=53, port_range_max=53, )] for rule in common_ruleset: self.add_security_group_rule(self.designate_sg, rule, - ruleclient=sec_rule_client, secclient=sec_client, - tenant_id=tenant_id) + ruleclient=sec_rule_client, + secclient=sec_client, + tenant_id=tenant_id) def create_zone_provider_vlan_vxlan_topology(self, network_type, zone_name): @@ -106,11 +107,14 @@ class TestZonesV2Ops(feature_manager.FeatureManager): self.define_security_groups(tenant_id) subnet_client = self.os_adm.subnets_client routers_client = self.os_adm.routers_client - router_designate = self.create_topology_router("router_designate", + router_designate = self.create_topology_router( + "router_designate", routers_client=routers_client) - self.create_topology_subnet("subnet_designate", + self.create_topology_subnet( + "subnet_designate", network_designate, subnets_client=subnet_client, routers_client=routers_client, router_id=router_designate['id']) + time.sleep(const.NSX_NETWORK_REALISE_TIMEOUT) return network_designate def create_zone_topology(self, zone_name): @@ -122,11 +126,14 @@ class TestZonesV2Ops(feature_manager.FeatureManager): self.define_security_groups(tenant_id) subnet_client = self.os_adm.subnets_client routers_client = self.os_adm.routers_client - router_designate = self.create_topology_router("router_designate", + router_designate = self.create_topology_router( + "router_designate", routers_client=routers_client) - self.create_topology_subnet("subnet_designate", + self.create_topology_subnet( + "subnet_designate", network_designate, subnets_client=subnet_client, routers_client=routers_client, router_id=router_designate['id']) + time.sleep(const.NSX_NETWORK_REALISE_TIMEOUT) return network_designate def verify_recordset(self, record_set, count): diff --git a/vmware_nsx_tempest_plugin/tests/scenario/test_new_case_coverage.py b/vmware_nsx_tempest_plugin/tests/scenario/test_new_case_coverage.py index ab7b320..e6832bc 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/test_new_case_coverage.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/test_new_case_coverage.py @@ -1438,6 +1438,7 @@ class TestNewCase(feature_manager.FeatureManager): self.create_topology_subnet( subnet_name, network_state, cidr='100.70.0.0/16', router_id=router_state["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) sec_rule_client = self.sec_rule_client sec_client = self.sec_client kwargs = dict(tenant_id=network_state['tenant_id'], diff --git a/vmware_nsx_tempest_plugin/tests/scenario/test_provider_networks.py b/vmware_nsx_tempest_plugin/tests/scenario/test_provider_networks.py index da80ea4..473179f 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/test_provider_networks.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/test_provider_networks.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +import time + from tempest import config from tempest.lib import decorators from tempest.lib import exceptions @@ -117,6 +119,7 @@ class ProviderNetworks(feature_manager.FeatureManager): routers_client=routers_client, subnets_client=subnet_client, router_id=router['id']) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.create_topology_instance( "server1", [network], security_groups=[{'name': self.sg['name']}], @@ -156,6 +159,7 @@ class ProviderNetworks(feature_manager.FeatureManager): subnets_client=subnet_client, router_id=router['id'], cidr='24.0.0.0/24') + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) self.create_topology_instance( "server1", [network1], security_groups=[{'name': self.sg['name']}], @@ -212,6 +216,7 @@ class ProviderNetworks(feature_manager.FeatureManager): routers_client=self.cmgr_adm.routers_client, router_id=router['id'], **kwargs) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) provider_network1 = self.provider_networks_topoloy( constants.VLAN_TYPE, tz_id=self.vlan_id, @@ -226,6 +231,7 @@ class ProviderNetworks(feature_manager.FeatureManager): router_id=router['id'], cidr="19.0.0.0/24", **kwargs) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) sec_rule_client = self.cmgr_adm.security_group_rules_client sec_client = self.cmgr_adm.security_groups_client kwargs = dict(tenant_id=provider_network['tenant_id'], diff --git a/vmware_nsx_tempest_plugin/tests/scenario/test_router_dr_component_only.py b/vmware_nsx_tempest_plugin/tests/scenario/test_router_dr_component_only.py index 0820cde..f5739dc 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/test_router_dr_component_only.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/test_router_dr_component_only.py @@ -90,6 +90,7 @@ class TestTier1DRComponentDeployment(feature_manager.FeatureManager): subnet_state = self.create_topology_subnet(subnet_name, network_state, router_id=router_state["id"] ) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) if create_instance: image_id = self.get_glance_image_id(["cirros", "esx"]) self.create_topology_instance( @@ -216,6 +217,7 @@ class TestTier1DRComponentDeployment(feature_manager.FeatureManager): subnets_client=self.cmgr_adm.subnets_client, routers_client=self.cmgr_adm.routers_client, router_id=router_state_1["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) no_of_servers = 2 image_id = self.get_glance_image_id(["cirros", "esx"]) for instance in range(0, no_of_servers): @@ -283,6 +285,7 @@ class TestTier1DRComponentDeployment(feature_manager.FeatureManager): subnets_client=self.cmgr_adm.subnets_client, routers_client=self.cmgr_adm.routers_client, router_id=router_state_1["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) no_of_servers = 2 image_id = self.get_glance_image_id(["cirros", "esx"]) for instance in range(0, no_of_servers): @@ -346,6 +349,7 @@ class TestTier1DRComponentDeployment(feature_manager.FeatureManager): subnets_client=self.cmgr_adm.subnets_client, routers_client=self.cmgr_adm.routers_client, router_id=router_state_1["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) no_of_servers = 2 image_id = self.get_glance_image_id(["cirros", "esx"]) for instance in range(0, no_of_servers): diff --git a/vmware_nsx_tempest_plugin/tests/scenario/test_sr_ati_affinity.py b/vmware_nsx_tempest_plugin/tests/scenario/test_sr_ati_affinity.py index d34e27c..c0c0fb3 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/test_sr_ati_affinity.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/test_sr_ati_affinity.py @@ -209,6 +209,7 @@ class TestSRAntiAffinity(feature_manager.FeatureManager): subnet_lbaas = self.create_topology_subnet( "subnet_lbaas", network_lbaas_1, router_id=router_state_1["id"]) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) if i == 10: self.assertRaises(exceptions.ServerFault, self.load_balancers_admin_client. @@ -287,6 +288,7 @@ class TestSRAntiAffinity(feature_manager.FeatureManager): subnet_name, network_state, router_id=router_state["id"], routers_client=self.cmgr_adm.routers_client, subnets_client=self.cmgr_adm.subnets_client) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) security_group = self._create_security_group( security_group_rules_client=self.cmgr_adm. security_group_rules_client, diff --git a/vmware_nsx_tempest_plugin/tests/scenario/test_tier1_deployment_specific_edge_cluster.py b/vmware_nsx_tempest_plugin/tests/scenario/test_tier1_deployment_specific_edge_cluster.py index 84c5fe5..d6a2a83 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/test_tier1_deployment_specific_edge_cluster.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/test_tier1_deployment_specific_edge_cluster.py @@ -11,12 +11,16 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + +import time + from oslo_log import log as logging from tempest import config from tempest.lib.common.utils import data_utils from tempest.lib import decorators +from vmware_nsx_tempest_plugin.common import constants from vmware_nsx_tempest_plugin.lib import feature_manager from vmware_nsx_tempest_plugin.services import nsxp_client from vmware_nsx_tempest_plugin.services import nsxv3_client @@ -68,6 +72,7 @@ class TestTier1DeploymentEdgeCluster(feature_manager.FeatureManager): subnet_state = self.create_topology_subnet(subnet_name, network_state, router_id=router_state["id"] ) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) if create_instance: image_id = self.get_glance_image_id(["cirros", "esx"]) self.create_topology_instance( diff --git a/vmware_nsx_tempest_plugin/tests/scenario/test_verify_nat_fw_order.py b/vmware_nsx_tempest_plugin/tests/scenario/test_verify_nat_fw_order.py index 71f2e4c..28eb5e9 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/test_verify_nat_fw_order.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/test_verify_nat_fw_order.py @@ -93,6 +93,7 @@ class TestVerifyFwNatOrder(feature_manager.FeatureManager): subnet_state = self.create_topology_subnet( subnet_name, network_state, subnets_client=self.cmgr_adm.subnets_client) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) interface = self.cmgr_adm.routers_client.add_router_interface( router_state['id'], subnet_id=subnet_state["id"]) self.addCleanup(test_utils.call_and_ignore_notfound_exc, @@ -215,6 +216,7 @@ class TestVerifyFwNatOrder(feature_manager.FeatureManager): subnet_state = self.create_topology_subnet( subnet_name, network_state, subnets_client=self.cmgr_adm.subnets_client) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) interface = self.cmgr_adm.routers_client.add_router_interface( router_state['id'], subnet_id=subnet_state["id"]) self.addCleanup(test_utils.call_and_ignore_notfound_exc, @@ -338,6 +340,7 @@ class TestVerifyFwNatOrder(feature_manager.FeatureManager): subnet_state = self.create_topology_subnet( subnet_name, network_state, subnets_client=self.cmgr_adm.subnets_client) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) interface = self.cmgr_adm.routers_client.add_router_interface( router_state['id'], subnet_id=subnet_state["id"]) self.addCleanup(test_utils.call_and_ignore_notfound_exc, @@ -489,6 +492,7 @@ class TestVerifyFwNatOrder(feature_manager.FeatureManager): subnet_state = self.create_topology_subnet( subnet_name, network_state, subnets_client=self.cmgr_adm.subnets_client) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) interface = self.cmgr_adm.routers_client.add_router_interface( router_state['id'], subnet_id=subnet_state["id"]) self.addCleanup(test_utils.call_and_ignore_notfound_exc, @@ -640,6 +644,7 @@ class TestVerifyFwNatOrder(feature_manager.FeatureManager): subnet_state = self.create_topology_subnet( subnet_name, network_state, subnets_client=self.cmgr_adm.subnets_client) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) interface = self.cmgr_adm.routers_client.add_router_interface( router_state['id'], subnet_id=subnet_state["id"]) self.addCleanup(test_utils.call_and_ignore_notfound_exc, @@ -776,6 +781,7 @@ class TestVerifyFwNatOrder(feature_manager.FeatureManager): subnet_state = self.create_topology_subnet( subnet_name, network_state, subnets_client=self.cmgr_adm.subnets_client) + time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT) interface = self.cmgr_adm.routers_client.add_router_interface( router_state['id'], subnet_id=subnet_state["id"]) self.addCleanup(test_utils.call_and_ignore_notfound_exc,