URL: https://github.com/freeipa/freeipa/pull/5635
Author: mrizwan93
 Title: #5635: ipatests: introduce wait_for_replication in test_rolecheck_Trust
Action: opened

PR body:
"""
Test was randomly failing if the query for the server role is
executed before the replication had time to replicate the
changes on cn=adtrust agents,cn=sysaccounts,cn=etc,dc=ipa,dc=test,
as the server role is read using this entry.

related: https://pagure.io/freeipa/issue/8553

Signed-off-by: Mohammad Rizwan <myu...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/5635/head:pr5635
git checkout pr5635
From dc780a456e6e1d38082d0f9cee5744ead1913e75 Mon Sep 17 00:00:00 2001
From: Mohammad Rizwan <myu...@redhat.com>
Date: Fri, 12 Mar 2021 12:46:09 +0530
Subject: [PATCH] ipatests: introduce wait_for_replication in
 test_rolecheck_Trust

Test was randomly failing if the query for the server role is
executed before the replication had time to replicate the
changes on cn=adtrust agents,cn=sysaccounts,cn=etc,dc=ipa,dc=test,
as the server role is read using this entry.

related: https://pagure.io/freeipa/issue/8553

Signed-off-by: Mohammad Rizwan <myu...@redhat.com>
---
 ipatests/test_integration/test_backup_and_restore.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/ipatests/test_integration/test_backup_and_restore.py b/ipatests/test_integration/test_backup_and_restore.py
index e0ef2684f3b..37a2ccd574c 100644
--- a/ipatests/test_integration/test_backup_and_restore.py
+++ b/ipatests/test_integration/test_backup_and_restore.py
@@ -1028,6 +1028,10 @@ def test_rolecheck_Trust(self):
             '-a', self.master.config.admin_password,
             '--add-sids'
         ])
+
+        # wait for replication
+        tasks.wait_for_replication(self.replicas[0].ldap_connect())
+
         # double-check
         assert self._ipa_replica_role_check(
             self.replicas[0].hostname, self.serverroles['ADTC']
@@ -1062,6 +1066,10 @@ def test_rolecheck_Trust(self):
         self.replicas[0].run_command([
             'ipa-adtrust-install', '--add-agents'], stdin_text=cmd_input
         )
+
+        # wait for replication
+        tasks.wait_for_replication(self.replicas[0].ldap_connect())
+
         # check that master is now an AD Trust agent
         assert self._ipa_replica_role_check(
             self.master.hostname, self.serverroles['ADTA']
@@ -1079,6 +1087,10 @@ def test_rolecheck_Trust(self):
             '-a', self.master.config.admin_password,
             '--add-sids'
         ])
+
+        # wait for replication
+        tasks.wait_for_replication(self.master.ldap_connect())
+
         # master and replicas[0] are both AD Trust Controllers now.
         for hostname in [self.master.hostname, self.replicas[0].hostname]:
             assert self._ipa_replica_role_check(
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to