msg113705 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-08-12 20:47 |
I get the following test_posix failures when run as root (Mandriva Linux): ====================================================================== ERROR: test_initgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/py3k/__svn__/Lib/test/test_posix.py", line 418, in test_initgroups g = g2 + 1 UnboundLocalError: local variable 'g2' referenced before assignment ====================================================================== FAIL: test_setgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/py3k/__svn__/Lib/test/test_posix.py", line 428, in test_setgroups self.assertListEqual(groups, posix.getgroups()) AssertionError: First sequence is not a list: range(0, 16) Under 2.6, there's another failure: ====================================================================== ERROR: test_setgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/antoine/cpython/26/Lib/test/test_posix.py", line 356, in test_setgroups self.assertListEqual(groups, posix.getgroups()) AttributeError: 'PosixGroupsTester' object has no attribute 'assertListEqual' |
|
|
msg113744 - (view) |
Author: Ronald Oussoren (ronaldoussoren) *  |
Date: 2010-08-13 05:55 |
I won't have time to look at this until sunday. Alexander Belopolsky wrote these patch tests. Alexanders: do you have time to look into this? |
|
|
msg113745 - (view) |
Author: George Yoshida (quiver)  |
Date: 2010-08-13 06:42 |
> Under 2.6, there's another failure: As for 2.6/2.7 issues, changing 'assertListEqual' to 'assertEqual' should suffice. |
|
|
msg113774 - (view) |
Author: George Yoshida (quiver)  |
Date: 2010-08-13 13:50 |
test_initgroups fails only if the test is invoked by a root and the user is assigned to only one group. If I understand test_initgroups correctly, it (1)looks for an unused gid, (2)inits process user's group with that gid, (3)checks if initgroups worked. Attached patch simplifies step #1 "max(self.saved_groups) + 1" is used. test_initgroups passed when root's groups are as follows:: * [0] * [0, 3, 5] * [0, 1, 2] |
|
|
msg113778 - (view) |
Author: George Yoshida (quiver)  |
Date: 2010-08-13 14:25 |
> FAIL: test_setgroups (test.test_posix.PosixGroupsTester) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/home/antoine/py3k/__svn__/Lib/test/test_posix.py", line 428, in test_setgroups > self.assertListEqual(groups, posix.getgroups()) > AssertionError: First sequence is not a list: range(0, 16) This one is just a list/range data type issue. patch for test_initgroups/test_setgroups against py3k attached |
|
|
msg113782 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-08-13 15:05 |
George's patches work for me (thank you!). |
|
|
msg115591 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-09-04 17:34 |
I've committed modified patches for 3.x, 3.1 and 2.7. Thanks again George. |
|
|