Skip to content

Commit

Permalink
bpo-39157: Skip test_pidfd_send_signal if the system does not have en…
Browse files Browse the repository at this point in the history
…ough privileges to use pidfd (GH-17740)
  • Loading branch information
pablogsal authored Dec 29, 2019
1 parent be287c3 commit 8f0703f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/test/test_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,8 @@ def test_pidfd_send_signal(self):
signal.pidfd_send_signal(0, signal.SIGINT)
if cm.exception.errno == errno.ENOSYS:
self.skipTest("kernel does not support pidfds")
elif cm.exception.errno == errno.EPERM:
self.skipTest("Not enough privileges to use pidfs")
self.assertEqual(cm.exception.errno, errno.EBADF)
my_pidfd = os.open(f'/proc/{os.getpid()}', os.O_DIRECTORY)
self.addCleanup(os.close, my_pidfd)
Expand Down

0 comments on commit 8f0703f

Please sign in to comment.