aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-03-17 17:34:46 -0700
committerOle Trøan <otroan@employees.org>2019-05-15 06:56:53 +0000
commit19542299d3f4095acda802b73b8a71a2f208cdf2 (patch)
tree404be7d2ac46252ad41e944813d82c485f591e65 /test
parent93248789fb892c3a0f37ec790293344efd860081 (diff)
vpp_papi: remove dependency on environment var. VPP_API_DIR.
Change-Id: I9e3af8674e8aae27079fd03f6286f165d777814f Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test')
-rw-r--r--test/vpp_papi_provider.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index ded73189e00..291a904dd6f 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -10,7 +10,7 @@ import time
from collections import deque
from six import moves, iteritems
-from vpp_papi import VPP, mac_pton
+from vpp_papi import VPPApiClient, mac_pton
from hook import Hook
from vpp_ip_route import MPLS_IETF_MAX_LABEL, MPLS_LABEL_INVALID
@@ -191,11 +191,9 @@ class VppPapiProvider(object):
self._expect_api_retval = self._zero
self._expect_stack = []
- install_dir = os.getenv('VPP_INSTALL_PATH')
-
- # Vapi requires 'VPP_API_DIR', not set when run from Makefile.
- if 'VPP_API_DIR' not in os.environ:
- os.environ['VPP_API_DIR'] = os.getenv('VPP_INSTALL_PATH')
+ # install_dir is a class attribute. We need to set it before
+ # calling the constructor.
+ VPPApiClient.apidir = os.getenv('VPP_INSTALL_PATH')
use_socket = False
try:
@@ -203,10 +201,11 @@ class VppPapiProvider(object):
use_socket = True
except KeyError:
pass
- self.vpp = VPP(logger=test_class.logger,
- read_timeout=read_timeout,
- use_socket=use_socket,
- server_address=test_class.api_sock)
+
+ self.vpp = VPPApiClient(logger=test_class.logger,
+ read_timeout=read_timeout,
+ use_socket=use_socket,
+ server_address=test_class.api_sock)
self._events = deque()
def __enter__(self):