1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-23 20:59:10 +03:00

s4-test: fixed setup/ assumption for top level build

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andrew Tridgell
2011-02-03 17:35:54 +11:00
parent 3bcb693e27
commit 677f28d8b2
3 changed files with 13 additions and 6 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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):