94084c
commit 03e6e02e6a216cfb913f49b3be80d5088603864f
94084c
Author: H.J. Lu <hjl.tools@gmail.com>
94084c
Date:   Sun Jan 9 09:06:15 2022 -0800
94084c
94084c
    Disable debuginfod in printer tests [BZ #28757]
94084c
    
94084c
    With gdb-11.1-6.fc35.x86_64, I got
94084c
    
94084c
    FAIL: nptl/test-cond-printers
94084c
    FAIL: nptl/test-condattr-printers
94084c
    FAIL: nptl/test-mutex-printers
94084c
    FAIL: nptl/test-mutexattr-printers
94084c
    FAIL: nptl/test-rwlock-printers
94084c
    FAIL: nptl/test-rwlockattr-printers
94084c
    
94084c
    $ cat nptl/test-condattr-printers.out
94084c
    Error: Response does not match the expected pattern.
94084c
    Command: start
94084c
    Expected pattern: main
94084c
    Response:  Temporary breakpoint 1 at 0x11d5: file test-condattr-printers.c, line 43.
94084c
    Starting program: /export/build/gnu/tools-build/glibc-cet-gitlab/build-x86_64-linux/nptl/test-condattr-printers
94084c
    
94084c
    This GDB supports auto-downloading debuginfo from the following URLs:
94084c
    https://debuginfod.fedoraproject.org/
94084c
    Enable debuginfod for this session? (y or [n])
94084c
    
94084c
    Disable debuginfod to avoid GDB messages.  This fixes BZ #28757.
94084c
    
94084c
    Reviewed-by: Florian Weimer <fweimer@redhat.com>
94084c
    (cherry picked from commit 7de501f9418bf099e7104b63b0e4423257981b14)
94084c
94084c
diff --git a/scripts/test_printers_common.py b/scripts/test_printers_common.py
94084c
index 34a3df6e6bd8b363..53b6d30d40ce2622 100644
94084c
--- a/scripts/test_printers_common.py
94084c
+++ b/scripts/test_printers_common.py
94084c
@@ -161,6 +161,17 @@ def init_test(test_bin, printer_files, printer_names):
94084c
             printer files.
94084c
     """
94084c
 
94084c
+    # Disable debuginfod to avoid GDB messages like:
94084c
+    #
94084c
+    # This GDB supports auto-downloading debuginfo from the following URLs:
94084c
+    # https://debuginfod.fedoraproject.org/
94084c
+    # Enable debuginfod for this session? (y or [n])
94084c
+    #
94084c
+    try:
94084c
+        test('set debuginfod enabled off')
94084c
+    except Exception:
94084c
+        pass
94084c
+
94084c
     # Load all the pretty printer files.  We're assuming these are safe.
94084c
     for printer_file in printer_files:
94084c
         test('source {0}'.format(printer_file))