summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/python')
-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):