aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/Memif.py
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2018-03-07 15:06:47 +0100
committerPeter Mikus <pmikus@cisco.com>2018-03-08 10:42:57 +0000
commitf65b8ddc723ed9fc444509525662eda6dbc74401 (patch)
tree8f38db7fae53819ee93820dc20b7a35665819223 /resources/libraries/python/Memif.py
parentd38fc2895fba1fe04d7f8c0d41373ffe42c14fab (diff)
CSIT-989 Fix: Reflect latest memif API changes
Change-Id: I0c9cb073a42a8b4b7e573023e784ab9e72d0ad55 Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/Memif.py')
-rw-r--r--resources/libraries/python/Memif.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/resources/libraries/python/Memif.py b/resources/libraries/python/Memif.py
index e3cea939ec..e1f3d30d33 100644
--- a/resources/libraries/python/Memif.py
+++ b/resources/libraries/python/Memif.py
@@ -25,16 +25,18 @@ class Memif(object):
pass
@staticmethod
- def create_memif_interface(node, socket, mid, role='master'):
+ def create_memif_interface(node, filename, mid, sid, role='master'):
"""Create Memif interface on the given node.
:param node: Given node to create Memif interface on.
- :param socket: Memif interface socket path.
+ :param filename: Memif interface socket filename.
:param mid: Memif interface ID.
+ :param sid: Socket ID.
:param role: Memif interface role [master|slave]. Default is master.
:type node: dict
- :type socket: str
+ :type filename: str
:type mid: str
+ :type sid: str
:type role: str
:returns: SW interface index.
:rtype: int
@@ -43,8 +45,10 @@ class Memif(object):
with VatTerminal(node, json_param=False) as vat:
vat.vat_terminal_exec_cmd_from_template(
- 'memif_create.vat',
- socket=socket, id=mid, role=role)
+ 'memif_socket_filename_add_del.vat',
+ add_del='add', id=sid, filename='/tmp/'+filename)
+ vat.vat_terminal_exec_cmd_from_template(
+ 'memif_create.vat', id=mid, socket=sid, role=role)
if 'sw_if_index' in vat.vat_stdout:
try:
sw_if_idx = int(vat.vat_stdout.split()[4])
@@ -56,7 +60,8 @@ class Memif(object):
Topology.update_interface_name(node, if_key, ifc_name)
ifc_mac = Memif.vpp_get_memif_interface_mac(node, sw_if_idx)
Topology.update_interface_mac_address(node, if_key, ifc_mac)
- Topology.update_interface_memif_socket(node, if_key, socket)
+ Topology.update_interface_memif_socket(node, if_key,
+ '/tmp/'+filename)
Topology.update_interface_memif_id(node, if_key, mid)
Topology.update_interface_memif_role(node, if_key, role)
return sw_if_idx