ldb: Use libraries from build dir for testsuite
authorLukas Slebodnik <lslebodn@redhat.com>
Mon, 3 Jul 2017 22:32:31 +0000 (00:32 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 4 Jul 2017 19:39:22 +0000 (21:39 +0200)
There was a failure when tests were executed after after extracting
ldb tarball.

  sh$ make -j8 check
  WAF_MAKE=1 PATH=buildtools/bin:../../buildtools/bin:$PATH waf test
  ldbadd: error while loading shared libraries: libldb.so.1: cannot open shared object file: No such file or directory
  cat: write error: Broken pipe
  Traceback (most recent call last):
    File "tests/python/api.py", line 10, in <module>
      import ldb
  ImportError: libldb.so.1: cannot open shared object file: No such file or directory
  Traceback (most recent call last):
    File "tests/python/api.py", line 10, in <module>
      import ldb
  ImportError: libpyldb-util.so.1: cannot open shared object file: No such file or directory
  bin/ldb_tdb_mod_op_test: error while loading shared libraries: libldb.so.1: cannot open shared object file: No such file or directory
  testsuite returned 1

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Alexander Bokovoy <ab@samba.org>
lib/ldb/wscript

index 6f36965204bb730aac0f94e62b7da2e519d8b767..7f81fe3f09803668dd04cfa8275a284cc89f8182 100644 (file)
@@ -358,7 +358,10 @@ def test(ctx):
     shutil.rmtree(test_prefix, ignore_errors=True)
     os.makedirs(test_prefix)
     os.environ['TEST_DATA_PREFIX'] = test_prefix
-    os.environ['LD_LIBRARY_PATH'] = Utils.g_module.blddir + '/bin/default/lib/ldb'
+    os.environ['LDB_MODULES_PATH'] = Utils.g_module.blddir + "/modules/ldb"
+    samba_utils.ADD_LD_LIBRARY_PATH('bin/shared')
+    samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
+
     cmd = 'tests/test-tdb.sh %s' % Utils.g_module.blddir
     ret = samba_utils.RUN_COMMAND(cmd)
     print("testsuite returned %d" % ret)
@@ -371,8 +374,6 @@ def test(ctx):
         extra_env={'SELFTEST_PREFIX': test_prefix})
     print("Python testsuite returned %d" % pyret)
 
-    os.environ['LDB_MODULES_PATH'] = Utils.g_module.blddir + '/modules/ldb'
-    os.environ['LD_LIBRARY_PATH'] = Utils.g_module.blddir + '/bin/default/lib/ldb'
     cmocka_ret = 0
     for test_exe in ['ldb_tdb_mod_op_test',
                      'ldb_msg_test']: