mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add test of calling salt.utils.user.get_group_dict
for the user having improper duplicate group
This commit is contained in:
parent
8e89a094f1
commit
ba82644375
1 changed files with 24 additions and 0 deletions
24
tests/pytests/functional/utils/user/test_get_group_dict.py
Normal file
24
tests/pytests/functional/utils/user/test_get_group_dict.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import logging
|
||||
|
||||
import pytest
|
||||
|
||||
import salt.utils.platform
|
||||
import salt.utils.user
|
||||
from tests.support.mock import patch
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.skip_on_windows,
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.skip_on_platforms(
|
||||
darwin=True,
|
||||
freebsd=True,
|
||||
reason="This test should not run on FreeBSD and Mac due to lack of duplicate GID support",
|
||||
)
|
||||
def test_get_group_dict_with_improper_duplicate_root_group():
|
||||
with patch("salt.utils.user.get_group_list", return_value=["+", "root"]):
|
||||
group_list = salt.utils.user.get_group_dict("root")
|
||||
assert group_list == {"root": 0}
|
Loading…
Add table
Reference in a new issue