Browse Source

ipv6 test, ping gateway in nsxv

Change-Id: I4b17e99d03b2e3455e3576e71dceeb49fcb658d9
changes/92/739392/1
dkumbhar 1 month ago
parent
commit
2b9a91f426
1 changed files with 55 additions and 0 deletions
  1. +55
    -0
      vmware_nsx_tempest_plugin/tests/scenario/test_new_case_coverage.py

+ 55
- 0
vmware_nsx_tempest_plugin/tests/scenario/test_new_case_coverage.py View File

@@ -1823,3 +1823,58 @@ class TestNewCase(feature_manager.FeatureManager):
self.assertFalse(self.vsm.verify_static_route(router_state['name'],
'100.0.0.0/24',
next_hop))

def _assign_ipv6_address(self, ssh_src, interface_name, ip_address):
ssh_src.exec_command("sudo /sbin/ip -6 addr add %s/64 dev %s \
" % (ip_address, interface_name))
ssh_src.exec_command("sudo /sbin/ip link set %s up" % (interface_name))

@decorators.attr(type='nsxv')
@decorators.idempotent_id('2226016a-91cc-8905-b217-22344cab24a1')
def test_ipv6_router_gateway_is_reachable(self):
rtr_name = data_utils.rand_name(name='tempest-router')
network_ipv4 = data_utils.rand_name(name='tempest-ipv4')
network_ipv6 = data_utils.rand_name(name='tempest-ipv6')
subnet_ipv4 = data_utils.rand_name(name='tempest-ipv4')
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=True,
routers_client=rtr_client)
network_ipv4 = self.create_topology_network(network_ipv4,
networks_client=nw_client)
network_ipv6 = self.create_topology_network(network_ipv6,
networks_client=nw_client)
self.create_topology_subnet(subnet_ipv4,
network_ipv4,
router_id=router["id"],
cidr='10.198.1.0/24')
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)
sec_rule_client = self.sec_rule_client
sec_client = self.sec_client
kwargs = dict(tenant_id=network_ipv4['tenant_id'],
security_group_rules_client=sec_rule_client,
security_groups_client=sec_client)
self.sg = self.create_topology_security_group(**kwargs)
image_id = self.get_glance_image_id(['c22'])
security_groups = [{'name': self.sg['name']}]
s1 = self.create_topology_instance("state_vm_1",
[network_ipv4, network_ipv6],
create_floating_ip=True,
image_id=image_id,
security_groups=security_groups,
clients=self.cmgr_adm)
ip_address = s1['floating_ips'][0]['floating_ip_address']
ipv6_address = s1['addresses'].values()[1][1]['addr']
ssh_src1 = self._get_remote_client(ip_address, username='cirros',
use_password=True)
self._assign_ipv6_address(ssh_src1, 'eth1', ipv6_address)
self.check_remote_connectivity(ssh_src1, '2001:db3:a583::1',
should_succeed=True)

Loading…
Cancel
Save