Skip to content

Commit

Permalink
tests: Check failover to secondary IP family
Browse files Browse the repository at this point in the history
Test that IPA server is still reachable when primary
address family is blocked but secondary is working.
  • Loading branch information
thalman committed Feb 13, 2025
1 parent e0a18a2 commit 5e464f7
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/tests/system/tests/test_failover.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sssd_test_framework.roles.ipa import IPA
from sssd_test_framework.roles.ldap import LDAP
from sssd_test_framework.roles.samba import Samba
from sssd_test_framework.topology import KnownTopologyGroup
from sssd_test_framework.topology import KnownTopology, KnownTopologyGroup


@pytest.mark.parametrize("value, expected", [(None, 31), (15, 31), (60, 60)])
Expand Down Expand Up @@ -80,3 +80,29 @@ def test_failover__reactivation_timeout_is_honored(
assert (
f"Primary server reactivation timeout set to {expected} seconds" in log
), f"'Primary server reactivation timeout set to {expected} seconds' not found in logs!"


@pytest.mark.importance("low")
@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_failover__connect_using_ipv4_second_family(client: Client, provider: GenericProvider):
"""
:title: Make sure that we can connect using secondary protocol
:setup:
1. Create user
2. Set family_order to "ipv6_first"
3. Set IPv6 address in /etc/hosts so it resolves but it
points to non-exesting machine
4. Start SSSD
:steps:
1. Resolve user
:expectedresults:
1. SSSD goes online and the user is resolved
:customerscenario: False
"""
user = provider.user("testuser").add()
client.sssd.domain["lookup_family_order"] = "ipv6_first"
client.fs.append("/etc/hosts", "cafe:cafe::3 %s" % provider.host.hostname)
client.sssd.start()

result = client.tools.id(user)
assert result is not None, f"{user.name} was not found, SSSD did not switch to IPv4 family!"

0 comments on commit 5e464f7

Please sign in to comment.