summaryrefslogtreecommitdiffstats
path: root/vpp-api/python/tests/test_papi.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2016-09-12 22:00:32 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-23 13:18:46 +0000
commit57c3d66c55580f2ced6993ada22274941237fcd5 (patch)
tree55a856b3ddcc4f9e5284c7bc42b0126616825366 /vpp-api/python/tests/test_papi.py
parent5fef9e523df67a96f3b9aedcec373e65f590b001 (diff)
Python API: Preparation for RPM/DEB packaging.
Recheck. Repackage the Python API binding to include all necessary modules in a single Python package. Change-Id: I5e35141d413bfb1aad650217e1ca07d85646c349 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'vpp-api/python/tests/test_papi.py')
-rwxr-xr-xvpp-api/python/tests/test_papi.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/vpp-api/python/tests/test_papi.py b/vpp-api/python/tests/test_papi.py
index ab90eeaa45c..8cbbfc59e03 100755
--- a/vpp-api/python/tests/test_papi.py
+++ b/vpp-api/python/tests/test_papi.py
@@ -1,13 +1,10 @@
-#!/usr/bin/env python
-
from __future__ import print_function
-import unittest, sys, time, threading, struct, logging
-import test_base
+import unittest, sys, time, threading, struct, logging, os
import vpp_papi
from ipaddress import *
-
+scriptdir = os.path.dirname(os.path.realpath(__file__))
papi_event = threading.Event()
-print(vpp_papi.VL_API_SW_INTERFACE_SET_FLAGS)
+print(vpp_papi.vpe.VL_API_SW_INTERFACE_SET_FLAGS)
def papi_event_handler(result):
if result.vl_msg_id == vpp_papi.vpe.VL_API_SW_INTERFACE_SET_FLAGS:
return
@@ -27,7 +24,7 @@ class TestPAPI(unittest.TestCase):
def setUpClass(cls):
#
# Start main VPP process
- cls.vpp_bin = glob.glob(test_base.scriptdir+'/../../../build-root/install-vpp*-native/vpp/bin/vpp')[0]
+ cls.vpp_bin = glob.glob(scriptdir+'/../../../build-root/install-vpp*-native/vpp/bin/vpp')[0]
print("VPP BIN:", cls.vpp_bin)
cls.vpp = subprocess.Popen([cls.vpp_bin, "unix", "nodaemon"], stderr=subprocess.PIPE)
print('Started VPP')
@@ -89,7 +86,7 @@ class TestPAPI(unittest.TestCase):
self.assertEqual(t.retval, 0)
ifindex = t.sw_if_index
- addr = str(IPv6Address('1::1').packed)
+ addr = str(IPv6Address(u'1::1').packed)
t = vpp_papi.sw_interface_add_del_address(ifindex, 1, 1, 0, 16, addr)
print(t)
self.assertEqual(t.retval, 0)