[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Thu Apr 8 15:21:32 MDT 2010


The branch, master has been updated
       via  7a6f1c7... s4-python: Fix formatting, use standard convention to call instance methods.
       via  ae6d306... s4-python: Cancel transaction properly in case of exceptions, fix formatting.
       via  57ac0a6... s4-python: Move load_partition_usn to dsdb module.
       via  dd4ef4e... s4-python: More cleanups.
       via  a35d876... s4-python: rename samba.glue to samba._glue to indicate it's private.
       via  cc6e2b8... s4-python: Fix formatting, import of FLG_NOSYNC.
       via  d7a46ee... s4-python: Simplify code, improve formatting.
       via  be4b688... s4-python: Remove obsolete and broken torture modules.
       via  19e1537... testr: Use waf test runner.
       via  d0c2515... selftest: Add --filtered-subunit option.
       via  ffb2449... selftest: Support --load-list option.
       via  b59ba79... s4-waf: Support --load-list option.
       via  4f2d8d6... s4-python: samdb: Default to using global schema.
      from  5d5fc92... s4:dsdb - Handle INVALID_DN_SYNTAX from OpenLDAP in dsdb_module_load_partition_usn().

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


- Log -----------------------------------------------------------------
commit 7a6f1c78429183bd22e4b3e82881ac3ce2e0a1a7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 23:18:17 2010 +0200

    s4-python: Fix formatting, use standard convention to call instance methods.

commit ae6d306c68aeb79280a950409352c76bad4fcd33
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 22:14:50 2010 +0200

    s4-python: Cancel transaction properly in case of exceptions, fix formatting.

commit 57ac0a6042c368a72beca3b48d0ae7210a9c999b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 22:07:42 2010 +0200

    s4-python: Move load_partition_usn to dsdb module.

commit dd4ef4e106d372cfadf7b47db8bf9dc25728b3bc
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 21:01:17 2010 +0200

    s4-python: More cleanups.

commit a35d876537eb301d75a254d9da97268d041da8d6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 20:34:40 2010 +0200

    s4-python: rename samba.glue to samba._glue to indicate it's private.

commit cc6e2b8a819c6a1da4e6214be9607aab2de270bb
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 20:28:11 2010 +0200

    s4-python: Fix formatting, import of FLG_NOSYNC.

commit d7a46ee129c455cba95126e9c0f409522127894e
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 18:57:09 2010 +0200

    s4-python: Simplify code, improve formatting.

commit be4b68817544b87d12a1dcd7d8b5c5d778872418
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 18:53:14 2010 +0200

    s4-python: Remove obsolete and broken torture modules.
    
    The functionality of these modules is already present in a more current
    form in other modules.

commit 19e1537fdfce58e9ce1bbaa293be4d00f0e0fda1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 16:49:24 2010 +0200

    testr: Use waf test runner.

commit d0c25157e9b96ce9855ecd632723423ea45ea8c0
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 16:48:33 2010 +0200

    selftest: Add --filtered-subunit option.

commit ffb2449a13504261d3c113fcd3891553ccd44ff1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 16:16:15 2010 +0200

    selftest: Support --load-list option.

commit b59ba79b959955a43d6749fe9670229fbb2a679f
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 15:24:33 2010 +0200

    s4-waf: Support --load-list option.

commit 4f2d8d6ace81c03fb0ff181ccfb0f3c2e02e2c45
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Apr 8 15:08:27 2010 +0200

    s4-python: samdb: Default to using global schema.

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

Summary of changes:
 selftest/selftest.pl                               |   46 ++-
 source4/.testr.conf                                |    4 +-
 source4/dsdb/config.mk                             |    2 +-
 source4/dsdb/pydsdb.c                              |   49 +++
 source4/dsdb/wscript_build                         |    2 +-
 source4/lib/ldb/pyldb.c                            |    9 +-
 source4/lib/ldb/tests/python/acl.py                |    6 +-
 source4/lib/ldb/tests/python/deletetest.py         |    5 +-
 source4/lib/ldb/tests/python/urgent_replication.py |   56 ++--
 source4/scripting/bin/samba_dnsupdate              |    9 +-
 source4/scripting/bin/upgradeprovision             |   43 ++-
 source4/scripting/python/config.mk                 |    8 +-
 source4/scripting/python/pyglue.c                  |   52 +---
 source4/scripting/python/samba/__init__.py         |   20 +-
 source4/scripting/python/samba/getopt.py           |    4 +-
 .../scripting/python/samba/netcmd/domainlevel.py   |   10 +-
 source4/scripting/python/samba/netcmd/dsacl.py     |   21 +-
 source4/scripting/python/samba/netcmd/fsmo.py      |   20 +-
 source4/scripting/python/samba/netcmd/ntacl.py     |    3 +-
 .../scripting/python/samba/netcmd/pwsettings.py    |    2 +-
 source4/scripting/python/samba/ntacls.py           |   41 ++-
 source4/scripting/python/samba/provision.py        |   99 +++--
 source4/scripting/python/samba/provisionbackend.py |  190 ++++-----
 .../scripting/python/samba/provisionexceptions.py  |   38 --
 source4/scripting/python/samba/samdb.py            |   15 +-
 source4/scripting/python/samba/schema.py           |   62 ++--
 source4/scripting/python/samba/torture/pytorture   |   51 ---
 source4/scripting/python/samba/torture/spoolss.py  |  437 --------------------
 .../scripting/python/samba/torture/torture_samr.py |  220 ----------
 .../scripting/python/samba/torture/torture_tdb.py  |   90 ----
 source4/scripting/python/samba/torture/winreg.py   |  165 --------
 source4/scripting/python/samba/upgradehelpers.py   |   91 ++--
 source4/scripting/python/wscript_build             |    2 +-
 source4/selftest/wscript                           |   13 +-
 source4/setup/provision                            |   16 +-
 35 files changed, 484 insertions(+), 1417 deletions(-)
 delete mode 100644 source4/scripting/python/samba/provisionexceptions.py
 delete mode 100755 source4/scripting/python/samba/torture/pytorture
 delete mode 100644 source4/scripting/python/samba/torture/spoolss.py
 delete mode 100755 source4/scripting/python/samba/torture/torture_samr.py
 delete mode 100755 source4/scripting/python/samba/torture/torture_tdb.py
 delete mode 100755 source4/scripting/python/samba/torture/winreg.py


Changeset truncated at 500 lines:

diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 634db92..fb2e1a8 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -150,6 +150,7 @@ my $opt_analyse_cmd = undef;
 my $opt_resetup_env = undef;
 my $opt_bindir = undef;
 my $opt_no_lazy_setup = undef;
+my $opt_load_list = undef;
 my @testlists = ();
 
 my $srcdir = ".";
@@ -223,9 +224,9 @@ sub expand_environment_strings($)
 	return $s;
 }
 
