1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

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 <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett 2016-07-18 16:35:28 +12:00
parent 6145da66ef
commit 3a787f45cf

View 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"])