From 90d0d3e5f8ab1c5152163c83e423913a4c24ec9b Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Mon, 21 Feb 2011 17:49:54 +0200 Subject: s4/drs-tests: Move enable/disable replication methods to DrsBase class so we can re-use them --- source4/torture/drs/python/drs_base.py | 11 +++++++++++ source4/torture/drs/python/replica_sync.py | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'source4') diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py index 56d1ebe795..8e48b92f7a 100644 --- a/source4/torture/drs/python/drs_base.py +++ b/source4/torture/drs/python/drs_base.py @@ -109,3 +109,14 @@ class DrsBaseTestCase(samba.tests.BlackboxTestCase): cmd_line = "%s %s %s %s" % (samba_tool_cmdline, DC, fromDC, nc_dn) return self.check_output(cmd_line) + def _enable_inbound_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)) + + def _disable_inbound_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)) diff --git a/source4/torture/drs/python/replica_sync.py b/source4/torture/drs/python/replica_sync.py index 5410ed68b2..06502d6008 100644 --- a/source4/torture/drs/python/replica_sync.py +++ b/source4/torture/drs/python/replica_sync.py @@ -58,18 +58,6 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): self._enable_inbound_repl(self.dnsname_dc1) super(DrsReplicaSyncTestCase, self).tearDown() - def _enable_inbound_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)) - - def _disable_inbound_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)) - def test_ReplEnabled(self): """Tests we can replicate when replication is enabled""" self._enable_inbound_repl(self.dnsname_dc1) -- cgit