Fix samdb test and enable it.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 29 May 2008 15:38:12 +0000 (17:38 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 29 May 2008 15:38:12 +0000 (17:38 +0200)
(This used to be commit 6b202d3780f8ff50e0bdfa4a749c43b5639e4880)

source4/samba4-skip
source4/scripting/python/samba/tests/samdb.py
source4/selftest/samba4_tests.sh

index 4ac35a3c786d6ed6016dd79cbaa00c4f55071c14..de572ed41ec5dfce7d013078220d8edf10311362 100644 (file)
@@ -49,6 +49,5 @@ samba4.ntvfs.cifs.raw.
 ^samba4.net.api.become.dc.*$                   # Fails
 nss.test                                               # Fails
 samba4.samba3sam.python                # Conversion from EJS not yet finished
-samba4.samdb.python                    # Not finished yet
 raw.offline                    # Samba 4 doesn't have much offline support yet
 winreg*  #Does not authenticate against the target server
index a022d7bb514eefb655dbed9e76beee9eee5e6c8d..7e8ba053d44a42f50bad7f23ef9a3487370b9b84 100644 (file)
@@ -19,7 +19,7 @@
 from samba.auth import system_session
 from samba.credentials import Credentials
 import os
-from samba.provision import setup_samdb, guess_names
+from samba.provision import setup_samdb, guess_names, setup_templatesdb
 from samba.samdb import SamDB
 from samba.tests import cmdline_loadparm, TestCaseInTempDir
 from samba import security
@@ -42,12 +42,16 @@ class SamDBTestCase(TestCaseInTempDir):
         domainsid = security.random_sid()
         hostguid = str(uuid.uuid4())
         path = os.path.join(self.tempdir, "samdb.ldb")
+        session_info = system_session()
         names = guess_names(lp=cmdline_loadparm, hostname="foo", 
                             domain="EXAMPLE.COM", dnsdomain="example.com", 
                             serverrole="domain controller", 
                             domaindn=self.domaindn, configdn=configdn, 
                             schemadn=schemadn)
-        self.samdb = setup_samdb(path, setup_path, system_session(), creds, 
+        setup_templatesdb(os.path.join(self.tempdir, "templates.ldb"), 
+                          setup_path, session_info=session_info, 
+                          credentials=creds, lp=cmdline_loadparm)
+        self.samdb = setup_samdb(path, setup_path, session_info, creds, 
                                  cmdline_loadparm, names, 
                                  lambda x: None, domainsid, 
                                  "# no aci", domainguid, 
index 1771a0da5cd1b806280d10328d359e6fbe90f82b..9693451c471c628c9d1d3d3b403a21f6fcb1c43e 100755 (executable)
@@ -340,8 +340,8 @@ plantest "provision.python" none $SUBUNITRUN samba.tests.provision
 plantest "samba3.python" none $SUBUNITRUN samba.tests.samba3
 plantest "samr.python" dc $SUBUNITRUN samba.tests.dcerpc.sam
 plantest "dcerpc.bare.python" dc $SUBUNITRUN samba.tests.dcerpc.bare
-plantest "samdb.python" dc $SUBUNITRUN samba.tests.samdb
 plantest "unixinfo.python" dc $SUBUNITRUN samba.tests.dcerpc.unix
+plantest "samdb.python" none $SUBUNITRUN samba.tests.samdb
 plantest "events.python" none PYTHONPATH="$PYTHONPATH:lib/events" $SUBUNITRUN tests
 plantest "messaging.python" none PYTHONPATH="$PYTHONPATH:lib/messaging/tests" $SUBUNITRUN bindings
 plantest "samba3sam.python" none PYTHONPATH="$PYTHONPATH:dsdb/samdb/ldb_modules/tests" $SUBUNITRUN samba3sam