TODO: ctdb: fix autotest with socket-wrapper installed in the system
authorMichael Adam <obnox@samba.org>
Tue, 21 Jun 2016 07:50:53 +0000 (09:50 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 8 Jul 2016 11:46:46 +0000 (13:46 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
ctdb/wscript

index 3eae06653dd759fd3add75f965cb5226812ed437..73a897114450c5a35dff58ada1ec2ad8546d2086 100755 (executable)
@@ -107,6 +107,7 @@ def configure(conf):
     conf.RECURSE('lib/tdb')
     if conf.env.standalone_ctdb or conf.CONFIG_GET('ENABLE_SELFTEST'):
         conf.RECURSE('lib/socket_wrapper')
+        conf.env.SOCKET_WRAPPER_SO_PATH = conf.CONFIG_GET('LIBSOCKET_WRAPPER_SO_PATH')
 
     conf.CHECK_HEADERS('sched.h')
     conf.CHECK_HEADERS('procinfo.h')
@@ -816,7 +817,15 @@ def test(ctx):
 
 
 def autotest(ctx):
-    ld = 'LD_PRELOAD=%s/bin/shared/libsocket-wrapper.so' % os.getcwd()
+    env = samba_utils.LOAD_ENVIRONMENT()
+    swrap_so_path = env.SOCKET_WRAPPER_SO_PATH
+    if not swrap_so_path:
+        swrap_so_path = "libsocket-wrapper.so"
+    elif env.standalone_ctdb:
+        # Need to override the path here, otherwise the 'ctdb' subdir is
+        # missing and I don't know why...
+        swrap_so_path = '%s/bin/shared/libsocket-wrapper.so' % os.getcwd()
+    ld = 'LD_PRELOAD=%s' % swrap_so_path
     cmd = '%s tests/run_tests.sh -e -S -C' % ld
     ret = samba_utils.RUN_COMMAND(cmd)
     if ret != 0: