1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-20 16:23:51 +03:00

s4-test: Use smb.conf path set in environment rather than using

command-line options.

This is the first step towards supporting custom test runners.
This commit is contained in:
Jelmer Vernooij
2010-06-13 16:38:24 +02:00
parent 46037a8160
commit 51058213cb
9 changed files with 47 additions and 43 deletions

View File

@@ -22,6 +22,7 @@
import os
import ldb
import samba
from samba import param
import tempfile
import unittest
@@ -90,14 +91,20 @@ class LdbExtensionTests(TestCaseInTempDir):
os.unlink(path)
cmdline_loadparm = None
def env_loadparm():
lp = param.LoadParm()
try:
lp.load(os.environ["SMB_CONF_PATH"])
except KeyError:
raise Exception("SMB_CONF_PATH not set")
return lp
cmdline_credentials = None
class RpcInterfaceTestCase(unittest.TestCase):
def get_loadparm(self):
assert cmdline_loadparm is not None
return cmdline_loadparm
return env_loadparm()
def get_credentials(self):
return cmdline_credentials