From 3a787f45cf150b8ff6c6c6ea268687f335d209bc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 18 Jul 2016 16:35:28 +1200 Subject: [PATCH] selftest: Make repl_move more robust by disabling replication before the test We do this before we ensure the two DCs are in sync, and then force the sync Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- source4/torture/drs/python/repl_move.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source4/torture/drs/python/repl_move.py b/source4/torture/drs/python/repl_move.py index 41a364e5628..d00d0940694 100644 --- a/source4/torture/drs/python/repl_move.py +++ b/source4/torture/drs/python/repl_move.py @@ -54,9 +54,14 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): def setUp(self): super(DrsMoveObjectTestCase, self).setUp() + # disable automatic replication temporary + self._disable_inbound_repl(self.dnsname_dc1) + self._disable_inbound_repl(self.dnsname_dc2) + # make sure DCs are synchronized before the test self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, forced=True) self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2, forced=True) + self.ou1_dn = ldb.Dn(self.ldb_dc1, "OU=DrsOU1") self.ou1_dn.add_base(self.ldb_dc1.get_default_basedn()) ou1 = {} @@ -73,10 +78,6 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): ou2["ou"] = self.ou2_dn.get_component_value(0) self.ldb_dc1.add(ou2) - # disable automatic replication temporary - self._disable_inbound_repl(self.dnsname_dc1) - self._disable_inbound_repl(self.dnsname_dc2) - # trigger replication from DC1 to DC2 self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, forced=True) self.dc1_guid = self.ldb_dc1.get_invocation_id() @@ -1828,9 +1829,14 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase): def setUp(self): super(DrsMoveBetweenTreeOfObjectTestCase, self).setUp() + # disable automatic replication temporary + self._disable_inbound_repl(self.dnsname_dc1) + self._disable_inbound_repl(self.dnsname_dc2) + # make sure DCs are synchronized before the test self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, forced=True) self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2, forced=True) + self.ou1_dn = ldb.Dn(self.ldb_dc1, "OU=DrsOU1") self.ou1_dn.add_base(self.ldb_dc1.get_default_basedn()) self.ou1 = {} @@ -1883,10 +1889,6 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase): self.ou6["objectclass"] = "organizationalUnit" self.ou6["ou"] = self.ou6_dn.get_component_value(0) - # disable automatic replication temporary - self._disable_inbound_repl(self.dnsname_dc1) - self._disable_inbound_repl(self.dnsname_dc2) - def tearDown(self): self.ldb_dc1.delete(self.ou1_dn, ["tree_delete:1"])