summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-31 09:19:22 +0100
committerMartin Babinsky <mbabinsk@redhat.com>2017-02-08 14:15:53 +0100
commitad1a5551d5ec716dc745f39e82d38cc634229cb0 (patch)
treeffaa1152f2ae319a986ddd876126386cd956e800
parent4c84341b8bc14cd19a4e2c2df4c13b95ff7eeb05 (diff)
downloadfreeipa-ad1a5551d5ec716dc745f39e82d38cc634229cb0.tar.gz
freeipa-ad1a5551d5ec716dc745f39e82d38cc634229cb0.tar.xz
freeipa-ad1a5551d5ec716dc745f39e82d38cc634229cb0.zip
Tests: fix wait_for_replication task
DS changed a format of replication status attribute. Now it is with prefix "Error (x)" where x is the error code. Both formats were kept to allow tests run on older and new versions of DS. Reviewed-By: Milan Kubik <mkubik@redhat.com>
-rw-r--r--ipatests/test_integration/tasks.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 5a9d526f0..f6fa45140 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -1067,8 +1067,15 @@ def wait_for_replication(ldap, timeout=30):
filter='(objectclass=nsds5replicationagreement)',
attrs_list=[status_attr, progress_attr])
log.debug('Replication agreements: \n%s', _entries_to_ldif(entries))
- if any(not e.single_value[status_attr].startswith('0 ')
- for e in entries):
+ if any(
+ not (
+ # older DS format
+ e.single_value[status_attr].startswith('0 ') or
+ # newer DS format
+ e.single_value[status_attr].startswith('Error (0) ')
+ )
+ for e in entries
+ ):
log.error('Replication error')
continue
if any(e.single_value[progress_attr] == 'TRUE' for e in entries):