summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/tests/provision.py4
-rw-r--r--source4/scripting/python/samba/tests/samba3.py7
-rw-r--r--source4/scripting/python/samba/tests/samba3sam.py8
3 files changed, 13 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index 29287ff3f2..f6a5571840 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -20,11 +20,11 @@
"""Tests for samba.provision."""
import os
-from samba.provision import setup_secretsdb, findnss, ProvisionPaths
+from samba.provision import setup_secretsdb, findnss, ProvisionPaths, find_setup_dir
import samba.tests
from samba.tests import env_loadparm, TestCase
-setup_dir = "setup"
+setup_dir = find_setup_dir()
def setup_path(file):
return os.path.join(setup_dir, file)
diff --git a/source4/scripting/python/samba/tests/samba3.py b/source4/scripting/python/samba/tests/samba3.py
index c55de8b521..3a4b851c75 100644
--- a/source4/scripting/python/samba/tests/samba3.py
+++ b/source4/scripting/python/samba/tests/samba3.py
@@ -26,8 +26,11 @@ from samba.samba3 import (WinsDatabase, SmbpasswdFile, ACB_NORMAL,
from samba.tests import TestCase
import os
-DATADIR = os.path.join(os.path.dirname(__file__),
- "../../../../../testdata/samba3")
+for p in [ "../../../../../testdata/samba3", "../../../../testdata/samba3" ]:
+ DATADIR = os.path.join(os.path.dirname(__file__), p)
+ if os.path.exists(DATADIR):
+ break
+
class RegistryTestCase(TestCase):
diff --git a/source4/scripting/python/samba/tests/samba3sam.py b/source4/scripting/python/samba/tests/samba3sam.py
index 59b6e5517c..a34f0f620c 100644
--- a/source4/scripting/python/samba/tests/samba3sam.py
+++ b/source4/scripting/python/samba/tests/samba3sam.py
@@ -31,10 +31,14 @@ import samba.dcerpc.security
import samba.ndr
from samba.auth import system_session
-datadir = os.path.join(os.path.dirname(__file__),
- "../../../../../testdata/samba3")
def read_datafile(filename):
+ paths = [ "../../../../../testdata/samba3",
+ "../../../../testdata/samba3" ]
+ for p in paths:
+ datadir = os.path.join(os.path.dirname(__file__), p)
+ if os.path.exists(datadir):
+ break
return open(os.path.join(datadir, filename), 'r').read()
def ldb_debug(l, text):