diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2017-09-30 22:04:21 -0400 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-10-11 08:08:55 +0000 |
commit | 86c0446e28c4bf9e2dda7e9324de91f950720bcf (patch) | |
tree | 7e0660181c5e274fcae6f1e3f83ccd2c2f8a26ac | |
parent | 4ca58265a00c106c8dc3e12229c3bd23876a7a58 (diff) |
make test: Copy api_post_mortem.$$ file tmp test dir for archiving. (VPP-1011)
Change-Id: I4baf89ef383dbc2f309081a6b56b13ebcb8fc2df
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit e2efd12b8418558cd8e701368287860409e8d265)
-rw-r--r-- | test/framework.py | 10 | ||||
-rw-r--r-- | test/run_tests.py | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/test/framework.py b/test/framework.py index 869a3402..600a0e54 100644 --- a/test/framework.py +++ b/test/framework.py @@ -126,7 +126,7 @@ class KeepAliveReporter(object): if not desc: desc = str(test) - self.pipe.send((desc, test.vpp_bin, test.tempdir)) + self.pipe.send((desc, test.vpp_bin, test.tempdir, test.vpp.pid)) class VppTestCase(unittest.TestCase): @@ -205,10 +205,10 @@ class VppTestCase(unittest.TestCase): except: pass if coredump_size is None: - coredump_size = "full-coredump" + coredump_size = "coredump-size unlimited" cls.vpp_cmdline = [cls.vpp_bin, "unix", - "{", "nodaemon", debug_cli, coredump_size, "}", - "api-trace", "{", "on", "}", + "{", "nodaemon", debug_cli, "full-coredump", + coredump_size, "}", "api-trace", "{", "on", "}", "api-segment", "{", "prefix", cls.shm_prefix, "}", "plugins", "{", "plugin", "dpdk_plugin.so", "{", "disable", "}", "}"] @@ -295,11 +295,11 @@ class VppTestCase(unittest.TestCase): cls.registry = VppObjectRegistry() cls.vpp_startup_failed = False cls.reporter = KeepAliveReporter() - cls.reporter.send_keep_alive(cls) # need to catch exceptions here because if we raise, then the cleanup # doesn't get called and we might end with a zombie vpp try: cls.run_vpp() + cls.reporter.send_keep_alive(cls) cls.vpp_stdout_deque = deque() cls.vpp_stderr_deque = deque() cls.pump_thread_stop_flag = Event() diff --git a/test/run_tests.py b/test/run_tests.py index 999252d1..b07a923a 100644 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import sys +import shutil import os import select import unittest @@ -50,8 +51,8 @@ def run_forked(suite): result = result_parent_end.recv() elif keep_alive_parent_end.fileno() in readable: while keep_alive_parent_end.poll(): - last_test, last_test_vpp_binary, last_test_temp_dir =\ - keep_alive_parent_end.recv() + last_test, last_test_vpp_binary,\ + last_test_temp_dir, vpp_pid = keep_alive_parent_end.recv() else: global_logger.critical("Timeout while waiting for child test " "runner process (last test running was " @@ -63,6 +64,11 @@ def run_forked(suite): global_logger.error("Creating a link to the failed " + "test: %s -> %s" % (link_path, lttd)) os.symlink(last_test_temp_dir, link_path) + api_post_mortem_path = "/tmp/api_post_mortem.%d" % vpp_pid + if os.path.isfile(api_post_mortem_path): + global_logger.error("Copying api_post_mortem.%d to %s" % + (vpp_pid, last_test_temp_dir)) + shutil.copy2(api_post_mortem_path, last_test_temp_dir) if last_test_temp_dir and last_test_vpp_binary: core_path = "%s/core" % last_test_temp_dir if os.path.isfile(core_path): |