Skip to content

Commit c3ad11e

Browse files
author
Dan Lavu
committed
adding subid test
1 parent be5df34 commit c3ad11e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/tests/system/tests/test_ipa.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,3 +640,47 @@ def test_ipa__switch_user_with_smartcard_authentication(client: Client, ipa: IPA
640640
assert (
641641
"ipacertuser1" in result.stdout
642642
), f"'ipacertuser1' not found in 'whoami' output! Stdout content: {result.stdout}"
643+
644+
645+
@pytest.mark.importance("high")
646+
@pytest.mark.topology(KnownTopology.IPA)
647+
def test_ipa__subids_configured(client: Client, ipa: IPA):
648+
"""
649+
:title: SSSD can read subid ranges configured in IPA
650+
:setup:
651+
1. Create a user with generated subids and one without
652+
2. Configure and start SSSD with subids
653+
:steps:
654+
1. Lookup the uid start range and range size for all users
655+
2. Lookup the gid start range and range size for all users
656+
:expectedresults:
657+
1. The values from the client matches the server values when the user has subids
658+
2. The values from the client matches the server values when the user has subids
659+
:customerscenario: False
660+
"""
661+
user = ipa.user("user1").add()
662+
ipa.user("user2").add()
663+
ipa_sub = user.subid().generate()
664+
665+
client.sssd.common.subid()
666+
client.sssd.start()
667+
668+
subuid = client.tools.getsubid("user1")
669+
assert subuid is not None, "Found no subuids for User1!"
670+
assert (
671+
ipa_sub.uid_start == subuid.range_start
672+
), f"User1 subordinate UID range start value {subuid.range_start} does not match: {ipa_sub.uid_start}!"
673+
assert (
674+
ipa_sub.uid_size == subuid.range_size
675+
), f"User1 subordinate UID range size value {subuid.range_size} does not match: {ipa_sub.uid_size}!"
676+
assert client.tools.getsubid("user2") is None, "User2 has unexpected subuids configured!"
677+
678+
subgid = client.tools.getsubid("user1", group=True)
679+
assert subgid is not None, "Found no subgids for User1"
680+
assert (
681+
ipa_sub.gid_start == subgid.range_start
682+
), f"User1 subordinate GID range start value {subgid.range_start} does not match: {ipa_sub.gid_start}!"
683+
assert (
684+
ipa_sub.gid_size == subgid.range_size
685+
), f"User1 subordinate GID range size value {subgid.range_size} does not match: {ipa_sub.gid_size}!"
686+
assert client.tools.getsubid("user2", group=True) is None, "User2 has unexpected subgids configured!"

0 commit comments

Comments
 (0)