[PATCH] Fix executil of talloc unittest from tarball

Lukas Slebodnik lslebodn at redhat.com
Mon Jul 3 15:45:20 UTC 2017


ehlo,

attached patches fix execution on talloc unittest with "make check" outside
of samba git directory.

It is mostly useful for downstream distributions which use talloc from
tarballs.

LS
-------------- next part --------------
From 07e9cd67b9a97292b9dfac7ebf02c98d9da5dec9 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Mon, 3 Jul 2017 16:09:34 +0200
Subject: [PATCH 1/2] talloc: Use libraries from build dir for testsuite

There was a failure when tests were executed after after extracting
talloc tarball.

  sh$ make -j8 check
  WAF_MAKE=1 PATH=buildtools/bin:../../buildtools/bin:$PATH waf test
  bin/talloc_testsuite: error while loading shared libraries: libtalloc.so.2: cannot open shared object file: No such file or directory
  sh: ./lib/talloc/test_magic_differs.sh: No such file or directory
  Traceback (most recent call last):
    File "test_pytalloc.py", line 11, in <module>
      import talloc
  ImportError: libtalloc.so.2: cannot open shared object file: No such file or directory

Signed-off-by: Lukas Slebodnik <lslebodn at redhat.com>
---
 lib/talloc/wscript | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index df7e6be55939a1aa9004e2decb65768387fb4b60..90839ad8f69a587051bc9cb75dcb4ca7eb837314 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -171,6 +171,10 @@ def build(bld):
 def test(ctx):
     '''run talloc testsuite'''
     import Utils, samba_utils
+
+    samba_utils.ADD_LD_LIBRARY_PATH('bin/shared')
+    samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
+
     cmd = os.path.join(Utils.g_module.blddir, 'talloc_testsuite')
     ret = samba_utils.RUN_COMMAND(cmd)
     print("testsuite returned %d" % ret)
-- 
2.13.0


From c4517b32af55a1cd7f4204669ba7d024b75bb280 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Mon, 3 Jul 2017 16:17:44 +0200
Subject: [PATCH 2/2] talloc: Fix execution of test_magic_differs from tarball

make check failed in case of tarball because test_magic_differs.sh
is in top level directory and not in sub-directory lib/talloc

  sh: ./lib/talloc/test_magic_differs.sh: No such file or directory
  magic differs test returned 127

Signed-off-by: Lukas Slebodnik <lslebodn at redhat.com>
---
 lib/talloc/wscript | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 90839ad8f69a587051bc9cb75dcb4ca7eb837314..09f780b48b29e5d75d0fe4380ff3680074cb71c9 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -181,6 +181,8 @@ def test(ctx):
     magic_helper_cmd = os.path.join(Utils.g_module.blddir, 'talloc_test_magic_differs_helper')
     magic_cmd = os.path.join(srcdir, 'lib', 'talloc',
                              'test_magic_differs.sh')
+    if not os.path.exists(magic_cmd):
+        magic_cmd = os.path.join(srcdir, 'test_magic_differs.sh')
 
     magic_ret = samba_utils.RUN_COMMAND(magic_cmd + " " +  magic_helper_cmd)
     print("magic differs test returned %d" % magic_ret)
-- 
2.13.0



More information about the samba-technical mailing list