aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2019-06-17 12:36:09 +0200
committerVratko Polak <vrpolak@cisco.com>2019-07-01 14:03:51 +0000
commitc3f3339838606f62760c3cd5ae3e820dbc9fe7dd (patch)
tree2f5ee68915592ad48869c710de21af5ed2b2773b /resources
parentccef9f4e7e2e8cb04cb2de5e43e59d4fd15cf8b6 (diff)
FIX: re-introduce VAT for IP scale tests
Change-Id: I864118ee67628ea81f2f89dab5890df8fe15c4bc Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources')
-rw-r--r--resources/libraries/python/IPUtil.py20
-rw-r--r--resources/templates/vat/vpp_route_add.vat1
2 files changed, 21 insertions, 0 deletions
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', '')
diff --git a/resources/templates/vat/vpp_route_add.vat b/resources/templates/vat/vpp_route_add.vat
new file mode 100644
index 0000000000..b288c6b610
--- /dev/null
+++ b/resources/templates/vat/vpp_route_add.vat
@@ -0,0 +1 @@
+ip_route_add_del {network}/{prefix_length} {vrf} {count} {multipath} {via} \ No newline at end of file