]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb:tests:repack: use common api_base variables
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 17 Aug 2024 06:09:11 +0000 (18:09 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 24 Sep 2024 09:14:38 +0000 (09:14 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/ldb/tests/python/repack.py

index 0844cd24e58b1d7cb4aef43dbd69e042dc0a64b9..3a7d18601cb4913a887d735ee1d9f2d97cee657e 100644 (file)
@@ -2,18 +2,14 @@ import os
 from unittest import TestCase
 import shutil
 from subprocess import check_output
+import sys
+sys.path.insert(0, "bin/python")
 import ldb
 
-TDB_PREFIX = "tdb://"
-MDB_PREFIX = "mdb://"
-
-def tempdir():
-    import tempfile
-    try:
-        dir_prefix = os.path.join(os.environ["SELFTEST_PREFIX"], "tmp")
-    except KeyError:
-        dir_prefix = None
-    return tempfile.mkdtemp(dir=dir_prefix)
+from api_base import (
+    TDB_PREFIX,
+    tempdir,
+)
 
 
 # Check enabling and disabling GUID indexing works and that the database is
@@ -200,5 +196,4 @@ class GUIDIndexAndPackFormatTests(TestCase):
 if __name__ == '__main__':
     import unittest
 
-
     unittest.TestProgram()