tests: handle TypeErrors in calls to VppDiedError 75/20375/3
authorPaul Vinciguerra <pvinci@vinciconsulting.com>
Thu, 27 Jun 2019 00:45:08 +0000 (20:45 -0400)
committerNeale Ranns <nranns@cisco.com>
Fri, 28 Jun 2019 11:59:04 +0000 (11:59 +0000)
Type: test

Change-Id: I869768ed25efa3350f025fba329466db69805803
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
test/framework.py

index 79dfe1a..aedfbdf 100644 (file)
@@ -84,7 +84,7 @@ class VppDiedError(Exception):
 
         try:
             self.signal_name = VppDiedError.signals_by_value[-rv]
-        except KeyError:
+        except (KeyError, TypeError):
             pass
 
         if testcase is None and method_name is None:
@@ -681,10 +681,9 @@ class VppTestCase(unittest.TestCase):
         super(VppTestCase, self).setUp()
         self.reporter.send_keep_alive(self)
         if self.vpp_dead:
-            raise VppDiedError(self.__class__.__name__, self._testMethodName,
-                               "VPP is dead when setting up the test "
-                               "(%s.%s)." % (self.__class__.__name__,
-                                             self._testMethodName))
+
+            raise VppDiedError(rv=None, testcase=self.__class__.__name__,
+                               method_name=self._testMethodName)
         self.sleep(.1, "during setUp")
         self.vpp_stdout_deque.append(
             "--- test setUp() for %s.%s(%s) starts here ---\n" %