aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2019-06-18 20:38:55 +0200
committerJan Gelety <jgelety@cisco.com>2019-06-18 23:40:35 +0200
commit33ea31791a8be80194a0a86a24e9172e80e9e688 (patch)
treeea851329fa8d6368c0af1a4caed685ca28039534
parentee9babc16c6e3e6c119ac040321773ea64114752 (diff)
FIX: ip scale needs sw_if_index in VAT command
Change-Id: Icb3e22a84af10b98edf83084991b8f2607c95798 Signed-off-by: Jan Gelety <jgelety@cisco.com>
-rw-r--r--resources/libraries/python/IPUtil.py20
-rw-r--r--resources/templates/vat/vpp_route_add.vat2
2 files changed, 20 insertions, 2 deletions
diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py
index 0c4356bb64..17ba75d7fb 100644
--- a/resources/libraries/python/IPUtil.py
+++ b/resources/libraries/python/IPUtil.py
@@ -155,6 +155,21 @@ class IPUtil(object):
PapiExecutor.run_cli_cmd(node, 'show ip6 fib summary')
@staticmethod
+ def vpp_get_ip_tables_prefix(node, address):
+ """Get dump of all IP FIB tables on a VPP node.
+
+ :param node: VPP node.
+ :type node: dict
+ """
+ ip = ip_address(unicode(address))
+
+ PapiExecutor.run_cli_cmd(
+ node, 'show {ip_ver} fib {addr}/{addr_len}'.format(
+ ip_ver='ip6' if ip.version == 6 else 'ip',
+ addr=ip,
+ addr_len=ip.max_prefixlen))
+
+ @staticmethod
def get_interface_vrf_table(node, interface, ip_version='ipv4'):
"""Get vrf ID for the given interface.
@@ -549,7 +564,7 @@ class IPUtil(object):
if count > 100:
gateway = kwargs.get("gateway", '')
-
+ interface = kwargs.get("interface", '')
vrf = kwargs.get("vrf", None)
multipath = kwargs.get("multipath", False)
@@ -559,6 +574,9 @@ class IPUtil(object):
network=network,
prefix_length=prefix_len,
via='via {}'.format(gateway) if gateway else '',
+ sw_if_index='sw_if_index {}'.format(
+ InterfaceUtil.get_interface_index(node, interface))
+ if interface else '',
vrf='vrf {}'.format(vrf) if vrf else '',
count='count {}'.format(count) if count else '',
multipath='multipath' if multipath else '')
diff --git a/resources/templates/vat/vpp_route_add.vat b/resources/templates/vat/vpp_route_add.vat
index b288c6b610..73bb5acf8a 100644
--- a/resources/templates/vat/vpp_route_add.vat
+++ b/resources/templates/vat/vpp_route_add.vat
@@ -1 +1 @@
-ip_route_add_del {network}/{prefix_length} {vrf} {count} {multipath} {via} \ No newline at end of file
+ip_route_add_del {network}/{prefix_length} {vrf} {count} {multipath} {via} {sw_if_index} \ No newline at end of file