From ab379ddd516bf2b77ccf77f542faf6e694ab5d4d Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Thu, 18 Nov 2010 21:42:26 +0200 Subject: 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 Autobuild-Date: Thu Nov 18 23:11:18 CET 2010 on sn-devel-104 --- source4/lib/ldb/tests/python/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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): -- cgit