diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py index 27a6909a46a5..1377f4764651 100755 --- a/tests/topotests/conftest.py +++ b/tests/topotests/conftest.py @@ -297,6 +297,26 @@ def check_for_memleaks(): pytest.fail("memleaks found for daemons: " + " ".join(daemons)) +def check_for_core_dumps(): + dumps = [] + tgen = get_topogen() # pylint: disable=redefined-outer-name + latest = [] + existing = [] + + if tgen is not None: + logdir = tgen.logdir + if hasattr(tgen, "cores_existing_files"): + existing = tgen.cores_existing_files + cores = glob.glob(os.path.join(logdir, "*/*.dmp")) + + if tgen is not None: + tgen.cores_existing_files = existing + + if cores: + logger.error("Cores found:\n\t%s", "\n\t".join(cores)) + pytest.fail("Core files found") + + def check_for_backtraces(): backtraces = [] tgen = get_topogen() # pylint: disable=redefined-outer-name @@ -354,6 +374,7 @@ def module_check_memtest(request): if get_topogen() is not None: check_for_memleaks() check_for_backtraces() + check_for_core_dumps() #