[New-bugs-announce] [issue39855] test.test_subprocess.POSIXProcessTestCase.test_user fails in the limited build environment

Matej Cepl report at bugs.python.org
Wed Mar 4 14:21:51 EST 2020


New submission from Matej Cepl <mcepl at cepl.eu>:

When testing Python from Python-3.9.0a3.tar.xz two test cases file in the limited build environment for openSUSE. We have very limited number of users there:

stitny:/home/abuild/rpmbuild/BUILD/Python-3.9.0a3 # cat /etc/passwd 
root:x:0:0:root:/root:/bin/bash
abuild:x:399:399:Autobuild:/home/abuild:/bin/bash
stitny:/home/abuild/rpmbuild/BUILD/Python-3.9.0a3 #

So, tests which expect existence of the user 'nobody' fail:

[  747s] ======================================================================
[  747s] ERROR: test_user (test.test_subprocess.POSIXProcessTestCase) (user='nobody', close_fds=False)
[  747s] ----------------------------------------------------------------------
[  747s] Traceback (most recent call last):
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/test/test_subprocess.py", line 1805, in test_user
[  747s]     output = subprocess.check_output(
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 419, in check_output
[  747s]     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 510, in run
[  747s]     with Popen(*popenargs, **kwargs) as process:
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 929, in __init__
[  747s]     uid = pwd.getpwnam(user).pw_uid
[  747s] KeyError: "getpwnam(): name not found: 'nobody'"
[  747s] 
[  747s] ======================================================================
[  747s] ERROR: test_user (test.test_subprocess.POSIXProcessTestCase) (user='nobody', close_fds=True)
[  747s] ----------------------------------------------------------------------
[  747s] Traceback (most recent call last):
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/test/test_subprocess.py", line 1805, in test_user
[  747s]     output = subprocess.check_output(
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 419, in check_output
[  747s]     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 510, in run
[  747s]     with Popen(*popenargs, **kwargs) as process:
[  747s]   File "/home/abuild/rpmbuild/BUILD/Python-3.9.0a3/Lib/subprocess.py", line 929, in __init__
[  747s]     uid = pwd.getpwnam(user).pw_uid
[  747s] KeyError: "getpwnam(): name not found: 'nobody'"
[  747s] 
[  747s] ----------------------------------------------------------------------
[  747s]

I am not sure what is the proper solution here. Whether test should be skipped if nobody doesn’t exist, or the test should switch to user 0, or the current user?

----------
components: Tests
messages: 363380
nosy: mcepl, vstinner
priority: normal
severity: normal
status: open
title: test.test_subprocess.POSIXProcessTestCase.test_user fails in the limited build environment
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39855>
_______________________________________


More information about the New-bugs-announce mailing list