[PATCH] selftest: export location of the perl interpreter

Uri Simchoni uri at samba.org
Thu Dec 21 21:50:37 UTC 2017


Hi,

This patch fixes setting up the nt4_member test env on FreeBSD -
essentially (at least on my machine) perl is installed at
/usr/local/bin, and exporting the PERL env var from waf configuration
output allows the tests to use it, instead of relying on the "shebang"
that points to /usr/bin/perl.

Review appreciated,
Uri.
-------------- next part --------------
From 26e8ea22e2888326d2edba510fcef0fd563d8461 Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri at samba.org>
Date: Thu, 21 Dec 2017 19:49:39 +0200
Subject: [PATCH] selftest: pass location of perl executable from waf to
 test-envs

Many perl scripts in the codebase are executables with a
"/usr/bin/perl" shebang. Running them as executables is not
portable as some OS's have a different location for the perl
interpreter.

During the configuration process, waf finds the location of the perl
interpreter. Some or all  invocations of perl scripts from within
test environment setup code are actually "$PERL <script>",
but since PERL env var is typically not set, this amounts to the
unportable "<script>", which invokes /usr/bin/perl.

This patch exports the location of perl as found by the configuration
process to the test environment, causing "$PERL <script>" to be
"<correct place of perl interpreter> <script>".

Signed-off-by: Uri Simchoni <uri at samba.org>
---
 selftest/wscript | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/selftest/wscript b/selftest/wscript
index 9f1fd4d..8264d96 100644
--- a/selftest/wscript
+++ b/selftest/wscript
@@ -202,6 +202,9 @@ def cmd_testonly(opt):
     # tell build system where to find config.h
     os.environ['CONFIG_H'] = 'bin/default/include/config.h'
 
+    # tell the test system where perl is
+    os.environ['PERL'] = env.PERL
+
     st_done = os.path.join(env.SELFTEST_PREFIX, 'st_done')
     if os.path.exists(st_done):
         os.unlink(st_done)
-- 
2.9.5



More information about the samba-technical mailing list