aboutsummaryrefslogtreecommitdiffstats
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)
e Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.openvpp.vppjapi; public final class vppInterfaceDetails { public final int ifIndex; public final String interfaceName; public final int supIfIndex; // FIXME: this is dangerous public final byte[] physAddr; public final byte adminUp; public final byte linkUp; public final byte linkDuplex; public final byte linkSpeed; public final int subId; public final byte subDot1ad; public final byte subNumberOfTags; public final int subOuterVlanId; public final int subInnerVlanId; public final byte subExactMatch; public final byte subDefault; public final byte subOuterVlanIdAny; public final byte subInnerVlanIdAny; public final int vtrOp; public final int vtrPushDot1q; public final int vtrTag1; public final int vtrTag2; public final int linkMtu; public vppInterfaceDetails(int ifIndex, String interfaceName, int supIfIndex, byte[] physAddr, byte adminUp, byte linkUp, byte linkDuplex, byte linkSpeed, int subId, byte subDot1ad, byte subNumberOfTags, int subOuterVlanId, int subInnerVlanId, byte subExactMatch, byte subDefault, byte subOuterVlanIdAny, byte subInnerVlanIdAny, int vtrOp, int vtrPushDot1q, int vtrTag1, int vtrTag2, int linkMtu) { this.ifIndex = ifIndex; this.interfaceName = interfaceName; this.supIfIndex = supIfIndex; this.physAddr = physAddr; this.adminUp = adminUp; this.linkUp = linkUp; this.linkDuplex = linkDuplex; this.linkSpeed = linkSpeed; this.subId = subId; this.subDot1ad = subDot1ad; this.subNumberOfTags = subNumberOfTags; this.subOuterVlanId = subOuterVlanId; this.subInnerVlanId = subInnerVlanId; this.subExactMatch = subExactMatch; this.subDefault = subDefault; this.subOuterVlanIdAny = subOuterVlanIdAny; this.subInnerVlanIdAny = subInnerVlanIdAny; this.vtrOp = vtrOp; this.vtrPushDot1q = vtrPushDot1q; this.vtrTag1 = vtrTag1; this.vtrTag2 = vtrTag2; this.linkMtu = linkMtu; } }