-sub run_testsuite($$$$$)
+sub run_testsuite($$$$$$)
 {
-	my ($envname, $name, $cmd, $i, $totalsuites) = @_;
+	my ($envname, $name, $cmd, $i, $totalsuites, $tests_to_run) = @_;
 	my $pcap_file = setup_pcap($name);
 
 	Subunit::start_testsuite($name);
@@ -357,7 +358,8 @@ my $result = GetOptions (
 		'resetup-environment' => \$opt_resetup_env,
 		'bindir:s' => \$opt_bindir,
 		'image=s' => \$opt_image,
-		'testlist=s' => \@testlists
+		'testlist=s' => \@testlists,
+		'load-list=s' => \$opt_load_list,
 	    );
 
 exit(1) if (not $result);
@@ -688,16 +690,45 @@ foreach my $fn (@testlists) {
 	}
 }
 
+my $restricted = undef;
+
+if ($opt_load_list) {
+	$restricted = [];
+	open(LOAD_LIST, "<$opt_load_list") or die("Unable to open $opt_load_list");
+	while (<LOAD_LIST>) { 
+		chomp; 
+		push (@$restricted, $_);
+	}
+	close(LOAD_LIST);
+}
+
 Subunit::progress($#available+1);
 Subunit::report_time(time());
 
-foreach (@available) {
-	my $name = $$_[0];
+my $individual_tests = undef;
+$individual_tests = {};
+
+foreach my $testsuite (@available) {
+	my $name = $$testsuite[0];
 	my $skipreason = skip($name);
 	if (defined($skipreason)) {
 		Subunit::skip_testsuite($name, $skipreason);
+	} elsif (defined($restricted)) {
+		# Find the testsuite for this test
+		my $match = 0;
+		foreach my $r (@$restricted) {
+			if ($r eq $name) {
+				$individual_tests->{$name} = [];
+				$match = 1;
+			} 
+			if ($r =~ /^$name\.(.*)$/) {
+				push(@{$individual_tests->{$name}}, $1);
+				$match = 1;
+			}
+		}
+		push(@todo, $testsuite) if ($match);
 	} else {
-		push(@todo, $_); 
+		push(@todo, $testsuite); 
 	}
 }
 
@@ -903,7 +934,8 @@ $envvarstr
 			next;
 		}
 
-		run_testsuite($envname, $name, $cmd, $i, $suitestotal);
+		run_testsuite($envname, $name, $cmd, $i, $suitestotal,
+				      ($individual_tests and $individual_tests->{$name}));
 
 		if (defined($opt_analyse_cmd)) {
 			system("$opt_analyse_cmd \"$name\"");
diff --git a/source4/.testr.conf b/source4/.testr.conf
index 0ddb369..9261b57 100644
--- a/source4/.testr.conf
+++ b/source4/.testr.conf
@@ -1,3 +1,3 @@
 [DEFAULT]
-test_command=make test-subunit-filtered TESTS="$IDLIST"
-test_id_list_default=
+test_command=../buildtools/bin/waf test --filtered-subunit
+test_id_option=--load-list $IDLIST
diff --git a/source4/dsdb/config.mk b/source4/dsdb/config.mk
index 69b7227..2bd19e9 100644
--- a/source4/dsdb/config.mk
+++ b/source4/dsdb/config.mk
@@ -109,6 +109,6 @@ DNS_UPDATE_SRV_OBJ_FILES = $(addprefix $(dsdbsrcdir)/dns/, \
 
 [PYTHON::python_dsdb]
 LIBRARY_REALNAME = samba/dsdb.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = SAMDB
+PRIVATE_DEPENDENCIES = SAMDB pyldb
 
 python_dsdb_OBJ_FILES = $(dsdbsrcdir)/pydsdb.o
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index cc75472..1d71c6b 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -251,6 +251,52 @@ static PyObject *py_dsdb_set_global_schema(PyObject *self, PyObject *args)
 	Py_RETURN_NONE;
 }
 
+static PyObject *py_dsdb_load_partition_usn(PyObject *self, PyObject *args)
+{
+	PyObject *py_dn, *py_ldb, *result;
+	struct ldb_dn *dn;
+	uint64_t highest_uSN, urgent_uSN;
+	struct ldb_context *ldb;
+	TALLOC_CTX *mem_ctx;
+	int ret;
+
+	mem_ctx = talloc_new(NULL);
+	if (mem_ctx == NULL) {
+	   PyErr_NoMemory();
+	   return NULL;
+	}
+
+	if (!PyArg_ParseTuple(args, "OO", &py_ldb, &py_dn)) {
+	   talloc_free(mem_ctx);
+	   return NULL;
+	}
+
+	PyErr_LDB_OR_RAISE(py_ldb, ldb);
+
+	if (!PyObject_AsDn(mem_ctx, py_dn, ldb, &dn)) {
+	   talloc_free(mem_ctx);
+	   return NULL;
+	}
+
+	ret = dsdb_load_partition_usn(ldb, dn, &highest_uSN, &urgent_uSN);
+	if (ret != LDB_SUCCESS) {
+	   char *errstr = talloc_asprintf(mem_ctx, "Failed to load partition uSN - %s", ldb_errstring(ldb));
+	   PyErr_SetString(PyExc_RuntimeError, errstr);
+	   talloc_free(mem_ctx);
+	   return NULL;
+	}
+
+	talloc_free(mem_ctx);
+
+	result = PyDict_New();
+
+	PyDict_SetItemString(result, "uSNHighest", PyInt_FromLong((uint64_t)highest_uSN));
+	PyDict_SetItemString(result, "uSNUrgent", PyInt_FromLong((uint64_t)urgent_uSN));
+
+
+	return result;
+}
+
 static PyMethodDef py_dsdb_methods[] = {
 	{ "samdb_server_site_name", (PyCFunction)py_samdb_server_site_name,
 		METH_VARARGS, "Get the server site name as a string"},
@@ -275,6 +321,9 @@ static PyMethodDef py_dsdb_methods[] = {
 		METH_VARARGS, "get the NTDS objectGUID as a string"},
 	{ "dsdb_set_global_schema", (PyCFunction)py_dsdb_set_global_schema,
 		METH_VARARGS, NULL },
+	{ "dsdb_load_partition_usn", (PyCFunction)py_dsdb_load_partition_usn,
+		METH_VARARGS,
+		"get uSNHighest and uSNUrgent from the partition @REPLCHANGED"},
 	{ NULL }
 };
 
diff --git a/source4/dsdb/wscript_build b/source4/dsdb/wscript_build
index 581c8ef..59672e0 100644
--- a/source4/dsdb/wscript_build
+++ b/source4/dsdb/wscript_build
@@ -51,6 +51,6 @@ bld.SAMBA_MODULE('DNS_UPDATE_SRV',
 
 bld.SAMBA_PYTHON('python_dsdb',
                  source='pydsdb.c',
-                 deps='SAMDB',
+                 deps='SAMDB pyldb',
                  realname='samba/dsdb.so'
                  )
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 737d3fb..ce149cc 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -2579,11 +2579,10 @@ void initldb(void)
 	PyModule_AddObject(m, "ERR_AFFECTS_MULTIPLE_DSAS", PyInt_FromLong(LDB_ERR_AFFECTS_MULTIPLE_DSAS));
 	PyModule_AddObject(m, "ERR_OTHER", PyInt_FromLong(LDB_ERR_OTHER));
 
-        PyModule_AddObject(m, "FLG_RDONLY", PyInt_FromLong(LDB_FLG_RDONLY));
-        PyModule_AddObject(m, "FLG_NOSYNC", PyInt_FromLong(LDB_FLG_NOSYNC));
-        PyModule_AddObject(m, "FLG_RECONNECT", PyInt_FromLong(LDB_FLG_RECONNECT));
-        PyModule_AddObject(m, "FLG_NOMMAP", PyInt_FromLong(LDB_FLG_NOMMAP));
-
+	PyModule_AddObject(m, "FLG_RDONLY", PyInt_FromLong(LDB_FLG_RDONLY));
+	PyModule_AddObject(m, "FLG_NOSYNC", PyInt_FromLong(LDB_FLG_NOSYNC));
+	PyModule_AddObject(m, "FLG_RECONNECT", PyInt_FromLong(LDB_FLG_RECONNECT));
+	PyModule_AddObject(m, "FLG_NOMMAP", PyInt_FromLong(LDB_FLG_NOMMAP));
 
 	PyModule_AddObject(m, "__docformat__", PyString_FromString("restructuredText"));
 
diff --git a/source4/lib/ldb/tests/python/acl.py b/source4/lib/ldb/tests/python/acl.py
index 4f320ee..37265ef 100755
--- a/source4/lib/ldb/tests/python/acl.py
+++ b/source4/lib/ldb/tests/python/acl.py
@@ -2,7 +2,6 @@
 # -*- coding: utf-8 -*-
 # This is unit with tests for LDAP access checks
 
-import getopt
 import optparse
 import sys
 import os
@@ -13,9 +12,8 @@ sys.path.append("bin/python")
 
 import samba.getopt as options
 
-from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL, SCOPE_BASE, LdbError
-from ldb import ERR_NO_SUCH_OBJECT, ERR_INVALID_DN_SYNTAX, ERR_UNWILLING_TO_PERFORM
-from ldb import ERR_INSUFFICIENT_ACCESS_RIGHTS
+from ldb import (
+    SCOPE_BASE, LdbError, ERR_NO_SUCH_OBJECT, ERR_INSUFFICIENT_ACCESS_RIGHTS)
 
 from samba.ndr import ndr_pack, ndr_unpack
 from samba.dcerpc import security
diff --git a/source4/lib/ldb/tests/python/deletetest.py b/source4/lib/ldb/tests/python/deletetest.py
index 55f34fa..44eb919 100755
--- a/source4/lib/ldb/tests/python/deletetest.py
+++ b/source4/lib/ldb/tests/python/deletetest.py
@@ -6,8 +6,9 @@ import sys
 import os
 
 sys.path.append("bin/python")
-sys.path.append("../lib/subunit/python")
-sys.path.append("../lib/testtools")
+import samba
+samba.ensure_external_module("subunit", "subunit")
+samba.ensure_external_module("testtools", "testtools")
 
 import samba.getopt as options
 
diff --git a/source4/lib/ldb/tests/python/urgent_replication.py b/source4/lib/ldb/tests/python/urgent_replication.py
index 41eae8d..0a8fd7d 100755
--- a/source4/lib/ldb/tests/python/urgent_replication.py
+++ b/source4/lib/ldb/tests/python/urgent_replication.py
@@ -14,8 +14,7 @@ import samba.getopt as options
 from samba.auth import system_session
 from ldb import (SCOPE_BASE, LdbError, ERR_NO_SUCH_OBJECT, Message,
     MessageElement, Dn, FLAG_MOD_REPLACE)
-from samba import Ldb
-from samba import glue
+from samba.samdb import SamDB
 
 from subunit.run import SubunitTestRunner
 import unittest
@@ -68,7 +67,7 @@ class UrgentReplicationTests(unittest.TestCase):
             "description":"nonurgenttest description"});
 
         # urgent replication should not be enabled when creating 
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should not be enabled when modifying
@@ -77,12 +76,12 @@ class UrgentReplicationTests(unittest.TestCase):
         m["description"] = MessageElement("new description", FLAG_MOD_REPLACE,
           "description")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should not be enabled when deleting
         self.delete_force(self.ldb, "cn=nonurgenttest,cn=users," + self.base_dn)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
 
@@ -105,7 +104,7 @@ instanceType: 4
 systemFlags: 33554432""", ["relax:0"]);
 
         # urgent replication should be enabled when creation
-        res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
+        res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should NOT be enabled when modifying
@@ -114,12 +113,12 @@ systemFlags: 33554432""", ["relax:0"]);
         m["options"] = MessageElement("0", FLAG_MOD_REPLACE,
           "options")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
