-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #62377 groups with duplicate GIDs are not returned by get_group…
…_list
- Loading branch information
1 parent
fc7d0a9
commit eaa004d
Showing
3 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/pytests/functional/utils/user/test_get_group_list.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import logging | ||
|
||
import pytest | ||
import salt.utils.user | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
pytestmark = [ | ||
pytest.mark.destructive_test, | ||
pytest.mark.skip_if_not_root, | ||
pytest.mark.skip_on_windows, | ||
] | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def user(): | ||
with pytest.helpers.create_account(create_group=True) as _account: | ||
yield _account | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def dupegroup(user): | ||
grpid = user.group.info.gid | ||
with pytest.helpers.create_group(name="dupegroup", gid=grpid) as _group: | ||
yield _group | ||
|
||
|
||
def test_get_group_list_with_duplicate_gid_group(user, dupegroup): | ||
group_list = salt.utils.user.get_group_list(user) | ||
assert user.group.info.name in group_list | ||
assert dupegroup.name in group_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters