[SCM] Samba Shared Repository - branch master updated

Kamen Mazdrashki kamenim at samba.org
Sat Feb 26 16:11:03 MST 2011


The branch, master has been updated
       via  561205b s4/dsdb-util: Use DS_NTDSDSA_OPT_IS_GC flag definition
       via  ec54534 s4/tests: Include 'replica_sync' test in S4 test suite
       via  375eddc s4/drs-test: Remove unused imports
       via  62a6b75 s4/drs-test: remove netReplicateCmd test from 'deleted object' test case
       via  281e306 s4/drs-tests: Disable replication during 'deleted object' test
       via  90d0d3e s4/drs-tests: Move enable/disable replication methods to DrsBase class so we can re-use them
       via  1ca2ec1 s4-drepl: Schedule event to trigger replication rather than calling run_pending_ops directly
       via  05c90d2 s4-drepl: Fix replica sync callback to really store last error rather than last success
       via  d7f47fb s4-drepl: Refactor dreplsrv_run_pull_ops() to
       via  f0bde82 s4-drepl: Pass replication options from DsReplicaSync call
      from  48200c2 s3: Improve a dbg msg in aio_fork

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 561205b0166cb4a9c2efbb32b8429f6a83827eee
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Tue Feb 22 17:06:15 2011 +0200

    s4/dsdb-util: Use DS_NTDSDSA_OPT_IS_GC flag definition
    
    Autobuild-User: Kamen Mazdrashki <kamenim at samba.org>
    Autobuild-Date: Sun Feb 27 00:10:45 CET 2011 on sn-devel-104

commit ec5453427ea60990ac485849278e79a19511e1dd
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Tue Feb 22 17:05:54 2011 +0200

    s4/tests: Include 'replica_sync' test in S4 test suite

commit 375eddc15e20a1a2cbaa5bd53962b0206ca7cef3
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Tue Feb 22 04:38:12 2011 +0200

    s4/drs-test: Remove unused imports

commit 62a6b754828e8e825b9ee732defc6b3855e06489
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Tue Feb 22 04:16:55 2011 +0200

    s4/drs-test: remove netReplicateCmd test from 'deleted object' test case
    
    DCs synchronization is moved to the test case setUp method
    as there is no guarantee for the order of execution of tests
    in a test case - thus netReplicateCmd may be executed after
    ReplicateDeleteOjbect test

commit 281e3060451720445c4fb12f5dbbe5ccdc84ca92
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Tue Feb 22 03:40:07 2011 +0200

    s4/drs-tests: Disable replication during 'deleted object' test
    
    This allows us to remove the patch that prevents the test failure.
    
    Also pass 'forced' flag to samba-tool drs replicate command, otherwise
    DsReplicaSync will fail with 'replication not permitted' error

commit 90d0d3e5f8ab1c5152163c83e423913a4c24ec9b
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Mon Feb 21 17:49:54 2011 +0200

    s4/drs-tests: Move enable/disable replication methods to DrsBase class so we can re-use them

commit 1ca2ec1188098c051fe7ab6d44c9b1cd1f802b18
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Sat Feb 26 23:13:49 2011 +0200

    s4-drepl: Schedule event to trigger replication rather than calling run_pending_ops directly
    
    Executing dreplsrv_run_pending_ops() directly may cause a segfault
    as in case of failure, the _drepl_replica_sync_done_cb() callback
    gets called *before* drepl_replica_sync() returns. In such case,
    irpc message gets freed twice - once when irpc_send_reply() gets called
    and once when drepl_replica_sync() returns

commit 05c90d2fa696517612051a8e7c7dc765723e71f5
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Sat Feb 26 23:01:20 2011 +0200

    s4-drepl: Fix replica sync callback to really store last error rather than last success

commit d7f47fb87cb06ab9642bd188de435beed539c437
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Sat Feb 26 21:00:46 2011 +0200

    s4-drepl: Refactor dreplsrv_run_pull_ops() to
    
    1. Take into account DSA options - we should not send replication
       requests in case OUTBOUND_REPLICATION is disabled
    2. Use replication flags for the operation to determine if
       a forced replication is requested
    3. In case outbound replication is disabled and we don't have
       DRSUAPI_DRS_SYNC_FORCED flag set, then we should record
       WERR_DS_DRA_SINK_DISABLED error as a last replication result

commit f0bde828e0ca76752c23920cc0fd563866e5a90b
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Sat Feb 26 20:36:19 2011 +0200

    s4-drepl: Pass replication options from DsReplicaSync call

-----------------------------------------------------------------------

Summary of changes:
 source4/dsdb/common/util.c                  |    2 +-
 source4/dsdb/repl/drepl_extended.c          |    2 +-
 source4/dsdb/repl/drepl_out_pull.c          |   53 ++++++++++++++++++---------
 source4/dsdb/repl/drepl_service.c           |   18 ++++++---
 source4/dsdb/repl/drepl_service.h           |    2 +
 source4/selftest/tests.py                   |    1 +
 source4/torture/drs/python/delete_object.py |   43 +++++++---------------
 source4/torture/drs/python/drs_base.py      |   11 ++++++
 source4/torture/drs/python/repl_schema.py   |    7 ----
 source4/torture/drs/python/replica_sync.py  |   26 -------------
 10 files changed, 77 insertions(+), 88 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index e711a32..67328c6 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1910,7 +1910,7 @@ bool samdb_is_gc(struct ldb_context *ldb)
 	talloc_free(tmp_ctx);
 
 	/* if options attribute has the 0x00000001 flag set, then enable the global catlog */
-	if (options & 0x000000001) {
+	if (options & DS_NTDSDSA_OPT_IS_GC) {
 		return true;
 	}
 	return false;
diff --git a/source4/dsdb/repl/drepl_extended.c b/source4/dsdb/repl/drepl_extended.c
index cf1c25a..4d64594 100644
--- a/source4/dsdb/repl/drepl_extended.c
+++ b/source4/dsdb/repl/drepl_extended.c
@@ -198,7 +198,7 @@ WERROR drepl_request_extended_op(struct dreplsrv_service *service,
 	data->sdsa = sdsa;
 
 	werr = dreplsrv_schedule_partition_pull_source(service, sdsa,
-						       extended_op, fsmo_info,
+						       0, extended_op, fsmo_info,
 						       extended_op_callback, data);
 	if (!W_ERROR_IS_OK(werr)) {
 		talloc_free(sdsa);
diff --git a/source4/dsdb/repl/drepl_out_pull.c b/source4/dsdb/repl/drepl_out_pull.c
index 11165f4..86b513d 100644
--- a/source4/dsdb/repl/drepl_out_pull.c
+++ b/source4/dsdb/repl/drepl_out_pull.c
@@ -89,6 +89,7 @@ void drepl_reps_update(struct dreplsrv_service *s, const char *reps_attr,
 
 WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
 					       struct dreplsrv_partition_source_dsa *source,
+					       uint32_t options,
 					       enum drsuapi_DsExtendedOperation extended_op,
 					       uint64_t fsmo_info,
 					       dreplsrv_extended_callback_t callback,
@@ -101,6 +102,7 @@ WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
 
 	op->service	= s;
 	op->source_dsa	= source;
+	op->options	= options;
 	op->extended_op = extended_op;
 	op->fsmo_info   = fsmo_info;
 	op->callback    = callback;
@@ -121,7 +123,7 @@ static WERROR dreplsrv_schedule_partition_pull(struct dreplsrv_service *s,
 
 	for (cur = p->sources; cur; cur = cur->next) {
 		status = dreplsrv_schedule_partition_pull_source(s, cur,
-		                                                 DRSUAPI_EXOP_NONE, 0,
+		                                                 0, DRSUAPI_EXOP_NONE, 0,
 		                                                 NULL, NULL);
 		W_ERROR_NOT_OK_RETURN(status);
 	}
@@ -176,6 +178,7 @@ void dreplsrv_run_pull_ops(struct dreplsrv_service *s)
 	time_t t;
 	NTTIME now;
 	struct tevent_req *subreq;
+	WERROR werr;
 
 	if (s->ops.current) {
 		/* if there's still one running, we're done */
@@ -196,24 +199,40 @@ void dreplsrv_run_pull_ops(struct dreplsrv_service *s)
 
 	op->source_dsa->repsFrom1->last_attempt = now;
 
-	subreq = dreplsrv_op_pull_source_send(op, s->task->event_ctx, op);
-	if (!subreq) {
-		struct repsFromTo1 *rf = op->source_dsa->repsFrom1;
-
-		if (op->extended_op == DRSUAPI_EXOP_NONE) {
-			drepl_reps_update(s, "repsFrom", op->source_dsa->partition->dn,
-					  &rf->source_dsa_obj_guid, WERR_NOMEM);
+	/* check if inbound replication is enabled */
+	if (!(op->options & DRSUAPI_DRS_SYNC_FORCED)) {
+		uint32_t rep_options;
+		if (samdb_ntds_options(op->service->samdb, &rep_options) != LDB_SUCCESS) {
+			werr = WERR_DS_DRA_INTERNAL_ERROR;
+			goto failed;
 		}
-		s->ops.current = NULL;
-
-		/*
-		 * call the callback (if any) so it gets the chance
-		 * to do its job just like in any other failure situation
-		 */
-		if (op->callback) {
-			op->callback(s, WERR_NOMEM, op->extended_ret, op->cb_data);
+
+		if ((rep_options & DS_NTDSDSA_OPT_DISABLE_INBOUND_REPL)) {
+			werr = WERR_DS_DRA_SINK_DISABLED;
+			goto failed;
 		}
-		return;
 	}
+
+	subreq = dreplsrv_op_pull_source_send(op, s->task->event_ctx, op);
+	if (!subreq) {
+		werr = WERR_NOMEM;
+		goto failed;
+	}
+
 	tevent_req_set_callback(subreq, dreplsrv_pending_op_callback, op);
+	return;
+
+failed:
+	if (op->extended_op == DRSUAPI_EXOP_NONE) {
+		drepl_reps_update(s, "repsFrom", op->source_dsa->partition->dn,
+				  &op->source_dsa->repsFrom1->source_dsa_obj_guid, werr);
+	}
+	/* unblock queue processing */
+	s->ops.current = NULL;
+	/*
+	 * let the callback do its job just like in any other failure situation
+	 */
+	if (op->callback) {
+		op->callback(s, werr, op->extended_ret, op->cb_data);
+	}
 }
diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c
index ab97ba6..9248c83 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -145,7 +145,7 @@ static void _drepl_replica_sync_done_cb(struct dreplsrv_service *service,
 	struct drsuapi_DsReplicaSync *r = data->r;
 
 	/* store last bad result */
-	if (W_ERROR_IS_OK(werr)) {
+	if (!W_ERROR_IS_OK(werr)) {
 		data->werr_last_failure = werr;
 	}
 
@@ -170,6 +170,7 @@ static void _drepl_replica_sync_done_cb(struct dreplsrv_service *service,
 static WERROR _drepl_schedule_replication(struct dreplsrv_service *service,
 					  struct dreplsrv_partition_source_dsa *dsa,
 					  struct drsuapi_DsReplicaObjectIdentifier *nc,
+					  uint32_t rep_options,
 					  struct drepl_replica_sync_cb_data *data,
 					  TALLOC_CTX *mem_ctx)
 {
@@ -181,7 +182,7 @@ static WERROR _drepl_schedule_replication(struct dreplsrv_service *service,
 	}
 
 	/* schedule replication item */
-	werr = dreplsrv_schedule_partition_pull_source(service, dsa,
+	werr = dreplsrv_schedule_partition_pull_source(service, dsa, rep_options,
 	                                               DRSUAPI_EXOP_NONE, 0,
 	                                               fn_callback, data);
 	if (!W_ERROR_IS_OK(werr)) {
@@ -277,7 +278,8 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg,
 	if (req1->options & DRSUAPI_DRS_SYNC_ALL) {
 		for (dsa = p->sources; dsa; dsa = dsa->next) {
 			/* schedule replication item */
-			werr = _drepl_schedule_replication(service, dsa, nc, cb_data, msg);
+			werr = _drepl_schedule_replication(service, dsa, nc,
+							   req1->options, cb_data, msg);
 			if (!W_ERROR_IS_OK(werr)) {
 				REPLICA_SYNC_FAIL("_drepl_schedule_replication() failed",
 				                  werr);
@@ -311,7 +313,8 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg,
 		}
 
 		/* schedule replication item */
-		werr = _drepl_schedule_replication(service, dsa, nc, cb_data, msg);
+		werr = _drepl_schedule_replication(service, dsa, nc,
+						   req1->options, cb_data, msg);
 		if (!W_ERROR_IS_OK(werr)) {
 			REPLICA_SYNC_FAIL("_drepl_schedule_replication() failed",
 			                  werr);
@@ -321,8 +324,11 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg,
 	/* if we got here, everything is OK */
 	r->out.result = WERR_OK;
 
-	/* force execution of scheduled replications */
-	dreplsrv_run_pending_ops(service);
+	/*
+	 * schedule replication event to force
+	 * replication as soon as possible
+	 */
+	dreplsrv_periodic_schedule(service, 0);
 
 done:
 	return NT_STATUS_OK;
diff --git a/source4/dsdb/repl/drepl_service.h b/source4/dsdb/repl/drepl_service.h
index 80f60d6..c454ac6 100644
--- a/source4/dsdb/repl/drepl_service.h
+++ b/source4/dsdb/repl/drepl_service.h
@@ -125,6 +125,8 @@ struct dreplsrv_out_operation {
 
 	struct dreplsrv_partition_source_dsa *source_dsa;
 
+	/* replication options - currently used by DsReplicaSync */
+	uint32_t options;
 	enum drsuapi_DsExtendedOperation extended_op;
 	uint64_t fsmo_info;
 	enum drsuapi_DsExtendedError extended_ret;
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 9c6cbd3..42bf7cd 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -417,6 +417,7 @@ plantestsuite("samba4.ldap.bind(dc)", "dc", [python, os.path.join(samba4srcdir,
 
 # DRS python tests
 plansambapythontestsuite("samba4.blackbox.samba-tool.drs(vampire_dc)", "vampire_dc", os.path.join(samba4srcdir, 'scripting/python'), "samba.tests.blackbox.samba_tool_drs", environ={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'}, extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
+plansambapythontestsuite("samba4.drs.replica_sync.python(vampire_dc)", "vampire_dc", os.path.join(samba4srcdir, 'torture/drs/python'), "replica_sync", environ={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'}, extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 plansambapythontestsuite("samba4.drs.delete_object.python(vampire_dc)", "vampire_dc", os.path.join(samba4srcdir, 'torture/drs/python'), "delete_object", environ={'DC1': '$DC_SERVER', 'DC2': '$VAMPIRE_DC_SERVER'}, extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 plansambapythontestsuite("samba4.drs.fsmo.python(vampire_dc)", "vampire_dc", os.path.join(samba4srcdir, 'torture/drs/python'), "fsmo", environ={'DC1': "$DC_SERVER", 'DC2': "$VAMPIRE_DC_SERVER"}, extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 plansambapythontestsuite("samba4.drs.repl_schema.python(vampire_dc)", "vampire_dc", os.path.join(samba4srcdir, 'torture/drs/python'), "repl_schema", environ={'DC1': "$DC_SERVER", 'DC2': '$VAMPIRE_DC_SERVER'}, extra_args=['-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
diff --git a/source4/torture/drs/python/delete_object.py b/source4/torture/drs/python/delete_object.py
index b652377..0f56fa8 100644
--- a/source4/torture/drs/python/delete_object.py
+++ b/source4/torture/drs/python/delete_object.py
@@ -26,14 +26,10 @@
 #  PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN delete_object -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
 #
 
-import sys
 import time
-import os
 
-sys.path.insert(0, "bin/python")
 
 from ldb import (
-    SCOPE_BASE,
     SCOPE_SUBTREE
     )
 
@@ -44,8 +40,16 @@ class DrsDeleteObjectTestCase(drs_base.DrsBaseTestCase):
 
     def setUp(self):
         super(DrsDeleteObjectTestCase, self).setUp()
+        # 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)
+        # disable automatic replication temporary
+        self._disable_inbound_repl(self.dnsname_dc1)
+        self._disable_inbound_repl(self.dnsname_dc2)
 
     def tearDown(self):
+        self._enable_inbound_repl(self.dnsname_dc1)
+        self._enable_inbound_repl(self.dnsname_dc2)
         super(DrsDeleteObjectTestCase, self).tearDown()
 
     def _make_username(self):
@@ -78,15 +82,6 @@ class DrsDeleteObjectTestCase(drs_base.DrsBaseTestCase):
             self.assertEquals(user_orig["dn"], user_cur["dn"])
             self.assertTrue(dodn not in str(user_cur["dn"]))
 
-    def test_NetReplicateCmd(self):
-        """Triggers replication from DC1 to DC2
-           and vice versa so both DCs are synchronized
-           before test_ReplicateDeteleteObject test"""
-        # replicate Domain NC on DC2 from DC1
-        self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1)
-        # replicate Domain NC on DC1 from DC2
-        self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2)
-
     def test_ReplicateDeteleteObject(self):
         """Verifies how a deleted-object is replicated between two DCs.
            This test should verify that:
@@ -112,38 +107,26 @@ class DrsDeleteObjectTestCase(drs_base.DrsBaseTestCase):
         self._check_user(sam_ldb=self.ldb_dc1, user_orig=user_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
-        self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1)
+        self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, forced=True)
 
         # delete user on DC1
         self.ldb_dc1.delete(user_dn)
         # check user info on DC1 - should be deleted
         self._check_user(sam_ldb=self.ldb_dc1, user_orig=user_orig, is_deleted=True)
         # check user info on DC2 - should be valid user
-        try:
-            self._check_user(sam_ldb=self.ldb_dc2, user_orig=user_orig, is_deleted=False)
-        except self.failureException:
-            print ("Checking for not isDeleted user on %s failed, "
-                   "probably because a replication took place. "
-                   "Ideally we should block automatic replications during this test, "
-                   "but until then, just ignore the error" % self.dnsname_dc2)
+        self._check_user(sam_ldb=self.ldb_dc2, user_orig=user_orig, is_deleted=False)
 
         # trigger replication from DC2 to DC1
         # to check if deleted object gets restored
-        self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2)
+        self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2, forced=True)
         # check user info on DC1 - should be deleted
         self._check_user(sam_ldb=self.ldb_dc1, user_orig=user_orig, is_deleted=True)
         # check user info on DC2 - should be valid user
-        try:
-            self._check_user(sam_ldb=self.ldb_dc2, user_orig=user_orig, is_deleted=False)
-        except self.failureException:
-            print ("Checking for not isDeleted user on %s failed, "
-                   "probably because a replication took place. "
-                   "Ideally we should block automatic replications during this test, "
-                   "but until then, just ignore the error" % self.dnsname_dc2)
+        self._check_user(sam_ldb=self.ldb_dc2, user_orig=user_orig, is_deleted=False)
 
         # trigger replication from DC1 to DC2
         # to check if deleted object is replicated
-        self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1)
+        self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1, forced=True)
         # check user info on DC1 - should be deleted
         self._check_user(sam_ldb=self.ldb_dc1, user_orig=user_orig, is_deleted=True)
         # check user info on DC2 - should be deleted
diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py
index 56d1ebe..8e48b92 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/repl_schema.py b/source4/torture/drs/python/repl_schema.py
index 4a8a5be..166a0eb 100644
--- a/source4/torture/drs/python/repl_schema.py
+++ b/source4/torture/drs/python/repl_schema.py
@@ -27,15 +27,8 @@
 #  PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN repl_schema -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
 #
 
-import sys
 import time
 import random
-import os
-
-sys.path.insert(0, "bin/python")
-import samba
-samba.ensure_external_module("testtools", "testtools")
-samba.ensure_external_module("subunit", "subunit/python")
 
 from ldb import (
     ERR_NO_SUCH_OBJECT,
diff --git a/source4/torture/drs/python/replica_sync.py b/source4/torture/drs/python/replica_sync.py
index 5410ed6..ddeb582 100644
--- a/source4/torture/drs/python/replica_sync.py
+++ b/source4/torture/drs/python/replica_sync.py
@@ -27,23 +27,9 @@
 #  PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN replica_sync -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD"
 #
 
-import sys
-import time
-import random
-import os
-
 import drs_base
 import samba.tests
 
-from ldb import (
-    ERR_NO_SUCH_OBJECT,
-    LdbError,
-    SCOPE_BASE,
-    Message,
-    FLAG_MOD_ADD,
-    FLAG_MOD_REPLACE,
-    )
-
 
 class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
     """Intended as a black box test case for DsReplicaSync
@@ -58,18 +44,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)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list