From 29ff3ce56894d5ef0254c85d6ae9e68733558901 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 8 Jun 2012 13:37:49 +1000 Subject: [PATCH] s4-selftest: Test samba-tool drs replicate --local --full-sync --- source4/selftest/tests.py | 2 +- source4/torture/drs/python/drs_base.py | 6 +++++- source4/torture/drs/python/replica_sync.py | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 9a6af526cc7..8e868dc291f 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -485,7 +485,7 @@ plantestsuite("samba4.ldap.bind(dc)", "dc", [python, os.path.join(srcdir(), "aut planoldpythontestsuite("vampire_dc", "samba.tests.blackbox.samba_tool_drs", environ={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'}, extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD']) -planoldpythontestsuite("vampire_dc", "replica_sync", +planoldpythontestsuite("vampire_dc:local", "replica_sync", extra_path=[os.path.join(samba4srcdir, 'torture/drs/python')], name="samba4.drs.replica_sync.python(vampire_dc)", environ={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'}, diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py index 8e48b92f7a0..abfdbf5bd3f 100644 --- a/source4/torture/drs/python/drs_base.py +++ b/source4/torture/drs/python/drs_base.py @@ -98,13 +98,17 @@ class DrsBaseTestCase(samba.tests.BlackboxTestCase): # bin/samba-tool drs return "%s drs %s %s" % (samba_tool_cmd, drs_command, cmdline_auth) - def _net_drs_replicate(self, DC, fromDC, nc_dn=None, forced=True): + def _net_drs_replicate(self, DC, fromDC, nc_dn=None, forced=True, local=False, full_sync=False): if nc_dn is None: nc_dn = self.domain_dn # make base command line samba_tool_cmdline = self._samba_tool_cmdline("replicate") if forced: samba_tool_cmdline += " --sync-forced" + if local: + samba_tool_cmdline += " --local" + if full_sync: + samba_tool_cmdline += " --full-sync" # bin/samba-tool drs replicate cmd_line = "%s %s %s %s" % (samba_tool_cmdline, DC, fromDC, nc_dn) return self.check_output(cmd_line) diff --git a/source4/torture/drs/python/replica_sync.py b/source4/torture/drs/python/replica_sync.py index ddeb5822f54..af2da4fcebd 100644 --- a/source4/torture/drs/python/replica_sync.py +++ b/source4/torture/drs/python/replica_sync.py @@ -63,3 +63,9 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): """Tests we cann't replicate when replication is disabled""" self._disable_inbound_repl(self.dnsname_dc1) out = self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2, forced=True) + + def test_ReplLocal(self): + """Tests we can replicate direct to the local db""" + self._enable_inbound_repl(self.dnsname_dc1) + self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2, forced=False, local=True, full_sync=True) +