summaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index 454f3edce3f..261a0f4aa4b 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -1,7 +1,19 @@
-import vpp_papi
+import os
from logging import error
from hook import Hook
+do_import = True
+try:
+ no_vpp_papi = os.getenv("NO_VPP_PAPI")
+ if no_vpp_papi == "1":
+ do_import = False
+except:
+ pass
+
+if do_import:
+ import vpp_papi
+
+
# from vnet/vnet/mpls/mpls_types.h
MPLS_IETF_MAX_LABEL = 0xfffff
MPLS_LABEL_INVALID = MPLS_IETF_MAX_LABEL + 1
@@ -16,7 +28,7 @@ class VppPapiProvider(object):
"""
def __init__(self, name, shm_prefix):
- self.hook = Hook()
+ self.hook = Hook("vpp-papi-provider")
self.name = name
self.shm_prefix = shm_prefix
@@ -130,7 +142,6 @@ class VppPapiProvider(object):
default_router, max_interval, min_interval,
lifetime, initial_count, initial_interval, async))
-
def vxlan_add_del_tunnel(
self,
src_addr,
@@ -177,7 +188,7 @@ class VppPapiProvider(object):
:param rx_sw_if_index: Software interface index of Rx interface.
:param tx_sw_if_index: Software interface index of Tx interface.
:param enable: Create cross-connect if equal to 1, delete cross-connect
- if equal to 0.
+ if equal to 0.
:type rx_sw_if_index: str or int
:type rx_sw_if_index: str or int
:type enable: int