+        res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should be enabled when deleting
         self.delete_force(self.ldb, "cn=NTDS Settings test,cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration," + self.base_dn)
-        res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
+        res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         self.delete_force(self.ldb, "cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration," + self.base_dn)
@@ -139,7 +138,7 @@ systemFlags: 33554432""", ["relax:0"]);
                       "systemFlags": "1"});
 
         # urgent replication should be enabled when creating
-        res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
+        res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should NOT be enabled when modifying
@@ -148,13 +147,13 @@ systemFlags: 33554432""", ["relax:0"]);
         m["systemFlags"] = MessageElement("0", FLAG_MOD_REPLACE,
           "systemFlags")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
+        res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
 
         # urgent replication should be enabled when deleting
         self.delete_force(self.ldb, "cn=test crossRef,CN=Partitions,CN=Configuration," + self.base_dn)
-        res = glue.dsdb_load_partition_usn(self.ldb, "cn=Configuration," + self.base_dn)
+        res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
 
@@ -183,7 +182,7 @@ name: test attributeSchema
 systemFlags: 0""", ["relax:0"]);
 
             # urgent replication should be enabled when creating
-            res = glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
+            res = self.ldb.load_partition_usn("cn=Schema,cn=Configuration," + self.base_dn)
             self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         except LdbError:
@@ -195,7 +194,7 @@ systemFlags: 0""", ["relax:0"]);
         m["lDAPDisplayName"] = MessageElement("updated test attributeSchema", FLAG_MOD_REPLACE,
           "lDAPDisplayName")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
