Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
droideck committed Aug 28, 2024
1 parent 8c4fc5e commit c3210e5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions dirsrvtests/tests/suites/replication/regression_m2c1_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import ldap
import pytest
from lib389.topologies import topology_m2c1 as topo_m2c1
from lib389._constants import DEFAULT_SUFFIX
from lib389._constants import DEFAULT_SUFFIX, DN_USERROOT_LDBM
from lib389.replica import Changelog5
from lib389.idm.user import TEST_USER_PROPERTIES, UserAccounts
from lib389.utils import ensure_bytes, ds_supports_new_changelog

pytestmark = pytest.mark.tier1

CHANGELOG = 'cn=changelog5,cn=config'
CHANGELOG = 'cn=changelog,{}'.format(DN_USERROOT_LDBM)
MAXAGE_ATTR = 'nsslapd-changelogmaxage'
MAXAGE_VALUE = '5'
TRIMINTERVAL = 'nsslapd-changelogtrim-interval'
Expand Down Expand Up @@ -130,13 +130,19 @@ def test_changelog_trimming(topo_m2c1):

log.info("Check TEST_ENTRY on all instances")
for instance in (S1, S2, C1):
users = UserAccounts(instance, DEFAULT_SUFFIX)
try:
user = users.get('last_user')
success = 0
for i in range(0, 5):
users = UserAccounts(instance, DEFAULT_SUFFIX)
try:
user = users.get('last_user')
except ldap.NO_SUCH_OBJECT:
time.sleep(1)
continue
log.info(f"User 'last_user' found on {instance.serverid}")
except ldap.NO_SUCH_OBJECT:
log.error(f"User 'last_user' not found on {instance.serverid}")
assert False, f"User 'last_user' not found on {instance.serverid}"
success = 1
break

assert success, f"User 'last_user' not found on {instance.serverid}"


if __name__ == '__main__':
Expand Down

0 comments on commit c3210e5

Please sign in to comment.