Skip to content

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

Closed
MatzeB wants to merge 2 commits into
python:mainfrom
MatzeB:fix-issue-36017
Closed

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

Conversation

@MatzeB
Copy link
Copy Markdown
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
Copy Markdown
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
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 10, 2026
@bedevere-app bedevere-app Bot mentioned this pull request May 25, 2026
@serhiy-storchaka
Copy link
Copy Markdown
Member

#150380 uses random names and ids in test_pwd and test_grp and adds more tests.

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 stale Stale PR or inactive for long period of time. tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants