aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-02 21:42:28 -0500
committerNeale Ranns <nranns@cisco.com>2019-12-04 23:17:37 +0000
commit1043fd38d83434d6c4e002c5354a30027988fbfa (patch)
tree9c2b2839a63f59b4bc25c7b48268444a19a55848 /test
parent207083f59524a8523e7c4ab4eeff3cbc7b21c6a0 (diff)
tests: fix exception handling around vapi.connect()/.disconnect()
vapi.connect() only raises subclasses of vpp_papi.VPPIOError. vapi.disconnect() doesn't raise any exceptions, removed uneeded try block. Type: test Change-Id: Ide6e6db298b205f14382065862e358757619a5ba Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test')
-rw-r--r--test/framework.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/framework.py b/test/framework.py
index 24ee8692976..affd4481912 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -28,6 +28,7 @@ from vpp_sub_interface import VppSubInterface
from vpp_lo_interface import VppLoInterface
from vpp_bvi_interface import VppBviInterface
from vpp_papi_provider import VppPapiProvider
+import vpp_papi
from vpp_papi.vpp_stats import VPPStats
from vpp_papi.vpp_transport_shmem import VppTransportShmemIOError
from log import RED, GREEN, YELLOW, double_line_delim, single_line_delim, \
@@ -571,11 +572,10 @@ class VppTestCase(unittest.TestCase):
raise
try:
cls.vapi.connect()
- except Exception:
- try:
- cls.vapi.disconnect()
- except Exception:
- pass
+ except vpp_papi.VPPIOError as e:
+ cls.logger.debug("Exception connecting to vapi: %s" % e)
+ cls.vapi.disconnect()
+
if cls.debug_gdbserver:
print(colorize("You're running VPP inside gdbserver but "
"VPP-API connection failed, did you forget "