summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-02-11 18:17:00 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-02-11 18:17:00 +0100
commitd9e94bf33681dda2b9fad5efa3226e5d818fab6b (patch)
treedfc194c463af14b3f2ac521e5d7405deac60db56 /source4/scripting
parentf13895851fde13cefaa484cd9f90a9f0ad41d78e (diff)
downloadsamba-d9e94bf33681dda2b9fad5efa3226e5d818fab6b.tar.gz
samba-d9e94bf33681dda2b9fad5efa3226e5d818fab6b.tar.bz2
samba-d9e94bf33681dda2b9fad5efa3226e5d818fab6b.zip
Make it possible to override the setup path.
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/tests/samdb.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/source4/scripting/python/samba/tests/samdb.py b/source4/scripting/python/samba/tests/samdb.py
index 161f9f4f65..8b8f178bc4 100644
--- a/source4/scripting/python/samba/tests/samdb.py
+++ b/source4/scripting/python/samba/tests/samdb.py
@@ -29,6 +29,9 @@ from samba import param
class SamDBTestCase(TestCaseInTempDir):
+ def setup_path(self, relpath):
+ return os.path.join("setup", relpath)
+
def setUp(self):
super(SamDBTestCase, self).setUp()
invocationid = str(uuid.uuid4())
@@ -38,7 +41,6 @@ class SamDBTestCase(TestCaseInTempDir):
schemadn = "CN=Schema," + configdn
domainguid = str(uuid.uuid4())
policyguid = str(uuid.uuid4())
- setup_path = lambda x: os.path.join("setup", x)
creds = Credentials()
creds.set_anonymous()
domainsid = security.random_sid()
@@ -52,21 +54,21 @@ class SamDBTestCase(TestCaseInTempDir):
serverrole="domain controller"
smbconf = os.path.join(self.tempdir, "smb.conf")
- make_smbconf(smbconf, setup_path, hostname, domain, dnsdomain, serverrole,
- self.tempdir)
+ make_smbconf(smbconf, self.setup_path, hostname, domain, dnsdomain,
+ serverrole, self.tempdir)
- lp = param.LoadParm()
- lp.load(smbconf)
+ self.lp = param.LoadParm()
+ self.lp.load(smbconf)
- names = guess_names(lp=lp, hostname=hostname,
+ names = guess_names(lp=self.lp, hostname=hostname,
domain=domain, dnsdomain=dnsdomain,
serverrole=serverrole,
domaindn=self.domaindn, configdn=configdn,
schemadn=schemadn)
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,
+ 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,
lambda x: None, domainsid,
"# no aci", domainguid,