Rather than just disabling inbound replication, consider that there may be another server
in the test network, and ensure we do not replicate to or from it either.
replica_sync.py is omitted, as it tests some more subtle variations
of the DISABLE_INBOUND_REPL flag.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
def setUp(self):
super(DrsDeleteObjectTestCase, self).setUp()
# disable automatic replication temporary
- self._disable_inbound_repl(self.dnsname_dc1)
- self._disable_inbound_repl(self.dnsname_dc2)
+ self._disable_all_repl(self.dnsname_dc1)
+ self._disable_all_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)
def tearDown(self):
- self._enable_inbound_repl(self.dnsname_dc1)
- self._enable_inbound_repl(self.dnsname_dc2)
+ self._enable_all_repl(self.dnsname_dc1)
+ self._enable_all_repl(self.dnsname_dc2)
super(DrsDeleteObjectTestCase, self).tearDown()
def _make_username(self):
samba_tool_cmd = self._samba_tool_cmdline("options")
# disable replication
self.check_run("%s %s --dsa-option=+DISABLE_INBOUND_REPL" %(samba_tool_cmd, DC))
+
+ def _enable_all_repl(self, DC):
+ # make base command line
+ samba_tool_cmd = self._samba_tool_cmdline("options")
+ # disable replication
+ self.check_run("%s %s --dsa-option=-DISABLE_INBOUND_REPL" %(samba_tool_cmd, DC))
+ self.check_run("%s %s --dsa-option=-DISABLE_OUTBOUND_REPL" %(samba_tool_cmd, DC))
+
+ def _disable_all_repl(self, DC):
+ # make base command line
+ samba_tool_cmd = self._samba_tool_cmdline("options")
+ # disable replication
+ self.check_run("%s %s --dsa-option=+DISABLE_INBOUND_REPL" %(samba_tool_cmd, DC))
+ self.check_run("%s %s --dsa-option=+DISABLE_OUTBOUND_REPL" %(samba_tool_cmd, DC))
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)
+ self._disable_all_repl(self.dnsname_dc1)
+ self._disable_all_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)
pass
self.ldb_dc1.delete(self.ou2_dn, ["tree_delete:1"])
- self._enable_inbound_repl(self.dnsname_dc1)
- self._enable_inbound_repl(self.dnsname_dc2)
+ self._enable_all_repl(self.dnsname_dc1)
+ self._enable_all_repl(self.dnsname_dc2)
super(DrsMoveObjectTestCase, self).tearDown()
def _make_username(self):
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)
+ self._disable_all_repl(self.dnsname_dc1)
+ self._disable_all_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)
def tearDown(self):
self.ldb_dc1.delete(self.ou1_dn, ["tree_delete:1"])
- self._enable_inbound_repl(self.dnsname_dc1)
- self._enable_inbound_repl(self.dnsname_dc2)
+ self._enable_all_repl(self.dnsname_dc1)
+ self._enable_all_repl(self.dnsname_dc2)
super(DrsMoveBetweenTreeOfObjectTestCase, self).tearDown()
def _make_username(self):
super(DrsReplSchemaTestCase, self).setUp()
# disable automatic replication temporary
- self._disable_inbound_repl(self.dnsname_dc1)
- self._disable_inbound_repl(self.dnsname_dc2)
+ self._disable_all_repl(self.dnsname_dc1)
+ self._disable_all_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)
DrsReplSchemaTestCase.obj_prefix = "DrsReplSchema-%s" % t
def tearDown(self):
- self._enable_inbound_repl(self.dnsname_dc1)
- self._enable_inbound_repl(self.dnsname_dc2)
+ self._enable_all_repl(self.dnsname_dc1)
+ self._enable_all_repl(self.dnsname_dc2)
super(DrsReplSchemaTestCase, self).tearDown()
def _make_obj_names(self, base_name):
This ensures that the server
"""
# disable automatic replication temporary
- self._disable_inbound_repl(self.dnsname_dc1)
- self._disable_inbound_repl(self.dnsname_dc2)
+ self._disable_all_repl(self.dnsname_dc1)
+ self._disable_all_repl(self.dnsname_dc2)
# add new attributeSchema object
(a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-OU-S", 3)