aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/InterfaceUtil.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/InterfaceUtil.py')
-rw-r--r--resources/libraries/python/InterfaceUtil.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 0b1f06f9bf..6de17d10d9 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -24,7 +24,7 @@ from resources.libraries.python.Constants import Constants
from resources.libraries.python.CpuUtils import CpuUtils
from resources.libraries.python.DUTSetup import DUTSetup
from resources.libraries.python.L2Util import L2Util
-from resources.libraries.python.PapiExecutor import PapiExecutor
+from resources.libraries.python.PapiExecutor import PapiSocketExecutor
from resources.libraries.python.parsers.JsonParser import JsonParser
from resources.libraries.python.ssh import SSH, exec_cmd_no_error
from resources.libraries.python.topology import NodeType, Topology
@@ -138,7 +138,7 @@ class InterfaceUtil(object):
host=node['host'])
args = dict(sw_if_index=sw_if_index,
admin_up_down=admin_up_down)
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
papi_exec.add(cmd, **args).get_reply(err_msg)
elif node['type'] == NodeType.TG or node['type'] == NodeType.VM:
cmd = 'ip link set {ifc} {state}'.format(
@@ -210,7 +210,7 @@ class InterfaceUtil(object):
args = dict(sw_if_index=sw_if_index,
mtu=int(mtu))
try:
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
papi_exec.add(cmd, **args).get_reply(err_msg)
except AssertionError as err:
# TODO: Make failure tolerance optional.
@@ -321,7 +321,7 @@ class InterfaceUtil(object):
name_filter='')
err_msg = 'Failed to get interface dump on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
details = papi_exec.add(cmd, **args).get_details(err_msg)
def process_if_dump(if_dump):
@@ -729,7 +729,7 @@ class InterfaceUtil(object):
vlan_id=int(vlan))
err_msg = 'Failed to create VLAN sub-interface on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(err_msg)
if_key = Topology.add_new_port(node, 'vlan_subif')
@@ -771,7 +771,7 @@ class InterfaceUtil(object):
vni=int(vni))
err_msg = 'Failed to create VXLAN tunnel interface on host {host}'.\
format(host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(err_msg)
if_key = Topology.add_new_port(node, 'vxlan_tunnel')
@@ -805,7 +805,7 @@ class InterfaceUtil(object):
args = dict(sw_if_index=sw_if_index)
err_msg = 'Failed to get VXLAN dump on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
details = papi_exec.add(cmd, **args).get_details(err_msg)
def process_vxlan_dump(vxlan_dump):
@@ -853,7 +853,7 @@ class InterfaceUtil(object):
cmd = 'sw_interface_vhost_user_dump'
err_msg = 'Failed to get vhost-user dump on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
details = papi_exec.add(cmd).get_details(err_msg)
def process_vhost_dump(vhost_dump):
@@ -896,7 +896,7 @@ class InterfaceUtil(object):
cmd = 'sw_interface_tap_v2_dump'
err_msg = 'Failed to get TAP dump on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
details = papi_exec.add(cmd).get_details(err_msg)
def process_tap_dump(tap_dump):
@@ -972,7 +972,7 @@ class InterfaceUtil(object):
inner_vlan_id=int(inner_vlan_id) if inner_vlan_id else 0)
err_msg = 'Failed to create sub-interface on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(err_msg)
if_key = Topology.add_new_port(node, 'subinterface')
@@ -1007,7 +1007,7 @@ class InterfaceUtil(object):
tunnel=tunnel)
err_msg = 'Failed to create GRE tunnel interface on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(err_msg)
if_key = Topology.add_new_port(node, 'gre_tunnel')
@@ -1032,7 +1032,7 @@ class InterfaceUtil(object):
args = dict(mac_address=0)
err_msg = 'Failed to create loopback interface on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(err_msg)
if_key = Topology.add_new_port(node, 'loopback')
@@ -1071,7 +1071,7 @@ class InterfaceUtil(object):
lb=load_balance.upper())).value)
err_msg = 'Failed to create bond interface on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(err_msg)
InterfaceUtil.add_eth_interface(node, sw_if_index=sw_if_index,
@@ -1128,7 +1128,7 @@ class InterfaceUtil(object):
txq_size=0)
err_msg = 'Failed to create AVF interface on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
sw_if_index = papi_exec.add(cmd, **args).get_sw_if_index(err_msg)
InterfaceUtil.add_eth_interface(node, sw_if_index=sw_if_index,
@@ -1160,7 +1160,7 @@ class InterfaceUtil(object):
'interface {bond} on host {host}'.format(ifc=interface,
bond=bond_if,
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
papi_exec.add(cmd, **args).get_reply(err_msg)
@staticmethod
@@ -1177,7 +1177,7 @@ class InterfaceUtil(object):
host=node['host'])
data = ('Bond data on node {host}:\n'.format(host=node['host']))
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
details = papi_exec.add(cmd).get_details(err_msg)
for bond in details:
@@ -1220,7 +1220,7 @@ class InterfaceUtil(object):
err_msg = 'Failed to get slave dump on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
details = papi_exec.add(cmd, **args).get_details(err_msg)
def process_slave_dump(slave_dump):
@@ -1281,7 +1281,7 @@ class InterfaceUtil(object):
is_add=1)
err_msg = 'Failed to enable input acl on interface {ifc}'.format(
ifc=interface)
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
papi_exec.add(cmd, **args).get_reply(err_msg)
@staticmethod
@@ -1306,7 +1306,7 @@ class InterfaceUtil(object):
args = dict(sw_if_index=sw_if_index)
err_msg = 'Failed to get classify table name by interface {ifc}'.format(
ifc=interface)
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
reply = papi_exec.add(cmd, **args).get_reply(err_msg)
return reply
@@ -1350,7 +1350,7 @@ class InterfaceUtil(object):
args = dict(sw_if_index=sw_if_index)
err_msg = 'Failed to get VXLAN-GPE dump on host {host}'.format(
host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
details = papi_exec.add(cmd, **args).get_details(err_msg)
def process_vxlan_gpe_dump(vxlan_dump):
@@ -1405,7 +1405,7 @@ class InterfaceUtil(object):
vrf_id=int(table_id))
err_msg = 'Failed to assign interface {ifc} to FIB table'.format(
ifc=interface)
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
papi_exec.add(cmd, **args).get_reply(err_msg)
@staticmethod
@@ -1563,7 +1563,7 @@ class InterfaceUtil(object):
cmd = 'sw_interface_rx_placement_dump'
err_msg = "Failed to run '{cmd}' PAPI command on host {host}!".format(
cmd=cmd, host=node['host'])
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
for ifc in node['interfaces'].values():
if ifc['vpp_sw_index'] is not None:
papi_exec.add(cmd, sw_if_index=ifc['vpp_sw_index'])
@@ -1591,7 +1591,7 @@ class InterfaceUtil(object):
"{host}!".format(host=node['host'])
args = dict(sw_if_index=sw_if_index, queue_id=queue_id,
worker_id=worker_id)
- with PapiExecutor(node) as papi_exec:
+ with PapiSocketExecutor(node) as papi_exec:
papi_exec.add(cmd, **args).get_reply(err_msg)
@staticmethod