]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: Make repl_move more robust by disabling replication before the test
authorAndrew Bartlett <abartlet@samba.org>
Mon, 18 Jul 2016 04:35:28 +0000 (16:35 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 19 Jul 2016 11:41:11 +0000 (13:41 +0200)
We do this before we ensure the two DCs are in sync, and then force the sync

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/torture/drs/python/repl_move.py

index 41a364e5628475ea065db393d10b4aaae8d4fb5b..d00d0940694498a5d6cae102c37fef30dac2b36a 100644 (file)
@@ -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"])