summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-06-17 08:57:20 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-06-17 08:57:20 (GMT)
commitbe4e4b5691492008dae31c82dc6ac2aba230b4e5 (patch)
treef5efb65a18cc221de9bc1dd6e38fda7cf1234a25
parent50f147a9be10ee379c4c7bacb81df5e4edf24044 (diff)
downloadcpython-be4e4b5691492008dae31c82dc6ac2aba230b4e5.zip
cpython-be4e4b5691492008dae31c82dc6ac2aba230b4e5.tar.gz
cpython-be4e4b5691492008dae31c82dc6ac2aba230b4e5.tar.bz2
Issue #15043: skip test_gdb if the custom hooks can't be loaded
-rw-r--r--Lib/test/test_gdb.py9
-rw-r--r--Misc/NEWS3
2 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index aea7c0c..a02f5c7 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -32,6 +32,15 @@ gdbpy_version, _ = p.communicate()
if gdbpy_version == b'':
raise unittest.SkipTest("gdb not built with embedded python support")
+# Verify that "gdb" can load our custom hooks
+p = subprocess.Popen(["gdb", "--batch", cmd,
+ "--args", sys.executable],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+__, gdbpy_errors = p.communicate()
+if b"auto-loading has been declined" in gdbpy_errors:
+ msg = "gdb security settings prevent use of custom hooks: %s"
+ raise unittest.SkipTest(msg % gdbpy_errors)
+
def gdb_has_frame_select():
# Does this build of gdb have gdb.Frame.select ?
cmd = "--eval-command=python print(dir(gdb.Frame))"
diff --git a/Misc/NEWS b/Misc/NEWS
index f9abb66..53b5966 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -301,6 +301,9 @@ Extension Modules
Tests
-----
+- Issue #15043: test_gdb is now skipped entirely if gdb security settings
+ block loading of the gdb hooks
+
- Issue #14026: In test_cmd_line_script, check that sys.argv is populated
correctly for the various invocation approaches (Patch by Jason Yeo)