Fixing regression issues
Change-Id: I4d70ba35debfa2b410e8bb27e8b7ca0bf842106f
This commit is contained in:
parent
d432d75142
commit
820593d4f8
@ -422,8 +422,10 @@ class NSXV3Client(object):
|
||||
nsx_nsgroup = self.get_ns_groups()
|
||||
if nsxp:
|
||||
for group in nsx_nsgroup:
|
||||
if group['display_name'] == (
|
||||
'default.neutron_excluded_ports_group'):
|
||||
if (group['display_name'] == (
|
||||
'neutron_excluded_ports_group') or
|
||||
group['display_name'] == (
|
||||
'default.neutron_excluded_ports_group')):
|
||||
nsgroup_id = group['id']
|
||||
else:
|
||||
for group in nsx_nsgroup:
|
||||
|
@ -246,6 +246,47 @@ class TestFwaasV2Ops(feature_manager.FeatureManager):
|
||||
group_delete, network['project_id'], ports, protocol_name)
|
||||
return fw_topo
|
||||
|
||||
def create_fw_with_port_two_rtr_topology(self, protocol_name,
|
||||
group_delete=True,
|
||||
source_ip=None,
|
||||
create_instance=False):
|
||||
# Create network topo
|
||||
network = self.create_topology_network(network_name="fw-network")
|
||||
network1 = self.create_topology_network(network_name="fw-network1")
|
||||
router_name = 'fw-router'
|
||||
router_name1 = 'fw-router1'
|
||||
# Create router topo
|
||||
router = self.create_topology_router(router_name)
|
||||
router1 = self.create_topology_router(router_name1)
|
||||
subnet_name = 'fw-subnet'
|
||||
subnet_name1 = 'fw-subnet1'
|
||||
# Create subnet topo
|
||||
self.create_topology_subnet(subnet_name, network,
|
||||
router_id=router['id'])
|
||||
self.create_topology_subnet(subnet_name1, network1,
|
||||
router_id=router1['id'])
|
||||
if create_instance:
|
||||
image_id = self.get_glance_image_id(["cirros", "esx"])
|
||||
self.create_topology_instance(
|
||||
"state_vm_1", [network],
|
||||
create_floating_ip=True, image_id=image_id)
|
||||
self.create_topology_instance(
|
||||
"state_vm_2", [network],
|
||||
create_floating_ip=True, image_id=image_id)
|
||||
floatin_ip = self.topology_servers['state_vm_1']['floating_ips']
|
||||
source_ip = floatin_ip[0]['fixed_ip_address']
|
||||
p_client = self.ports_client
|
||||
ports = []
|
||||
ports.append(self.get_router_port(p_client))
|
||||
if not group_delete:
|
||||
fw_topo = self.create_fw_group_port_topo(
|
||||
group_delete, network['project_id'], ports, protocol_name,
|
||||
source_ip)
|
||||
else:
|
||||
fw_topo = self.create_fw_group_port_topo(
|
||||
group_delete, network['project_id'], ports, protocol_name)
|
||||
return fw_topo
|
||||
|
||||
@decorators.attr(type='nsxv3')
|
||||
@decorators.idempotent_id('431288d7-9213-4b1e-a11d-15840c8e2f12')
|
||||
def test_fwaas_basic_icmp(self):
|
||||
@ -317,6 +358,20 @@ class TestFwaasV2Ops(feature_manager.FeatureManager):
|
||||
self.fwaas_v2_client.delete_firewall_v2_group(
|
||||
fw_topo["fw_group"]["firewall_group"]["id"])
|
||||
|
||||
@decorators.attr(type='nsxv3')
|
||||
@decorators.idempotent_id('434588d7-0183-4b12-a33d-15840c8e2fd6')
|
||||
def test_fw_group_with_two_diff_port_of_router(self):
|
||||
"""
|
||||
Try to attach fwg to two diff router port
|
||||
"""
|
||||
fw_topo = self.create_fw_with_port_two_rtr_topology(
|
||||
group_delete=False, protocol_name='icmp')
|
||||
|
||||
self.update_firewall_group(fw_topo["fw_group"]["firewall_group"]["id"],
|
||||
ports=[])
|
||||
self.fwaas_v2_client.delete_firewall_v2_group(
|
||||
fw_topo["fw_group"]["firewall_group"]["id"])
|
||||
|
||||
@decorators.attr(type='nsxv3')
|
||||
@decorators.attr(type=["negative"])
|
||||
@decorators.idempotent_id('201228d7-0183-4b1e-a11d-35821c8e2fd6')
|
||||
|
@ -82,8 +82,8 @@ class NSXv3PortSecurity(base.BaseAdminNetworkTest):
|
||||
if corresponding_port_id != port_id['target_display_name']:
|
||||
continue
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
return True
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
|
||||
@ -95,6 +95,7 @@ class NSXv3PortSecurity(base.BaseAdminNetworkTest):
|
||||
for port_id in nsxgroup_data['results']:
|
||||
if corresponding_port_id == port_id['target_display_name']:
|
||||
return True
|
||||
return False
|
||||
|
||||
def _create_network_topo(self, client):
|
||||
"""
|
||||
@ -327,7 +328,7 @@ class NSXv3PortSecurity(base.BaseAdminNetworkTest):
|
||||
else:
|
||||
# Sleep for 10 sec
|
||||
time.sleep(constants.NSX_BACKEND_SMALL_TIME_INTERVAL)
|
||||
nsgroup_id = self.nsx.get_neutron_ns_group_id()
|
||||
nsgroup_id = self.nsx.get_neutron_ns_group_id(nsxp=True)
|
||||
nsxgroup_data = self.nsx.get_ns_group_port_members(nsgroup_id)
|
||||
corresponding_port_id = self.get_tag_port_id(nsxgroup_data,
|
||||
org_port_id)
|
||||
|
@ -9,7 +9,7 @@
|
||||
# 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 random
|
||||
import time
|
||||
|
||||
from tempest import config
|
||||
@ -52,11 +52,12 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
def resource_setup(cls):
|
||||
super(IPv6RoutersTest, cls).resource_setup()
|
||||
|
||||
def _create_ipv6_subnet(self, network, cidr, ipv6_ra_mode=None,
|
||||
def _create_ipv6_subnet(self, network, cidr=None, ipv6_ra_mode=None,
|
||||
ipv6_address_mode=None,
|
||||
router_id=None, slaac=False, enable_dhcp=False):
|
||||
subnet_client = self.cmgr_adm.subnets_client
|
||||
subnet_name = network['name'] + 'sub'
|
||||
cidr = (str(random.randint(1, 1049)) + "::/64")
|
||||
if slaac:
|
||||
subnet = self.create_topology_subnet(
|
||||
subnet_name, network,
|
||||
@ -90,7 +91,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet_state = self.create_topology_subnet(subnet_name, network_state,
|
||||
router_id=router_state["id"]
|
||||
)
|
||||
subnet_v6 = self._create_ipv6_subnet(network_state, cidr="5200::/64",
|
||||
subnet_v6 = self._create_ipv6_subnet(network_state,
|
||||
slaac=slaac,
|
||||
router_id=router_state["id"])
|
||||
time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT)
|
||||
@ -128,7 +129,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
router_id=router_state["id"]
|
||||
)
|
||||
subnet_v6 = self._create_ipv6_subnet(
|
||||
network_state, cidr="5200::/64", slaac=slaac,
|
||||
network_state, slaac=slaac,
|
||||
ipv6_address_mode=ipv6_address_mode,
|
||||
ipv6_ra_mode=ipv6_ra_mode,
|
||||
router_id=router_state["id"])
|
||||
@ -157,7 +158,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
networks_client = self.cmgr_adm.networks_client
|
||||
network = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
subnet = self._create_ipv6_subnet(network, cidr="5200::/64",
|
||||
subnet = self._create_ipv6_subnet(network,
|
||||
slaac=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
@ -183,8 +184,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet_name, network,
|
||||
subnets_client=subnet_client,
|
||||
cidr='20.20.0.0/16')
|
||||
subnet = self._create_ipv6_subnet(network, cidr="5201::/64",
|
||||
slaac=True)
|
||||
subnet = self._create_ipv6_subnet(network, slaac=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
rtr_name, routers_client=self.cmgr_adm.routers_client)
|
||||
@ -207,8 +207,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
networks_client = self.cmgr_adm.networks_client
|
||||
network = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
subnet = self._create_ipv6_subnet(network, cidr="4010::/64",
|
||||
slaac=True)
|
||||
subnet = self._create_ipv6_subnet(network, slaac=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
rtr_name, routers_client=self.cmgr_adm.routers_client)
|
||||
@ -232,8 +231,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet_ipv4 = self.create_topology_subnet(
|
||||
subnet_name, network, subnets_client=subnet_client,
|
||||
cidr='20.20.0.0/16')
|
||||
subnet = self._create_ipv6_subnet(network, cidr="4011::/64",
|
||||
slaac=True)
|
||||
subnet = self._create_ipv6_subnet(network, slaac=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
rtr_name, routers_client=self.cmgr_adm.routers_client)
|
||||
@ -256,11 +254,10 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
networks_client = self.cmgr_adm.networks_client
|
||||
network = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
subnet = self._create_ipv6_subnet(network, cidr="4012::/64",
|
||||
slaac=True)
|
||||
subnet = self._create_ipv6_subnet(network, slaac=True)
|
||||
network_1 = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
subnet_1 = self._create_ipv6_subnet(network_1, cidr="4013::/64",
|
||||
subnet_1 = self._create_ipv6_subnet(network_1,
|
||||
slaac=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
@ -290,7 +287,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet_name, network, subnets_client=subnet_client,
|
||||
cidr='20.21.0.0/16')
|
||||
subnet = self._create_ipv6_subnet(
|
||||
network, cidr="4200::/64",
|
||||
network,
|
||||
ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful",
|
||||
slaac=False)
|
||||
@ -300,7 +297,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet_name, network_1, subnets_client=subnet_client,
|
||||
cidr='20.22.0.0/16')
|
||||
subnet_1 = self._create_ipv6_subnet(
|
||||
network_1, cidr="4201::/64",
|
||||
network_1,
|
||||
ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful",
|
||||
slaac=False)
|
||||
@ -339,14 +336,14 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet_ipv4 = self.create_topology_subnet(
|
||||
subnet_name, network, subnets_client=subnet_client,
|
||||
cidr='20.21.0.0/16')
|
||||
subnet = self._create_ipv6_subnet(network, cidr="4012::/64",
|
||||
subnet = self._create_ipv6_subnet(network,
|
||||
slaac=True)
|
||||
network_1 = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
subnet_ipv4_1 = self.create_topology_subnet(
|
||||
subnet_name, network_1, subnets_client=subnet_client,
|
||||
cidr='20.22.0.0/16')
|
||||
subnet_1 = self._create_ipv6_subnet(network_1, cidr="4013::/64",
|
||||
subnet_1 = self._create_ipv6_subnet(network_1,
|
||||
slaac=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
@ -539,14 +536,12 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
name, networks_client=networks_client)
|
||||
subnet = self._create_ipv6_subnet(
|
||||
network, ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful", enable_dhcp=True,
|
||||
cidr="4012::/64")
|
||||
ipv6_address_mode="dhcpv6-stateful", enable_dhcp=True)
|
||||
network_1 = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
subnet_1 = self._create_ipv6_subnet(
|
||||
network_1, ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful", enable_dhcp=True,
|
||||
cidr="4013::/64")
|
||||
ipv6_address_mode="dhcpv6-stateful", enable_dhcp=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
rtr_name, routers_client=self.cmgr_adm.routers_client)
|
||||
@ -573,16 +568,14 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet = self._create_ipv6_subnet(network,
|
||||
ipv6_ra_mode=mode,
|
||||
ipv6_address_mode=mode,
|
||||
enable_dhcp=True,
|
||||
cidr="4012::/64")
|
||||
enable_dhcp=True)
|
||||
network_1 = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
mode = "dhcpv6-stateless"
|
||||
subnet_1 = self._create_ipv6_subnet(network_1,
|
||||
ipv6_ra_mode=mode,
|
||||
ipv6_address_mode=mode,
|
||||
enable_dhcp=True,
|
||||
cidr="4013::/64")
|
||||
enable_dhcp=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
rtr_name, routers_client=self.cmgr_adm.routers_client)
|
||||
@ -608,16 +601,14 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet = self._create_ipv6_subnet(network,
|
||||
ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful",
|
||||
enable_dhcp=True,
|
||||
cidr="4012::/64")
|
||||
enable_dhcp=True)
|
||||
network_1 = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
mode = "dhcpv6-stateless"
|
||||
subnet_1 = self._create_ipv6_subnet(network_1,
|
||||
ipv6_ra_mode=mode,
|
||||
ipv6_address_mode=mode,
|
||||
enable_dhcp=True,
|
||||
cidr="4013::/64")
|
||||
enable_dhcp=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
rtr_name, routers_client=self.cmgr_adm.routers_client)
|
||||
@ -646,7 +637,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnet_ipv4 = self.create_topology_subnet(subnet_name, network,
|
||||
subnets_client=subnet_client,
|
||||
cidr='20.20.0.0/16')
|
||||
subnet = self._create_ipv6_subnet(network, cidr="4011::/64",
|
||||
subnet = self._create_ipv6_subnet(network,
|
||||
ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful")
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
@ -677,7 +668,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
subnets_client=subnet_client,
|
||||
cidr='20.20.0.0/16')
|
||||
mode = "dhcpv6-stateless"
|
||||
subnet = self._create_ipv6_subnet(network, cidr="4011::/64",
|
||||
subnet = self._create_ipv6_subnet(network,
|
||||
ipv6_ra_mode=mode,
|
||||
ipv6_address_mode=mode)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
@ -754,8 +745,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
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",
|
||||
network, ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful",
|
||||
slaac=False)
|
||||
time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT)
|
||||
@ -766,7 +756,6 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
router_client=self.cmgr_adm.routers_client,
|
||||
router_id=router['id'], subnet_id=subnet_ipv6['id'])
|
||||
self.assertEqual(subnet_ipv6['id'], interface['subnet_id'])
|
||||
|
||||
subnet_client = self.cmgr_adm.subnets_client
|
||||
subnet_ipv4_name = network['name'] + 'dual-ipv4-sub'
|
||||
subnet_ipv4 = self.create_topology_subnet(
|
||||
@ -793,7 +782,6 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
vm2_server_floatingip = self.topology_servers["vm_2"][
|
||||
"floating_ips"][0]
|
||||
time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT)
|
||||
|
||||
# Check IPv4 connectivity across the same network
|
||||
vm1_server = self.topology_servers["vm_1"]
|
||||
vm2_server = self.topology_servers["vm_2"]
|
||||
@ -833,7 +821,7 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
self.assertEqual(subnet_ipv4['id'], interface['subnet_id'])
|
||||
|
||||
subnet_ipv6 = self._create_ipv6_subnet(
|
||||
network, cidr="4300::/64",
|
||||
network,
|
||||
ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful",
|
||||
slaac=False)
|
||||
@ -867,3 +855,77 @@ class IPv6RoutersTest(feature_manager.FeatureManager):
|
||||
network, vm1_server_floatingip, vm1_server)
|
||||
self.check_vm_internal_connectivity(
|
||||
network, vm2_server_floatingip, vm2_server)
|
||||
|
||||
@decorators.attr(type=['nsxv3', 'positive'])
|
||||
@decorators.idempotent_id('85235d0f-89b5-48a0-a3ed-d1bd21be6b94')
|
||||
def test_multiple_dhcpv6_stateful_downlink_interface_rtr_vlan(self):
|
||||
"""Test creating multiple dhcpv6 subnets attached
|
||||
to router downlink interface
|
||||
"""
|
||||
name = data_utils.rand_name("ipv6-net")
|
||||
networks_client = self.cmgr_adm.networks_client
|
||||
vlan_id_no = constants.VLAN
|
||||
body = {"provider:segmentation_id": vlan_id_no,
|
||||
"provider:network_type": constants.VLAN_TYPE,
|
||||
"admin_state_up": 'True'}
|
||||
network = self.create_topology_network(name,
|
||||
networks_client=networks_client,
|
||||
**body)
|
||||
subnet = self._create_ipv6_subnet(
|
||||
network, ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful", enable_dhcp=True)
|
||||
network_1 = self.create_topology_network(
|
||||
name, networks_client=networks_client)
|
||||
subnet_1 = self._create_ipv6_subnet(
|
||||
network_1, ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful", enable_dhcp=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
rtr_name, routers_client=self.cmgr_adm.routers_client)
|
||||
interface = self.add_router_interface(
|
||||
router_client=self.cmgr_adm.routers_client,
|
||||
router_id=router['id'], subnet_id=subnet['id'])
|
||||
self.assertEqual(subnet['id'], interface['subnet_id'])
|
||||
interface = self.add_router_interface(
|
||||
router_client=self.cmgr_adm.routers_client,
|
||||
router_id=router['id'], subnet_id=subnet_1['id'])
|
||||
self.assertEqual(subnet_1['id'], interface['subnet_id'])
|
||||
|
||||
@decorators.attr(type=['nsxv3', 'positive'])
|
||||
@decorators.idempotent_id('85235d0f-89b5-48a0-a3ed-d1bd21be6b95')
|
||||
def test_multiple_dhcpv6_multiple_downlink_interface_rtr_vlan(self):
|
||||
"""Test creating multiple dhcpv6 subnets attached
|
||||
to router downlink interface
|
||||
"""
|
||||
name = data_utils.rand_name("ipv6-net")
|
||||
networks_client = self.cmgr_adm.networks_client
|
||||
vlan_id_no = constants.VLAN
|
||||
body = {"provider:segmentation_id": vlan_id_no,
|
||||
"provider:network_type": constants.VLAN_TYPE,
|
||||
"admin_state_up": 'True'}
|
||||
network = self.create_topology_network(name,
|
||||
networks_client=networks_client,
|
||||
**body)
|
||||
subnet = self._create_ipv6_subnet(
|
||||
network, ipv6_ra_mode="dhcpv6-stateful",
|
||||
ipv6_address_mode="dhcpv6-stateful", enable_dhcp=True)
|
||||
vlan_id_no = int(vlan_id_no) + 1
|
||||
body = {"provider:segmentation_id": vlan_id_no,
|
||||
"provider:network_type": constants.VLAN_TYPE,
|
||||
"admin_state_up": 'True'}
|
||||
network_1 = self.create_topology_network(
|
||||
name, networks_client=networks_client, **body)
|
||||
subnet_1 = self._create_ipv6_subnet(
|
||||
network_1, ipv6_ra_mode="dhcpv6-stateless",
|
||||
ipv6_address_mode="dhcpv6-stateless", enable_dhcp=True)
|
||||
rtr_name = data_utils.rand_name("ipv6-rtr")
|
||||
router = self.create_topology_router(
|
||||
rtr_name, routers_client=self.cmgr_adm.routers_client)
|
||||
interface = self.add_router_interface(
|
||||
router_client=self.cmgr_adm.routers_client,
|
||||
router_id=router['id'], subnet_id=subnet['id'])
|
||||
self.assertEqual(subnet['id'], interface['subnet_id'])
|
||||
interface = self.add_router_interface(
|
||||
router_client=self.cmgr_adm.routers_client,
|
||||
router_id=router['id'], subnet_id=subnet_1['id'])
|
||||
self.assertEqual(subnet_1['id'], interface['subnet_id'])
|
||||
|
@ -219,7 +219,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager):
|
||||
protocol_port="80",
|
||||
lb_algorithm="LEAST_CONNECTIONS",
|
||||
external_subnet=network['subnets'][0],
|
||||
external=True, create_fip=True)
|
||||
external=True, create_fip=True, fip_disassociate=False)
|
||||
self.check_project_lbaas()
|
||||
vip_address = lb_dict['vip_address']
|
||||
router_state_1 = diction['router']['router']
|
||||
@ -1250,6 +1250,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager):
|
||||
max_retries=self.hm_max_retries,
|
||||
delay=self.hm_delay, default_pool=True)
|
||||
lb_id = self.loadbalancer['id']
|
||||
time.sleep(constants.NSX_BACKEND_SMALL_TIME_INTERVAL)
|
||||
noerr, status_dict = self.get_status_lb_resources(lb_id)
|
||||
self.assertTrue(noerr, status_dict)
|
||||
|
||||
@ -1272,7 +1273,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager):
|
||||
timeout=self.hm_timeout,
|
||||
max_retries=self.hm_max_retries,
|
||||
delay=self.hm_delay)
|
||||
time.sleep(60)
|
||||
time.sleep(constants.NSX_BACKEND_SMALL_TIME_INTERVAL)
|
||||
lb_id = self.loadbalancer['id']
|
||||
noerr, status_dict = self.get_status_lb_resources(lb_id)
|
||||
self.assertTrue(noerr, status_dict)
|
||||
@ -1391,3 +1392,45 @@ class OctaviaRoundRobin(feature_manager.FeatureManager):
|
||||
policy['policy']['id'])
|
||||
self.cmgr_adm.qos_client.delete_qos_policy(policy['policy']['id'])
|
||||
self.check_project_lbaas()
|
||||
|
||||
@decorators.attr(type='nsxv3')
|
||||
@decorators.idempotent_id('ca5c8546-6768-4b7a-8711-3844b11b1a34')
|
||||
def test_create_verify_lb_rr_with_allowed_cidr_0_0_0_0_with_fw(self):
|
||||
"""
|
||||
The Loadbalancer listener is created with allowed_cidrs specified
|
||||
"""
|
||||
diction = self.deploy_octavia_topology()
|
||||
# Enable firewall policy on same router
|
||||
tcp_rule = {'name': 'tcp', 'protocol': 'tcp',
|
||||
'project_id': diction['network']['tenant_id'],
|
||||
'action': 'allow'}
|
||||
fw_rule1 = self.create_firewall_rule(**tcp_rule)
|
||||
fw_policy = {'name': 'policy1',
|
||||
'firewall_rules': [fw_rule1['firewall_rule']['id']],
|
||||
'project_id': diction['network']['tenant_id']}
|
||||
fw_policy = self.create_firewall_policy(**fw_policy)
|
||||
fw_pol_id = fw_policy['firewall_policy']['id']
|
||||
device_owner = u'network:router_interface'
|
||||
ports_client = self.cmgr_adm.ports_client
|
||||
router_id = diction['router']['router']['id']
|
||||
ports_list = ports_client.list_ports(device_id=router_id,
|
||||
device_owner=device_owner)
|
||||
ports = [ports_list['ports'][0]['id']]
|
||||
fw_group = self.create_firewall_group(
|
||||
name='fwg',
|
||||
ingress_firewall_policy_id=fw_pol_id,
|
||||
egress_firewall_policy_id=fw_pol_id,
|
||||
ports=ports,
|
||||
project_id=diction['network']['tenant_id'])
|
||||
cidr_list = ['0.0.0.0/0']
|
||||
if not CONF.nsxv3.ens:
|
||||
self.start_web_servers(constants.HTTP_PORT)
|
||||
subnet_id = diction['subnet']['subnet']['id']
|
||||
self.create_project_octavia(protocol_type="HTTP", protocol_port="80",
|
||||
lb_algorithm="ROUND_ROBIN",
|
||||
vip_subnet_id=subnet_id,
|
||||
allowed_cidrs=cidr_list)
|
||||
|
||||
self.check_project_lbaas()
|
||||
fw_group_id = fw_group['firewall_group']['id']
|
||||
self.fwaas_v2_client.update_firewall_v2_group(fw_group_id, ports=[])
|
||||
|
@ -328,13 +328,20 @@ class TestNewCase(feature_manager.FeatureManager):
|
||||
1)
|
||||
fix_ip = [{'subnet_id': subnet_state.get(
|
||||
'id'),
|
||||
'ip_address': network_cidr[0] + '.20'},
|
||||
'ip_address': network_cidr[0] + '.5'},
|
||||
{'subnet_id': subnet_state.get('id'),
|
||||
'ip_address': network_cidr[0] + '.21'}]
|
||||
args = {'fixed_ips': fix_ip, 'network_id': network_state['id']}
|
||||
self.assertRaises(exceptions.BadRequest,
|
||||
self.cmgr_adm.ports_client.create_port,
|
||||
**args)
|
||||
'ip_address': network_cidr[0] + '.6'}]
|
||||
# self.assertRaises(exceptions.BadRequest,
|
||||
# self.cmgr_adm.ports_client.create_port,
|
||||
# **args)
|
||||
# Updating this case to support multiple fixed Ips
|
||||
# for port after VIO 7.1.1 & 7.2
|
||||
port = self.create_topology_port(
|
||||
network_state,
|
||||
ports_client=self.cmgr_adm.ports_client,
|
||||
fixed_ips=fix_ip)
|
||||
port = port['port']
|
||||
self.assertEqual("ACTIVE", port['status'])
|
||||
|
||||
@decorators.idempotent_id('1207450d-91cc-8905-b217-98844caa68e5')
|
||||
def test_update_port_with_two_fixed_ip(self):
|
||||
@ -351,7 +358,7 @@ class TestNewCase(feature_manager.FeatureManager):
|
||||
1)
|
||||
fix_ip1 = [
|
||||
{'subnet_id': subnet_state.get('id'),
|
||||
'ip_address': network_cidr[0] + '.20'}]
|
||||
'ip_address': network_cidr[0] + '.5'}]
|
||||
port = self.create_topology_port(
|
||||
network_state, ports_client=self.cmgr_adm.ports_client,
|
||||
fixed_ips=fix_ip1)
|
||||
@ -359,13 +366,16 @@ class TestNewCase(feature_manager.FeatureManager):
|
||||
self.assertEqual("ACTIVE", port['status'])
|
||||
fix_ip = [{'subnet_id': subnet_state.get(
|
||||
'id'),
|
||||
'ip_address': network_cidr[0] + '.21'},
|
||||
'ip_address': network_cidr[0] + '.6'},
|
||||
{'subnet_id': subnet_state.get('id'),
|
||||
'ip_address': network_cidr[0] + '.22'}]
|
||||
'ip_address': network_cidr[0] + '.7'}]
|
||||
args = {'fixed_ips': fix_ip}
|
||||
self.assertRaises(exceptions.BadRequest,
|
||||
self.cmgr_adm.ports_client.update_port,
|
||||
port['id'], **args)
|
||||
# self.assertRaises(exceptions.BadRequest,
|
||||
# self.cmgr_adm.ports_client.update_port,
|
||||
# port['id'], **args)
|
||||
# Updating this case to support multiple fixed Ips
|
||||
# for port after VIO 7.1.1 & 7.2
|
||||
self.cmgr_adm.ports_client.update_port(port['id'], **args)
|
||||
|
||||
@decorators.idempotent_id('1206016a-91cc-8905-b217-98844caa24a1')
|
||||
def test_router_admin_state_when_vms_hosted(self):
|
||||
|
@ -205,6 +205,10 @@ class ProviderNetworks(feature_manager.FeatureManager):
|
||||
provider_network = self.provider_networks_topoloy(
|
||||
constants.VLAN_TYPE,
|
||||
tz_id=self.vlan_id)
|
||||
time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT)
|
||||
nsx_network = self.nsx.get_logical_switch(provider_network['name'],
|
||||
provider_network['id'])
|
||||
self.assertEqual(4050, nsx_network['vlan'])
|
||||
subnet_client = self.cmgr_adm.subnets_client
|
||||
router = self.create_topology_router("rtr-provider")
|
||||
subnet_name = provider_network['name'] + '_subnet'
|
||||
@ -216,11 +220,14 @@ 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,
|
||||
vlan_id_unique=1004)
|
||||
time.sleep(constants.NSX_NETWORK_REALISE_TIMEOUT)
|
||||
nsx_network1 = self.nsx.get_logical_switch(provider_network1['name'],
|
||||
provider_network1['id'])
|
||||
self.assertEqual(1004, nsx_network1['vlan'])
|
||||
subnet_name = provider_network1['name'] + '_subnet1'
|
||||
kwargs = {"enable_dhcp": "True"}
|
||||
self.create_topology_subnet(
|
||||
@ -237,21 +244,6 @@ class ProviderNetworks(feature_manager.FeatureManager):
|
||||
kwargs = dict(tenant_id=provider_network['tenant_id'],
|
||||
security_group_rules_client=sec_rule_client,
|
||||
security_groups_client=sec_client)
|
||||
sg = self.create_topology_security_group(**kwargs)
|
||||
self.create_topology_instance(
|
||||
"provider-server1", [provider_network],
|
||||
security_groups=[{'name': sg['name']}],
|
||||
clients=self.cmgr_adm)
|
||||
self.create_topology_instance(
|
||||
"provider-server2", [provider_network1],
|
||||
security_groups=[{'name': sg['name']}],
|
||||
clients=self.cmgr_adm)
|
||||
for server_name in self.topology_servers.keys():
|
||||
server = self.servers_details[server_name].server
|
||||
fip_data = server.get('floating_ips')[0]
|
||||
fip = fip_data['floating_ip_address']
|
||||
self.verify_server_ssh(
|
||||
server=server, floating_ip=fip)
|
||||
|
||||
@decorators.idempotent_id('a813f45a-aad0-489e-a976-e2b48cd6e2f2')
|
||||
def test_provider_vlan_networks_using_router_Adn_verify(self):
|
||||
|
Loading…
Reference in New Issue
Block a user