diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/vpp_papi_provider.py | 19 |
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): |