Skip to content

Commit

Permalink
Fix alert test for legacy IPA bind
Browse files Browse the repository at this point in the history
By the time we get to this test we've already accumulated a number
of alerts. Simply check that the expected one is in the mix.
  • Loading branch information
anodos325 committed Jul 18, 2024
1 parent ea15e7d commit fddd0f2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/api2/test_278_freeipa.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ def do_freeipa_connection():


# Validate that our LDAP configuration alert goes away when it's disabled.
alerts = call('alert.list')
assert len(alerts) == 0
alerts = [alert['klass'] for alert in call('alert.list')]

# There's a one-shot alert that gets fired if we are an IPA domain
# connected via legacy mechanism.
assert 'IPALegacyConfiguration' not in alerts


def test_setup_and_enabling_freeipa(do_freeipa_connection):
Expand All @@ -61,10 +64,11 @@ def test_setup_and_enabling_freeipa(do_freeipa_connection):
assert ds['type'] == 'LDAP'
assert ds['status'] == 'HEALTHY'

alerts = call('alert.list')
assert len(alerts) == 1, str(alerts)
assert alerts[0]['klass'] == 'IPALegacyConfiguration'
assert 'Password has expired' in alerts[0]['formatted']
alerts = [alert['klass'] for alert in call('alert.list')]

# There's a one-shot alert that gets fired if we are an IPA domain
# connected via legacy mechanism.
assert 'IPALegacyConfiguration' in alerts


def test_verify_config(request):
Expand Down

0 comments on commit fddd0f2

Please sign in to comment.