From 2f11462faf588171de94c5b768ea8df36d5d0239 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Sun, 10 Jan 2021 21:32:25 +0200 Subject: [PATCH] Fix unit tests Commit Id5d8ac09a38c656619f88a6f87b8f384fe4c55a8 broke some unittests Change-Id: If87a8b5acd5d0e21d5971aeec1cd783ba6b7b6ba --- .../unit/extensions/test_secgroup_rule_local_ip_prefix.py | 2 ++ vmware_nsx/tests/unit/nsx_p/test_plugin.py | 3 +++ vmware_nsx/tests/unit/nsx_v3/test_plugin.py | 3 +++ vmware_nsx/tests/unit/services/vpnaas/test_nsxv_vpnaas.py | 6 +++--- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/vmware_nsx/tests/unit/extensions/test_secgroup_rule_local_ip_prefix.py b/vmware_nsx/tests/unit/extensions/test_secgroup_rule_local_ip_prefix.py index 7ae0ac5856..0e16776111 100644 --- a/vmware_nsx/tests/unit/extensions/test_secgroup_rule_local_ip_prefix.py +++ b/vmware_nsx/tests/unit/extensions/test_secgroup_rule_local_ip_prefix.py @@ -128,6 +128,7 @@ class TestNSXv3ExtendedSGRule(test_nsxv3_plugin.NsxV3PluginTestCaseMixin, 'remote_group_id': None, 'remote_address_group_id': None, 'remote_ip_prefix': '10.0.0.0/24', + 'normalized_cidr': '10.0.0.0/24', 'local_ip_prefix': '239.255.0.0/16', 'direction': u'ingress', 'description': '', @@ -174,6 +175,7 @@ class TestNSXv3ExtendedSGRule(test_nsxv3_plugin.NsxV3PluginTestCaseMixin, 'remote_group_id': None, 'remote_address_group_id': None, 'remote_ip_prefix': None, + 'normalized_cidr': "0.0.0.0/0", 'direction': u'ingress', 'description': '', 'standard_attr_id': mock.ANY}] diff --git a/vmware_nsx/tests/unit/nsx_p/test_plugin.py b/vmware_nsx/tests/unit/nsx_p/test_plugin.py index 77952f43c7..d8d1bd9529 100644 --- a/vmware_nsx/tests/unit/nsx_p/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_p/test_plugin.py @@ -1894,6 +1894,9 @@ class NsxPTestL3NatTestCase(NsxPTestL3NatTest, enable_dhcp=False) as s: self._test_router_add_interface_subnet(r, s) + def test_router_set_gateway_cidr_overlapped_with_subnets(self): + self.skipTest('2 dhcp subnets not supported') + @common_v3.with_disable_dhcp def test_route_clear_routes_with_None(self): super(NsxPTestL3NatTestCase, diff --git a/vmware_nsx/tests/unit/nsx_v3/test_plugin.py b/vmware_nsx/tests/unit/nsx_v3/test_plugin.py index 23b951175f..0780b6b08d 100644 --- a/vmware_nsx/tests/unit/nsx_v3/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_v3/test_plugin.py @@ -2178,6 +2178,9 @@ class TestL3NatTestCase(L3NatTest, super(TestL3NatTestCase, self).test_router_add_and_remove_gateway() + def test_router_set_gateway_cidr_overlapped_with_subnets(self): + self.skipTest('2 dhcp subnets not supported') + def test_router_update_gateway_upon_subnet_create_max_ips_ipv6(self): self.skipTest('not supported') diff --git a/vmware_nsx/tests/unit/services/vpnaas/test_nsxv_vpnaas.py b/vmware_nsx/tests/unit/services/vpnaas/test_nsxv_vpnaas.py index 4d21ae8945..446dcd41eb 100644 --- a/vmware_nsx/tests/unit/services/vpnaas/test_nsxv_vpnaas.py +++ b/vmware_nsx/tests/unit/services/vpnaas/test_nsxv_vpnaas.py @@ -250,7 +250,7 @@ class TestVpnaasDriver(test_plugin.NsxVPluginV2TestCase): self.router(router_type='exclusive', external_gateway_info={'network_id': ext_net['network']['id']}) as router,\ - self.subnet() as sub: + self.subnet(cidr="20.0.0.0/24") as sub: # add an interface to the router self.l3plugin.add_router_interface( self.context, @@ -275,7 +275,7 @@ class TestVpnaasDriver(test_plugin.NsxVPluginV2TestCase): self.router(router_type='shared', external_gateway_info={'network_id': ext_net['network']['id']}) as router,\ - self.subnet() as sub: + self.subnet(cidr="20.0.0.0/24") as sub: # add an interface to the router self.l3plugin.add_router_interface( self.context, @@ -320,7 +320,7 @@ class TestVpnaasDriver(test_plugin.NsxVPluginV2TestCase): self.router(router_type='exclusive', external_gateway_info={'network_id': ext_net['network']['id']}) as router,\ - self.subnet() as sub: + self.subnet(cidr="20.0.0.0/24") as sub: # add an interface to the router self.l3plugin.add_router_interface( self.context,