Allowed address pair with cidr

Change-Id: I2ec7e4dede0a0c026b7e635e56f39f7137cddb14
This commit is contained in:
pbharathbhu 2020-08-14 11:23:15 +00:00
parent 85051cada8
commit 55d06487d0
1 changed files with 53 additions and 0 deletions

View File

@ -1878,3 +1878,56 @@ class TestNewCase(feature_manager.FeatureManager):
self._assign_ipv6_address(ssh_src1, 'eth1', ipv6_address)
self.check_remote_connectivity(ssh_src1, '2001:db3:a583::1',
should_succeed=True)
@decorators.idempotent_id('1207349c-91cc-8905-b217-98844caa57d5')
def test_create_port_with_cidr_allowed_address_pairs_ipv4(self):
"""
Creating a port with allowed address pairs with idr ipv54
"""
topology_dict = self.create_topo_single_network(
"instance_port", create_instance=False)
network_state = topology_dict['network_state']
allowed_address = [
{
"ip_address": "12.12.11.12/32",
"mac_address": "fa:14:2a:b3:cb:f0"
}
]
args = {'allowed_address_pairs': allowed_address,
'network_id': network_state['id']}
port_id = self.cmgr_adm.ports_client.create_port(**args)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)
@decorators.idempotent_id('2226016a-91cc-8905-b217-22344cab24a2')
def test_ipv6_cidr_allowed_address_pair(self):
"""to check cidr alllowed address pair with ipv6"""
rtr_name = data_utils.rand_name(name='tempest-router')
network_ipv6 = data_utils.rand_name(name='tempest-ipv6')
subnet_ipv6 = data_utils.rand_name(name='tempest-ipv6')
nw_client = self.cmgr_adm.networks_client
rtr_client = self.cmgr_adm.routers_client
router = self.create_topology_router(rtr_name,
set_gateway=False,
routers_client=rtr_client)
network_ipv6 = self.create_topology_network(network_ipv6,
networks_client=nw_client)
kwargs = {"enable_dhcp": "False"}
self.create_topology_subnet(subnet_ipv6,
network_ipv6,
ip_version=6,
router_id=router["id"],
cidr='2001:db3:a583::/64',
**kwargs)
allowed_address = [
{
"ip_address": "2001::/128",
"mac_address": "fa:14:2a:b3:cb:f0"
}
]
args = {'allowed_address_pairs': allowed_address,
'network_id': network_ipv6['id']}
port_id = self.cmgr_adm.ports_client.create_port(**args)['port']['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.ports_client.delete_port, port_id)