diff options
-rw-r--r-- | test/framework.py | 29 | ||||
-rw-r--r-- | test/test_acl_plugin_macip.py | 5 |
2 files changed, 18 insertions, 16 deletions
diff --git a/test/framework.py b/test/framework.py index efb1e6b04c4..fd91d4c9d5e 100644 --- a/test/framework.py +++ b/test/framework.py @@ -28,6 +28,7 @@ from vpp_lo_interface import VppLoInterface from vpp_bvi_interface import VppBviInterface from vpp_papi_provider import VppPapiProvider 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, \ get_logger, colorize from vpp_object import VppObjectRegistry @@ -616,18 +617,18 @@ class VppTestCase(unittest.TestCase): self.logger.debug("--- tearDown() for %s.%s(%s) called ---" % (self.__class__.__name__, self._testMethodName, self._testMethodDoc)) - if not self.vpp_dead: - self.logger.info( - "--- Logging show commands common to all testcases. ---") - self.logger.debug(self.vapi.cli("show trace max 1000")) - self.logger.info(self.vapi.ppcli("show interface")) - self.logger.info(self.vapi.ppcli("show hardware")) - self.logger.info(self.statistics.set_errors_str()) - self.logger.info(self.vapi.ppcli("show run")) - self.logger.info(self.vapi.ppcli("show log")) - self.logger.info("Logging testcase specific show commands.") - self.show_commands_at_teardown() - self.registry.remove_vpp_config(self.logger) + + try: + if not self.vpp_dead: + self.logger.debug(self.vapi.cli("show trace max 1000")) + self.logger.info(self.vapi.ppcli("show interface")) + self.logger.info(self.vapi.ppcli("show hardware")) + self.logger.info(self.statistics.set_errors_str()) + self.logger.info(self.vapi.ppcli("show run")) + self.logger.info(self.vapi.ppcli("show log")) + self.logger.info("Logging testcase specific show commands.") + self.show_commands_at_teardown() + self.registry.remove_vpp_config(self.logger) # Save/Dump VPP api trace log api_trace = "vpp_api_trace.%s.log" % self._testMethodName tmp_api_trace = "/tmp/%s" % api_trace @@ -638,6 +639,10 @@ class VppTestCase(unittest.TestCase): os.rename(tmp_api_trace, vpp_api_trace_log) self.logger.info(self.vapi.ppcli("api trace custom-dump %s" % vpp_api_trace_log)) + except VppTransportShmemIOError: + self.logger.debug("VppTransportShmemIOError: Vpp dead. " + "Cannot log show commands.") + self.vpp_dead = True else: self.registry.unregister_all(self.logger) diff --git a/test/test_acl_plugin_macip.py b/test/test_acl_plugin_macip.py index fa051093fdf..41735251792 100644 --- a/test/test_acl_plugin_macip.py +++ b/test/test_acl_plugin_macip.py @@ -161,10 +161,8 @@ class MethodHolder(VppTestCase): del self.ACLS[:] def tearDown(self): - """ - Show various debug prints after each test. - """ super(MethodHolder, self).tearDown() + self.delete_acls() def show_commands_at_teardown(self): self.logger.info(self.vapi.ppcli("show interface address")) @@ -179,7 +177,6 @@ class MethodHolder(VppTestCase): # print(self.vapi.ppcli("show hardware")) # print(self.vapi.ppcli("sh acl-plugin macip interface")) # print(self.vapi.ppcli("sh acl-plugin macip acl")) - self.delete_acls() def macip_acl_dump_debug(self): acls = self.vapi.macip_acl_dump() |