test: ip6 vrf instances multi-context test (CSIT-497)
- add/delete IPv6 VRF instances and verify results by parsing output of ip6_fib_dump API command and by traffic - small changes in assert_nothing_captured and get_capture to get logged unexpected packets Change-Id: I32207447be2df942e335aa9890ff52fb88e46597 Signed-off-by: Jan Gelety <jgelety@cisco.com>
This commit is contained in:
committed by
Damjan Marion
parent
82786c418f
commit
057bb8c3a4
File diff suppressed because it is too large
Load Diff
@@ -226,12 +226,16 @@ class VppInterface(object):
|
||||
self.has_ip6_config = False
|
||||
self.has_ip6_config = False
|
||||
|
||||
def configure_ipv6_neighbors(self):
|
||||
"""For every remote host assign neighbor's MAC to IPv6 address."""
|
||||
def configure_ipv6_neighbors(self, vrf_id=0):
|
||||
"""For every remote host assign neighbor's MAC to IPv6 addresses.
|
||||
|
||||
:param vrf_id: The FIB table / VRF ID. (Default value = 0)
|
||||
"""
|
||||
for host in self._remote_hosts:
|
||||
macn = host.mac.replace(":", "").decode('hex')
|
||||
ipn = host.ip6n
|
||||
self.test.vapi.ip_neighbor_add_del(
|
||||
self.sw_if_index, macn, host.ip6n, is_ipv6=1)
|
||||
self.sw_if_index, macn, ipn, vrf_id, is_ipv6=1)
|
||||
|
||||
def unconfig(self):
|
||||
"""Unconfigure IPv6 and IPv4 address on the VPP interface."""
|
||||
|
||||
@@ -251,9 +251,10 @@ class VppPapiProvider(object):
|
||||
{'sw_if_index': sw_if_index,
|
||||
'enable': is_enable})
|
||||
|
||||
def sw_interface_ra_suppress(self, sw_if_index):
|
||||
def sw_interface_ra_suppress(self, sw_if_index, suppress=1):
|
||||
return self.api(self.papi.sw_interface_ip6nd_ra_config,
|
||||
{'sw_if_index': sw_if_index})
|
||||
{'sw_if_index': sw_if_index,
|
||||
'suppress': suppress})
|
||||
|
||||
def ip6_sw_interface_ra_config(self, sw_if_index,
|
||||
no,
|
||||
@@ -601,6 +602,9 @@ class VppPapiProvider(object):
|
||||
def ip_fib_dump(self):
|
||||
return self.api(self.papi.ip_fib_dump, {})
|
||||
|
||||
def ip6_fib_dump(self):
|
||||
return self.api(self.papi.ip6_fib_dump, {})
|
||||
|
||||
def ip_neighbor_add_del(self,
|
||||
sw_if_index,
|
||||
mac_address,
|
||||
|
||||
@@ -220,6 +220,10 @@ class VppPGInterface(VppInterface):
|
||||
if len(capture.res) == expected_count:
|
||||
# bingo, got the packets we expected
|
||||
return capture
|
||||
elif len(capture.res) > expected_count:
|
||||
self.test.logger.error(
|
||||
ppc("Unexpected packets captured:", capture))
|
||||
break
|
||||
else:
|
||||
self.test.logger.debug("Partial capture containing %s "
|
||||
"packets doesn't match expected "
|
||||
@@ -251,8 +255,6 @@ class VppPGInterface(VppInterface):
|
||||
if not capture or len(capture.res) == 0:
|
||||
# junk filtered out, we're good
|
||||
return
|
||||
self.test.logger.error(
|
||||
ppc("Unexpected packets captured:", capture))
|
||||
except:
|
||||
pass
|
||||
self.generate_debug_aid("empty-assert")
|
||||
|
||||
Reference in New Issue
Block a user