[PATCH] fix ctdb autotest when recent socket-wrapper is installed in the system

Michael Adam obnox at samba.org
Fri Jul 8 11:53:33 UTC 2016


Hi all,

With current code, when a recent version of socket-wrapper is
installed in the syste, ctdb autotest fails, because the
ctdb/wscript has a hardcoded location to the socket-wrapper
lib for preloading, irrespective of whether socket-wrapper is
built or used from the system.

Attached patch fixes this.  Please review!

Cheers - Michael

-------------- next part --------------
From 3c598cbee262b6f91bf736d22f11dc302af3decd Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 21 Jun 2016 09:50:53 +0200
Subject: [PATCH] ctdb: fix autotest with socket-wrapper installed in the
 system

Signed-off-by: Michael Adam <obnox at samba.org>
---
 ctdb/wscript | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/ctdb/wscript b/ctdb/wscript
index 3eae066..9f0f1e1 100755
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -107,6 +107,16 @@ 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')
+        using_system_socket_wrapper = conf.CONFIG_GET('USING_SYSTEM_SOCKET_WRAPPER')
+        if not using_system_socket_wrapper and conf.env.standalone_ctdb:
+            #
+            # We need to override the path here, as otherwise the 'ctdb' subdir
+            # is missing. This is because the socket_wrapper wscript constructs
+            # the path from the conf.srcdir, and this is not populated from the
+            # the cwd but from the location of waf.
+            #
+            conf.env.SOCKET_WRAPPER_SO_PATH = '%s/bin/shared/libsocket-wrapper.so' % os.getcwd()
 
     conf.CHECK_HEADERS('sched.h')
     conf.CHECK_HEADERS('procinfo.h')
@@ -816,7 +826,8 @@ def test(ctx):
 
 
 def autotest(ctx):
-    ld = 'LD_PRELOAD=%s/bin/shared/libsocket-wrapper.so' % os.getcwd()
+    env = samba_utils.LOAD_ENVIRONMENT()
+    ld = 'LD_PRELOAD=%s' % env.SOCKET_WRAPPER_SO_PATH
     cmd = '%s tests/run_tests.sh -e -S -C' % ld
     ret = samba_utils.RUN_COMMAND(cmd)
     if ret != 0:
-- 
2.5.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160708/2832970f/signature.sig>


More information about the samba-technical mailing list