summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-11-18 21:42:26 +0200
committerKamen Mazdrashki <kamenim@samba.org>2010-11-18 23:11:18 +0100
commitab379ddd516bf2b77ccf77f542faf6e694ab5d4d (patch)
tree177cbf38c5da5f79801b56e3d855ca9400555dd6
parent05c0bface19e8dfb395da82de6b889744768f8c6 (diff)
downloadsamba-ab379ddd516bf2b77ccf77f542faf6e694ab5d4d.tar.gz
samba-ab379ddd516bf2b77ccf77f542faf6e694ab5d4d.tar.bz2
samba-ab379ddd516bf2b77ccf77f542faf6e694ab5d4d.zip
s4-ldb.python: Use $SELFTEST_PREFIX/tmp as a temporary directory for testing
This way we won't flood /tmp directory with temp files Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Thu Nov 18 23:11:18 CET 2010 on sn-devel-104
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index b5585dcd3d..31d1319631 100755
--- a/source4/lib/ldb/tests/python/api.py
+++ b/source4/lib/ldb/tests/python/api.py
@@ -9,7 +9,12 @@ import ldb
def filename():
- return os.tempnam()
+ import tempfile
+ try:
+ dir_prefix = os.path.join(os.environ["SELFTEST_PREFIX"], "tmp")
+ except KeyError:
+ dir_prefix = None
+ return tempfile.mktemp(dir=dir_prefix)
class NoContextTests(unittest.TestCase):