summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-05-07 04:22:36 +0400
committerJelmer Vernooij <jelmer@samba.org>2010-06-20 00:43:08 +0200
commit8ff65b0136f442204f4d059fb1a13ad4a6419ab4 (patch)
treee542b213c6195caf868db316a86b1e7a922ac4b8 /source4/scripting/python
parent9c808c47fc2fddac396d12452428443f3ab26073 (diff)
downloadsamba-8ff65b0136f442204f4d059fb1a13ad4a6419ab4.tar.gz
samba-8ff65b0136f442204f4d059fb1a13ad4a6419ab4.tar.bz2
samba-8ff65b0136f442204f4d059fb1a13ad4a6419ab4.zip
s4 python: Update unit tests related to create secrets
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/tests/provision.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index dd18aa0ff6..b5cc57c4d9 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -27,6 +27,19 @@ def setup_path(file):
return os.path.join(setup_dir, file)
+def create_dummy_secretsdb(path, lp=None):
+ """Create a dummy secrets database for use in tests.
+
+ :param path: Path to store the secrets db
+ :param lp: Optional loadparm context. A simple one will
+ be generated if not specified.
+ """
+ if lp is None:
+ lp = env_loadparm()
+ secrets_ldb = setup_secretsdb(path, setup_path, None, None, lp=lp)
+ secrets_ldb.transaction_commit()
+ return secrets_ldb
+
class ProvisionTestCase(samba.tests.TestCaseInTempDir):
"""Some simple tests for individual functions in the provisioning code.
"""