summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-11 13:20:24 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-11 13:20:24 +0100
commitaf007e5837ac472f0527505c8013b837932136bc (patch)
treefd9e77183c39ce6ed5ed01f3c83262d07691048c /source4/scripting
parente4165448d778db1721b1c7670b25ae3e40917d86 (diff)
downloadsamba-af007e5837ac472f0527505c8013b837932136bc.tar.gz
samba-af007e5837ac472f0527505c8013b837932136bc.tar.bz2
samba-af007e5837ac472f0527505c8013b837932136bc.zip
Use SMB_CONF_PATH environment variable inside tests rather than hardcoded paths.
(This used to be commit eb04de69c0e319e18b148191946808f81e1cc8c4)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/tests/__init__.py6
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/registry.py4
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/rpcecho.py5
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/sam.py3
-rw-r--r--source4/scripting/python/samba/tests/provision.py3
5 files changed, 13 insertions, 8 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index 9402002674..c8673d3fae 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -84,3 +84,9 @@ class LdbExtensionTests(TestCaseInTempDir):
del l
os.unlink(path)
+
+def get_loadparm():
+ import param
+ lp = param.LoadParm()
+ lp.load(os.getenv("SMB_CONF_PATH"))
+ return lp
diff --git a/source4/scripting/python/samba/tests/dcerpc/registry.py b/source4/scripting/python/samba/tests/dcerpc/registry.py
index f3f0b0fb1a..147acc5098 100644
--- a/source4/scripting/python/samba/tests/dcerpc/registry.py
+++ b/source4/scripting/python/samba/tests/dcerpc/registry.py
@@ -20,11 +20,11 @@
import winreg
from param import LoadParm
import unittest
+from samba.tests import get_loadparm
class WinregTests(unittest.TestCase):
def setUp(self):
- lp_ctx = LoadParm()
- lp_ctx.load("st/client/client.conf")
+ lp_ctx = get_loadparm()
self.conn = winreg.winreg("ncalrpc:", lp_ctx)
def get_hklm(self):
diff --git a/source4/scripting/python/samba/tests/dcerpc/rpcecho.py b/source4/scripting/python/samba/tests/dcerpc/rpcecho.py
index 52c2bb8c72..8c1a8bec71 100644
--- a/source4/scripting/python/samba/tests/dcerpc/rpcecho.py
+++ b/source4/scripting/python/samba/tests/dcerpc/rpcecho.py
@@ -18,13 +18,12 @@
#
import echo
-from param import LoadParm
import unittest
+from samba.tests import get_loadparm
class RpcEchoTests(unittest.TestCase):
def setUp(self):
- lp_ctx = LoadParm()
- lp_ctx.load("st/client/client.conf")
+ lp_ctx = get_loadparm()
self.conn = echo.rpcecho("ncalrpc:", lp_ctx)
def test_addone(self):
diff --git a/source4/scripting/python/samba/tests/dcerpc/sam.py b/source4/scripting/python/samba/tests/dcerpc/sam.py
index 50caaf2348..96348f2f69 100644
--- a/source4/scripting/python/samba/tests/dcerpc/sam.py
+++ b/source4/scripting/python/samba/tests/dcerpc/sam.py
@@ -19,10 +19,11 @@
import samr
import unittest
+from samba.tests import get_loadparm
class SamrTests(unittest.TestCase):
def setUp(self):
- self.conn = samr.samr("ncalrpc:", "st/client/client.conf")
+ self.conn = samr.samr("ncalrpc:", get_loadparm())
def test_connect5(self):
(level, info, handle) = self.conn.Connect5(None, 0, 1, samr.ConnectInfo1())
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index 54a7782b3d..514582cbe4 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -24,8 +24,7 @@ from ldb import Dn
import param
import unittest
-lp = param.LoadParm()
-lp.load("st/dc/etc/smb.conf")
+lp = samba.tests.get_loadparm()
setup_dir = "setup"
def setup_path(file):