Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Port AD id mapping tests to the new framework #7172

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/tests/multihost/ad/test_idmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Testidmap(object):
2. Create a non-POSIX user and a non-POSIX group
3. Create a user and a group with posix attributes
"""
@pytest.mark.converted('test_identity.py', 'test_identity__lookup_idmapping_of_posix_and_non_posix_user_and_group')
@staticmethod
def test_001_idmap_disable(multihost):
"""
Expand Down
51 changes: 50 additions & 1 deletion src/tests/system/tests/test_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import pytest
from sssd_test_framework.roles.client import Client
from sssd_test_framework.roles.generic import GenericProvider
from sssd_test_framework.roles.generic import GenericProvider, GenericADProvider
from sssd_test_framework.topology import KnownTopologyGroup


Expand Down Expand Up @@ -496,3 +496,52 @@ def test_identity__lookup_users_fully_qualified_name_and_case_insensitive(client
result = client.tools.id(name)
assert result is not None, f"User {name} was not found using id"
assert result.memberof([103, 1003]), f"User {name} is member of wrong groups"


@pytest.mark.importance("critical")
@pytest.mark.authentication
@pytest.mark.topology(KnownTopologyGroup.AnyAD)
def test_identity__lookup_idmapping_of_posix_and_non_posix_user_and_group(client: Client, provider: GenericADProvider):
"""
:title: Check ID mapping of POSIX and non POSIX users in AD type directories when ldap_id_mapping is false
:setup:
jakub-vavra-cz marked this conversation as resolved.
Show resolved Hide resolved
1. Create user with POSIX attriubtes
2. Create group with POSIX attributes
3. Create user with no POSIX attributes
4. Create group with no POSIX attributes
5. Configure SSSD with "ldap_id_mapping" = false
6. Start SSSD
:steps:
1. Query POSIX group information
2. Query POSIX user information
3. Query Non-POSIX group information
4. Query Non-POSIX user information
:expectedresults:
1. POSIX group information should be returned and
gid matches the one supplied in creation
2. POSIX user information should be returned and
uid matches the one supplied in creation
3. Non-POSIX group information should not be returned
4. Non-POSIX user information should not be returned
:customerscenario: False
"""

u1 = provider.user("posix_user").add(uid=10001, gid=20001, password="Secret123",
gecos='User for tests',
shell='/bin/bash')
provider.group("posix_group").add(gid=20001).add_member(u1)

u2 = provider.user("nonposix_user").add(password="Secret123")
provider.group("nonposix_group").add().add_member(u2)

client.sssd.domain["ldap_id_mapping"] = "false"
client.sssd.start()

assert client.tools.getent.group("posix_group") is not None, 'posix-group is not returned by sssd'
assert client.tools.id("posix_user").group.id == 20001, 'gid returned not matched the one provided'

assert client.tools.getent.passwd("posix_user") is not None, 'posix-user is not returned by sssd'
assert client.tools.id("posix_user").user.id == 10001, 'uid returned not matched the one provided'

assert client.tools.getent.group("nonposix_group") is None, 'non-posix group is returned by sssd, it should not be'
assert client.tools.getent.passwd("nonposix_user") is None, 'non-posix user is returned by sssd, it should not be'
Loading