aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/Constants.py3
-rw-r--r--resources/libraries/python/PapiExecutor.py2
-rw-r--r--resources/libraries/python/VppConfigGenerator.py7
3 files changed, 8 insertions, 4 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py
index d8550ab27a..0473ca2090 100644
--- a/resources/libraries/python/Constants.py
+++ b/resources/libraries/python/Constants.py
@@ -106,6 +106,9 @@ class Constants(object):
# Equivalent to ~0 used in vpp code
BITWISE_NON_ZERO = 0xffffffff
+ # Default path to VPP API socket.
+ SOCKSVR_PATH = "/run/vpp/api.sock"
+
# Mapping from NIC name to its bps limit.
# TODO: Implement logic to lower limits to TG NIC or software. Or PCI.
NIC_NAME_TO_LIMIT = {
diff --git a/resources/libraries/python/PapiExecutor.py b/resources/libraries/python/PapiExecutor.py
index 0e94fa61f5..8e59eff510 100644
--- a/resources/libraries/python/PapiExecutor.py
+++ b/resources/libraries/python/PapiExecutor.py
@@ -132,7 +132,7 @@ class PapiSocketExecutor(object):
api_json_directory = None
crc_checker_instance = None
- def __init__(self, node, remote_vpp_socket="/run/vpp-api.sock"):
+ def __init__(self, node, remote_vpp_socket=Constants.SOCKSVR_PATH):
"""Store the given arguments, declare managed variables.
:param node: Node to connect to and forward unix domain socket from.
diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py
index 7ee3e2ceb0..15e8ffb3b5 100644
--- a/resources/libraries/python/VppConfigGenerator.py
+++ b/resources/libraries/python/VppConfigGenerator.py
@@ -20,6 +20,7 @@ in 7 various places of CSIT code.
import re
+from resources.libraries.python.Constants import Constants
from resources.libraries.python.ssh import exec_cmd_no_error
from resources.libraries.python.topology import NodeType
from resources.libraries.python.topology import Topology
@@ -196,10 +197,10 @@ class VppConfigGenerator(object):
path = ['unix', 'exec']
self.add_config_item(self._nodeconfig, value, path)
- def add_socksvr(self, socket="default"):
+ def add_socksvr(self, socket=Constants.SOCKSVR_PATH):
"""Add socksvr configuration."""
- path = ['socksvr', socket]
- self.add_config_item(self._nodeconfig, '', path)
+ path = ['socksvr', 'socket-name']
+ self.add_config_item(self._nodeconfig, socket, path)
def add_api_segment_gid(self, value='vpp'):
"""Add API-SEGMENT gid configuration.