talloc: Improve testsuite by avoiding path issues
authorAndrew Bartlett <abartlet@samba.org>
Mon, 22 Feb 2016 22:04:51 +0000 (11:04 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Mar 2016 00:58:26 +0000 (01:58 +0100)
We now rely on waf to tell us where the helper binary is.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/talloc/test_magic_differs.sh
lib/talloc/wscript

index 0f765f0e032dc9573c6c4ef28272a1009b1067b1..1b6ba2e4d4557b2d011150f967c964f433abb541 100755 (executable)
@@ -4,10 +4,12 @@
 
 echo "test: magic differs"
 
-if [
-       "`./talloc_test_magic_differs_helper`" != "`./talloc_test_magic_differs_helper`"
-]; then
-       echo "failure: magic remained the same between executions"
+helper=$1
+m1=$($helper)
+m2=$($helper)
+
+if [ $m1 -eq $m2 ]; then
+       echo "failure: magic remained the same between executions ($m1 vs $m2)"
        exit 1
 fi
 
index 1616791324dcf6fcb6ca33f68e1532c49ef510ae..bcce4c5d9ff05617bd70938f56dc17f01c1440df 100644 (file)
@@ -158,10 +158,11 @@ def test(ctx):
     cmd = os.path.join(Utils.g_module.blddir, 'talloc_testsuite')
     ret = samba_utils.RUN_COMMAND(cmd)
     print("testsuite returned %d" % ret)
+    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')
 
-    magic_ret = samba_utils.RUN_COMMAND(magic_cmd)
+    magic_ret = samba_utils.RUN_COMMAND(magic_cmd + " " +  magic_helper_cmd)
     print("magic differs test returned %d" % magic_ret)
     pyret = samba_utils.RUN_PYTHON_TESTS(['test_pytalloc.py'])
     print("python testsuite returned %d" % pyret)