X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FIPUtil.py;h=7f2335330e0fd5b37249e1e5cf13661141bb7141;hb=refs%2Fchanges%2F22%2F20422%2F7;hp=b78450a9f8c110aebb11fc0e347de73f59a17c29;hpb=56c1c013bd0d632256efa4cb6b0224bf9c608afa;p=csit.git diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py index b78450a9f8..7f2335330e 100644 --- a/resources/libraries/python/IPUtil.py +++ b/resources/libraries/python/IPUtil.py @@ -26,6 +26,7 @@ from resources.libraries.python.InterfaceUtil import InterfaceUtil from resources.libraries.python.PapiExecutor import PapiExecutor from resources.libraries.python.ssh import exec_cmd_no_error, exec_cmd from resources.libraries.python.topology import Topology +from resources.libraries.python.VatExecutor import VatTerminal # from vpp/src/vnet/vnet/mpls/mpls_types.h @@ -448,6 +449,25 @@ class IPUtil(object): :type prefix_len: int :type kwargs: dict """ + count = kwargs.get("count", 1) + + if count > 100: + gateway = kwargs.get("gateway", '') + + vrf = kwargs.get("vrf", None) + multipath = kwargs.get("multipath", False) + + with VatTerminal(node, json_param=False) as vat: + vat.vat_terminal_exec_cmd_from_template( + 'vpp_route_add.vat', + network=network, + prefix_length=prefix_len, + via='via {}'.format(gateway) if gateway else '', + vrf='vrf {}'.format(vrf) if vrf else '', + count='count {}'.format(count) if count else '', + multipath='multipath' if multipath else '') + return + interface = kwargs.get('interface', '') gateway = kwargs.get('gateway', '')