[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha6-813-g082ba6a
Jelmer Vernooij
jelmer at samba.org
Thu Feb 12 15:01:07 GMT 2009
The branch, master has been updated
via 082ba6a1ad3a68aff118d96f855a2aa65eaeb359 (commit)
via 762fdc8c5c2db304f3dc4536c19d69366d1399df (commit)
via 7048e75aeebc4d033c4e8425c364fe2e3e84f27b (commit)
via be9a4157f050f0b54fd369181ee273029c0f81fc (commit)
from 4f6d1728254c8503e71c6fdd008fb7264dec26c5 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 082ba6a1ad3a68aff118d96f855a2aa65eaeb359
Merge: 762fdc8c5c2db304f3dc4536c19d69366d1399df 4f6d1728254c8503e71c6fdd008fb7264dec26c5
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Feb 12 16:00:46 2009 +0100
Merge branch 'master' of ssh://git.samba.org/data/git/samba
commit 762fdc8c5c2db304f3dc4536c19d69366d1399df
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Feb 12 16:00:11 2009 +0100
Provide a SamDB TestCase-class that can be used by OpenChange.
commit 7048e75aeebc4d033c4e8425c364fe2e3e84f27b
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Feb 12 15:58:11 2009 +0100
Use created loadparm context, rather than the one specified on the command-line.
commit be9a4157f050f0b54fd369181ee273029c0f81fc
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Wed Feb 11 19:04:33 2009 +0100
Catch specific exceptions, rather than catching everything, which might hide other exceptions silently.
-----------------------------------------------------------------------
Summary of changes:
source4/scripting/python/samba/provision.py | 6 +++---
source4/scripting/python/samba/tests/samdb.py | 14 ++++++++++++--
2 files changed, 15 insertions(+), 5 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index d77b487..10daf1b 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -454,7 +454,7 @@ def setup_samdb_partitions(samdb_path, setup_path, message, lp, session_info,
credentials=credentials, lp=lp)
# Wipes the database
samdb.erase()
- except:
+ except LdbError:
os.unlink(samdb_path)
samdb = SamDB(samdb_path, session_info=session_info,
credentials=credentials, lp=lp)
@@ -647,7 +647,7 @@ def setup_templatesdb(path, setup_path, session_info, credentials, lp):
# Wipes the database
try:
templates_ldb.erase()
- except:
+ except LdbError:
os.unlink(path)
templates_ldb.load_ldif_file_add(setup_path("provision_templates_init.ldif"))
@@ -1222,7 +1222,7 @@ def provision_backend(setup_dir=None, message=None,
schemadb_path = os.path.join(paths.ldapdir, "schema-tmp.ldb")
try:
os.unlink(schemadb_path)
- except:
+ except OSError:
pass
schemadb = Ldb(schemadb_path, lp=lp)
diff --git a/source4/scripting/python/samba/tests/samdb.py b/source4/scripting/python/samba/tests/samdb.py
index 434d7a7..d0b95cf 100644
--- a/source4/scripting/python/samba/tests/samdb.py
+++ b/source4/scripting/python/samba/tests/samdb.py
@@ -21,13 +21,19 @@ from samba.credentials import Credentials
import os
from samba.provision import setup_samdb, guess_names, setup_templatesdb, make_smbconf, find_setup_dir
from samba.samdb import SamDB
-from samba.tests import cmdline_loadparm, TestCaseInTempDir
+from samba.tests import TestCaseInTempDir
from samba.dcerpc import security
from unittest import TestCase
import uuid
from samba import param
+
class SamDBTestCase(TestCaseInTempDir):
+ """Base-class for tests with a Sam Database.
+
+ This is used by the Samba SamDB-tests, but e.g. also by the OpenChange
+ provisioning tests (which need a Sam).
+ """
def setup_path(self, relpath):
return os.path.join(find_setup_dir(), relpath)
@@ -69,7 +75,7 @@ class SamDBTestCase(TestCaseInTempDir):
self.setup_path, session_info=session_info,
credentials=creds, lp=self.lp)
self.samdb = setup_samdb(path, self.setup_path, session_info, creds,
- cmdline_loadparm, names,
+ self.lp, names,
lambda x: None, domainsid,
"# no aci", domainguid,
policyguid, False, "secret",
@@ -82,6 +88,10 @@ class SamDBTestCase(TestCaseInTempDir):
os.remove(os.path.join(self.tempdir, f))
super(SamDBTestCase, self).tearDown()
+
+class SamDBTests(SamDBTestCase):
+ """Tests for the SamDB implementation."""
+
def test_add_foreign(self):
self.samdb.add_foreign(self.domaindn, "S-1-5-7", "Somedescription")
--
Samba Shared Repository
More information about the samba-cvs
mailing list