+        res = self.ldb.load_partition_usn("cn=Schema,cn=Configuration," + self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
 
@@ -226,7 +225,7 @@ systemFlags: 16
 defaultHidingValue: TRUE""", ["relax:0"]);
 
             # urgent replication should be enabled when creating
-            res = glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
+            res = self.ldb.load_partition_usn("cn=Schema,cn=Configuration," + self.base_dn)
             self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         except LdbError:
@@ -238,7 +237,7 @@ defaultHidingValue: TRUE""", ["relax:0"]);
         m["lDAPDisplayName"] = MessageElement("updated test classSchema", FLAG_MOD_REPLACE,
           "lDAPDisplayName")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, "cn=Schema,cn=Configuration," + self.base_dn)
+        res = self.ldb.load_partition_usn("cn=Schema,cn=Configuration," + self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
 
@@ -255,7 +254,7 @@ defaultHidingValue: TRUE""", ["relax:0"]);
 
 
         # urgent replication should be enabled when creating
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should be enabled when modifying
@@ -264,12 +263,12 @@ defaultHidingValue: TRUE""", ["relax:0"]);
         m["currentValue"] = MessageElement("yyyyyyyy", FLAG_MOD_REPLACE,
           "currentValue")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should NOT be enabled when deleting 
         self.delete_force(self.ldb, "cn=test secret,cn=System," + self.base_dn)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
 
