+ elif not child.is_alive():
+ fail = True
+ global_logger.critical("Child python process unexpectedly died "
+ "(last test running was `%s' in `%s')!" %
+ (last_test, last_test_temp_dir))
+ elif last_test_temp_dir and last_test_vpp_binary:
+ core_path = "%s/core" % last_test_temp_dir
+ if os.path.isfile(core_path):
+ if core_detected_at is None:
+ core_detected_at = time.time()
+ elif core_detected_at + core_timeout < time.time():
+ if not os.path.isfile(
+ "%s/_core_handled" % last_test_temp_dir):
+ global_logger.critical(
+ "Child python process unresponsive and core-file "
+ "exists in test temporary directory!")
+ fail = True
+
+ if fail:
+ failed_dir = os.getenv('VPP_TEST_FAILED_DIR')
+ lttd = last_test_temp_dir.split("/")[-1]
+ link_path = '%s%s-FAILED' % (failed_dir, lttd)
+ global_logger.error("Creating a link to the failed " +
+ "test: %s -> %s" % (link_path, lttd))
+ try:
+ os.symlink(last_test_temp_dir, link_path)
+ except Exception:
+ pass
+ 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)