-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-38692: Skip test_posix.test_pidfd_open() on EPERM #17290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Concrete example such whitelist sandbox: systemd-nspawn doesn't allow pidfd_open syscall yet. This issue affects mock tool used to build packages on Fedora. The issue was already discussed at: Honestly, I'm not interested to discuss if a sandbox is "broken" or not. Such sandboxes exist, it's just a fact. IMHO it's not a big deal to add 2 lines to test_posix just to not be annoyed by the sandbox policy. |
This indeed workarounds the issue we have in Fedora. I will also try get pidfd_open whitelisted in systemd-nspawn, but that can take a while. In the meantime, this is IMHO the best we can get. |
@benjaminp @pablogsal @nanjekyejoannah : does it look like reasonable to you to skip the test if Python is running in a sandbox? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjaminp @pablogsal @nanjekyejoannah : does it look like reasonable to you to skip the test if Python is running in a sandbox?
This sounds very reasonable to me :)
Misc/NEWS.d/next/Tests/2019-11-20-15-42-06.bpo-38692.aqAvyF.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Tests/2019-11-20-15-42-06.bpo-38692.aqAvyF.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Tests/2019-11-20-15-42-06.bpo-38692.aqAvyF.rst
Outdated
Show resolved
Hide resolved
I got another test failure during our weekly python 3.9 update on Arch Linux:
Could that test be skipped in case of EPERM from the system call |
This PR fix it, no? You get a EPERM error (errno 1).
My PR skip pidfd_open() test if the syscall fails with EPERM. Python doesn't expose pidfd_send_signal() yet, so I don't understand your question. |
Skip the test_posix.test_pidfd_open() test if os.pidfd_open() fails with a PermissionError. This situation can happen in a Linux sandbox using a syscall whitelist which doesn't allow the pidfd_open() syscall yet.
Would yo mind to describe your issue in https://bugs.python.org/issue38692 ? What is your kernel version? Are you running the Python test suite in any sandbox? If you are not using a sandbox, I'm surprised that you got a EPERM error. |
Oh. Is it a similar issue than https://bugs.python.org/issue38692#msg356235 where you ran the Python test suite using systemd-nspawn sandbox? |
Thanks for your review @pablogsal. |
The previous workaround is merged upstream [1] [1] python/cpython#17290
Skip the test_posix.test_pidfd_open() test if os.pidfd_open() fails with a PermissionError. This situation can happen in a Linux sandbox using a syscall whitelist which doesn't allow the pidfd_open() syscall yet (like systemd-nspawn).
Skip the test_posix.test_pidfd_open() test if os.pidfd_open() fails with a PermissionError. This situation can happen in a Linux sandbox using a syscall whitelist which doesn't allow the pidfd_open() syscall yet (like systemd-nspawn).
The previous workaround is merged upstream [1] [1] python/cpython#17290
The previous workaround is merged upstream [1] [1] python/cpython#17290
Skip test_posix.test_pidfd_open() test if os.pidfd_open() fails with
a PermissionError. It can happen in a Linux sandbox using a whitelist
of syscalls which doesn't allow pidfd_open syscall yet.
https://bugs.python.org/issue38692