@@ -288,7 +287,7 @@ isCriticalSystemObject: TRUE
 rIDAvailablePool: 133001-1073741823""", ["relax:0"])
 
         # urgent replication should be enabled when creating
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should be enabled when modifying
@@ -297,12 +296,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
         m["systemFlags"] = MessageElement("0", FLAG_MOD_REPLACE,
           "systemFlags")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should NOT be enabled when deleting 
         self.delete_force(self.ldb, "CN=RID Manager test,CN=System," + self.base_dn)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
 
@@ -320,7 +319,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
             "description":"urgent attributes test description"});
 
         # urgent replication should NOT be enabled when creating
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should be enabled when modifying userAccountControl 
@@ -329,7 +328,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
         m["userAccountControl"] = MessageElement("0", FLAG_MOD_REPLACE,
           "userAccountControl")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should be enabled when modifying lockoutTime
@@ -338,7 +337,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
         m["lockoutTime"] = MessageElement("1", FLAG_MOD_REPLACE,
           "lockoutTime")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should be enabled when modifying pwdLastSet
@@ -347,7 +346,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
         m["pwdLastSet"] = MessageElement("1", FLAG_MOD_REPLACE,
           "pwdLastSet")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should NOT be enabled when modifying a not-urgent
@@ -357,12 +356,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
         m["description"] = MessageElement("updated urgent attributes test description",
                                           FLAG_MOD_REPLACE, "description")
         ldb.modify(m)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
         # urgent replication should NOT be enabled when deleting
         self.delete_force(self.ldb, "cn=user UrgAttr test,cn=users," + self.base_dn)
-        res = glue.dsdb_load_partition_usn(self.ldb, self.base_dn)
+        res = self.ldb.load_partition_usn(self.base_dn)
         self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
 
 
@@ -373,7 +372,8 @@ if not "://" in host:
         host = "ldap://%s" % host
 
 
-ldb = Ldb(host, credentials=creds, session_info=system_session(), lp=lp)
+ldb = SamDB(host, credentials=creds, session_info=system_session(), lp=lp,
+            global_schema=False)
 
 runner = SubunitTestRunner()
 rc = 0
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 73611c8..cebfae2 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -86,12 +86,7 @@ def get_credentials(lp):
         return
     creds = Credentials()
     creds.guess(lp)
-    try:
-        creds.set_machine_account(lp)
-    except:
-        print "Failed to set machine account"
-        raise
-


-- 
Samba Shared Repository


More information about the samba-cvs mailing list