]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: If a core file is generated fail the test
authorDonald Sharp <sharpd@nvidia.com>
Thu, 29 Jun 2023 19:43:47 +0000 (15:43 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 10 Jul 2023 13:06:40 +0000 (09:06 -0400)
If a .dmp file is found in the test log directories
fail the test.

Issue: #13788
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests/topotests/conftest.py

index 27a6909a46a5a43da7c8c6927e98710f5e97384d..f829ed2d12aee3c506a2e95f8945789109f8b192 100755 (executable)
@@ -297,12 +297,25 @@ 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 = []
+
+    if tgen is not None:
+        logdir = tgen.logdir
+        cores = glob.glob(os.path.join(logdir, "*/*.dmp"))
+
+    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
     latest = []
     existing = []
-
     if tgen is not None:
         logdir = tgen.logdir
         if hasattr(tgen, "backtraces_existing_files"):
@@ -354,6 +367,7 @@ def module_check_memtest(request):
         if get_topogen() is not None:
             check_for_memleaks()
     check_for_backtraces()
+    check_for_core_dumps()
 
 
 #