test: ip4 vrf instances multi-context test (CSIT-492)
- add/delete IPv4 VRF instances and verify results by parsing output
of ip_fib_dump API command and by traffic
Change-Id: I61ed5013adca29afd00b942f65be7bf964f38d85
Signed-off-by: Jan Gelety <jgelety@cisco.com>
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 0e4c0cd..26edd4f 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -595,6 +595,54 @@
}
)
+ def reset_vrf(self,
+ vrf_id,
+ is_ipv6=0,
+ ):
+ """ Reset VRF (remove all routes etc.) request.
+
+ :param int vrf_id: ID of the FIB table / VRF to reset.
+ :param int is_ipv6: 1 for IPv6 neighbor, 0 for IPv4. (Default = 0)
+ """
+
+ return self.api(
+ self.papi.reset_vrf,
+ {'vrf_id': vrf_id,
+ 'is_ipv6': is_ipv6,
+ }
+ )
+
+ def reset_fib(self,
+ vrf_id,
+ is_ipv6=0,
+ ):
+ """ Reset VRF (remove all routes etc.) request.
+
+ :param int vrf_id: ID of the FIB table / VRF to reset.
+ :param int is_ipv6: 1 for IPv6 neighbor, 0 for IPv4. (Default = 0)
+ """
+
+ return self.api(
+ self.papi.reset_fib,
+ {'vrf_id': vrf_id,
+ 'is_ipv6': is_ipv6,
+ }
+ )
+
+ def ip_dump(self,
+ is_ipv6=0,
+ ):
+ """ Return IP dump.
+
+ :param int is_ipv6: 1 for IPv6 neighbor, 0 for IPv4. (Default = 0)
+ """
+
+ return self.api(
+ self.papi.ip_dump,
+ {'is_ipv6': is_ipv6,
+ }
+ )
+
def sw_interface_span_enable_disable(
self, sw_if_index_from, sw_if_index_to, state=1):
"""