Skip to content
Open
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
56 changes: 56 additions & 0 deletions src/tests/system/tests/test_ipa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""
IPA Tests
"""

from __future__ import annotations


import pytest
from sssd_test_framework.roles.client import Client
from sssd_test_framework.roles.ipa import IPA
from sssd_test_framework.topology import KnownTopology


@pytest.mark.importance("high")
@pytest.mark.topology(KnownTopology.IPA)
def test_ipa__subids_configured(client: Client, ipa: IPA):
"""
:title: SSSD can read subid ranges configured in IPA
:setup:
1. Create a user with generated subids and one without
2. Configure and start SSSD with subids
:steps:
1. Lookup the uid start range and range size for all users
2. Lookup the gid start range and range size for all users
:expectedresults:
1. The values from the client matches the server values when the user has subids
2. The values from the client matches the server values when the user has subids
:customerscenario: False
:requirement: subids
"""
user = ipa.user("user1").add()
ipa.user("user2").add()
ipa_sub = user.subid().generate()

client.sssd.common.subid()
client.sssd.start()

subuid = client.tools.getsubid("user1")
assert subuid is not None, "Found no subuids for User1!"
assert (
ipa_sub.uid_start == subuid.range_start
), f"User1 subordinate UID range start value {subuid.range_start} does not match: {ipa_sub.uid_start}!"
assert (
ipa_sub.uid_size == subuid.range_size
), f"User1 subordinate UID range size value {subuid.range_size} does not match: {ipa_sub.uid_size}!"
assert client.tools.getsubid("user2") is None, "User2 has unexpected subuids configured!"

subgid = client.tools.getsubid("user1", group=True)
assert subgid is not None, "Found no subgids for User1"
assert (
ipa_sub.gid_start == subgid.range_start
), f"User1 subordinate GID range start value {subgid.range_start} does not match: {ipa_sub.gid_start}!"
assert (
ipa_sub.gid_size == subgid.range_size
), f"User1 subordinate GID range size value {subgid.range_size} does not match: {ipa_sub.gid_size}!"
assert client.tools.getsubid("user2", group=True) is None, "User2 has unexpected subgids configured!"
Loading