Skip to content

bpo-36017: Improve test_grp.test_errors for (big) LDAP directories#19033

Open
MatzeB wants to merge 2 commits intopython:mainfrom
MatzeB:fix-issue-36017
Open

bpo-36017: Improve test_grp.test_errors for (big) LDAP directories#19033
MatzeB wants to merge 2 commits intopython:mainfrom
MatzeB:fix-issue-36017

Conversation

@MatzeB
Copy link
Contributor

@MatzeB MatzeB commented Mar 16, 2020

There is no guarantee that the group database returned on a unix system is
complete. It is typically cut short when LDAP directories are configured
for bigger network setups. This makes it tricky to find a nonexistent
group id by looking at the group database.

This changes the test to pick a nonexistent gid within gid 1-99 which
are typically static assigned and not managed by network directory
systems.

Also pick a group name that is extremely likely to not exist instead of
modifying the name of the first group in the database.

https://bugs.python.org/issue36017

There is no guarantee that the group database returned on unix system is
complete. It is typically cut short when LDAP directories are configured
for bigger network setups. This makes it tricky to find a nonexistent
group id by looking at the group database.

This changes the test to pick a nonexistent gid within gid 1-99 which
are typically static assigned and not managed by network directory
systems.

Also pick a group name that is extremely likely to not exist instead of
modifying the name of the first group in the database.

skip news
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not be simpler to generate a random name? If by accident it matches existing name, we can repeat in loop.

@encukou encukou added the pending The issue will be closed if no feedback is provided label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review pending The issue will be closed if no feedback is provided skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants