summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-09-04 13:44:57 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-10-18 18:01:38 +0200
commite6738ea68f318c45ad901f8ecfe2d9d94694c7f4 (patch)
treefa5137c9630bf20058f3cca5665c7318e9260fda /ipatests
parentf3aa3c4c8002aba1b40ad7c9aade2bcb4426dab2 (diff)
downloadfreeipa-e6738ea68f318c45ad901f8ecfe2d9d94694c7f4.tar.gz
freeipa-e6738ea68f318c45ad901f8ecfe2d9d94694c7f4.tar.xz
freeipa-e6738ea68f318c45ad901f8ecfe2d9d94694c7f4.zip
test_simple_replication: Fix waiting for replication
The integration tests must wait for replication to happen before checking results. In some cases, the tests have failed because the checks that detect completed replication were insufficient. This fixes the code to: - Wait for replication to be completed on both servers - In the case of an error, continue waiting -- it might be the case that the DS is temporarily unreachable
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_integration/tasks.py3
-rw-r--r--ipatests/test_integration/test_simple_replication.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 7ea0ce4f1..de650f587 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -419,8 +419,7 @@ def wait_for_replication(ldap, timeout=30):
if any(not e.single_value(status_attr).startswith('0 ')
for e in entries):
log.error('Replication error')
- break
- in_progress = []
+ continue
if any(e.single_value(progress_attr) == 'TRUE' for e in entries):
log.debug('Replication in progress (waited %s/%ss)',
i, timeout)
diff --git a/ipatests/test_integration/test_simple_replication.py b/ipatests/test_integration/test_simple_replication.py
index 998b1196a..f1da22f50 100644
--- a/ipatests/test_integration/test_simple_replication.py
+++ b/ipatests/test_integration/test_simple_replication.py
@@ -36,6 +36,9 @@ class TestSimpleReplication(IntegrationTest):
'--first', 'test',
'--last', 'user'])
+ source_ldap = source_host.ldap_connect()
+ tasks.wait_for_replication(source_ldap)
+
ldap = dest_host.ldap_connect()
tasks.wait_for_replication(ldap)