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
test_posix.test_getgrouplist fails on some systems - incorrectly comparing getgroups and getgrouplist results #60865
Comments
test_posix.test_getgrouplist is failing for me on my Linux (ubuntu precise) based desktop at work. It looks like posix.getgrouplist() is returning all of the larger GIDs. The lowest one it is reporting for my user is 499 but the more distro specific groups that I am are not included in its 18 element long list it returns so the test fails: test test_posix failed -- Traceback (most recent call last):
File "cpython/default/Lib/test/test_posix.py", line 660, in test_getgrouplist
pwd.getpwuid(os.getuid())[3])))
AssertionError: Items in the first set but not the second:
128
4
104
44
46
20
24
25 strace reveals that the 'id -G' command this test is trying to compare against calls getgroups() while posix.getgrouplist() appears to do something else that does not make that syscall. posix.getgroups() does the same thing as 'id -G', this test for posix.getgrouplist(username, uid) is making an incorrect assertion. |
It seems like getgrouplist returns the information from the system I'm not exactly sure how getgrouplist() can be effectively tested then. |
would the values returned by getgrouplist always be a non empty subset of |
I wouldn't think so. A call to setgroups can add or remove groups for |
Given this is more of a code coverage test than any need to test the |
New changeset ce85fe971e0a by Ross Lagerwall in branch '3.3': New changeset 05a37954a30c by Ross Lagerwall in branch 'default': |
Is that fixed now? I simplified the test to check for a non-empty list being returned. |
Apparently this also needs fixing on 2.7 and 3.2, see e.g. http://buildbot.python.org/all/builders/AMD64%20Mountain%20Lion%20%5BSB%5D%203.2 |
getgrouplist() is new in 3.3. Those failures are from getgroups() failing. I'll open a separate issue for that. |
The getgroups test failure on OS X is likely the known limitation documented in bpo-10433. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: