Skip to content

Commit

Permalink
Tests: Add support for IPA IPA Trust
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-stephenson committed Aug 1, 2024
1 parent e4ae4d6 commit fd8ef2f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/tests/system/mhc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ domains:
krb5_keytab: /enrollment/ipa.test.keytab
ldap_krb5_keytab: /enrollment/ipa.test.keytab

- hostname: master2.ipa2.test
role: ipa
config:
client:
ipa_domain: ipa2.test
krb5_keytab: /enrollment/ipa2.test.keytab
ldap_krb5_keytab: /enrollment/ipa2.test.keytab

- hostname: dc.ad.test
role: ad
os:
Expand Down
61 changes: 59 additions & 2 deletions src/tests/system/tests/test_ipa_trusts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import pytest
from sssd_test_framework.roles.generic import GenericADProvider
from sssd_test_framework.roles.ipa import IPA
from sssd_test_framework.topology import KnownTopologyGroup
from sssd_test_framework.topology import KnownTopologyGroup, KnownTopology


@pytest.mark.importance("low")
@pytest.mark.ticket(jira="RHEL-3925", gh=6942)
@pytest.mark.topology(KnownTopologyGroup.IPATrust)
@pytest.mark.topology(KnownTopologyGroup.IPATrustAD)
def test_ipa_trusts__lookup_group_without_sid(ipa: IPA, trusted: GenericADProvider):
"""
:title: Subdomain stays online if IPA group is missing SID
Expand Down Expand Up @@ -60,3 +60,60 @@ def test_ipa_trusts__lookup_group_without_sid(ipa: IPA, trusted: GenericADProvid
status = ipa.sssctl.domain_status(trusted.domain, online=True)
assert "online status: offline" not in status.stdout.lower(), "AD domain went offline!"
assert "online status: online" in status.stdout.lower(), "AD domain was not online!"

@pytest.mark.importance("low")
@pytest.mark.topology(KnownTopologyGroup.AnyIPATrust)
def test_ipa_trusts__ipa_server_trusted_user_lookup(ipa: IPA, trusted: IPA):
"""
:title: Basic IPA-IPA Trust lookup on IPA server
:setup:
1. Restart SSSD and clear cache on IPA server
:steps:
1. Resolve user "admin@trusteddomain"
2. Resolve group "admins@trusteddomain"
:expectedresults:
1. User is resolved
2. Group is resolved
:customerscenario: True
"""
ipa.sssd.clear(db=True, memcache=True, logs=True)
ipa.sssd.restart()

# Resolve user
username = trusted.admin_fqn()

id_user = ipa.tools.id(username)
assert id_user is not None
assert id_user.user.name == username

@pytest.mark.importance("low")
@pytest.mark.topology(KnownTopology.IPATrustIPA)
def test_ipa_trusts__ipa_client_trusted_user_lookup(client: Client, ipa: IPA, trusted: IPA):
"""
:title: Basic IPA-IPA Trust lookup on IPA client
:setup:
1. Restart SSSD and clear cache on IPA client
:steps:
1. Resolve user "admin@trusteddomain"
2. Resolve group "admins@trusteddomain"
:expectedresults:
1. User is resolved
2. Group is resolved
:customerscenario: True
"""
client.sssd.clear(db=True, memcache=True, logs=True)
client.sssd.restart()

# Resolve user
username = trusted.admin_fqn()

id_user = client.tools.id(username)
assert id_user is not None
assert id_user.user.name == username

# Resolve group
groupname = trusted.fqn("admins")

getent_group = client.tools.getent.group(groupname)
assert getent_group is not None
assert getent_group.name == groupname

0 comments on commit fd8ef2f

Please sign in to comment.