wafsamba: pass environment to cross-execute tests
authorUri Simchoni <uri@samba.org>
Sun, 6 Oct 2019 21:37:41 +0000 (00:37 +0300)
committerUri Simchoni <uri@samba.org>
Sun, 20 Oct 2019 12:06:30 +0000 (12:06 +0000)
This can come in handy for cross-execute scripts in general, and
is particularly required by the samba-xc test for cross-answers /
cross-execute, because Samba sets LD_LIBRARY_PATH during rpath
checks, and the test program needs that in order to successfully
run.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_cross.py

index 6fca470f2b79a18314752ddcd5375e9aadb81e17..0868a855a0da760e17a9017eafd68c66f6b6a87f 100644 (file)
@@ -120,7 +120,8 @@ class cross_Popen(Utils.subprocess.Popen):
             if use_answers:
                 p = real_Popen(newargs,
                                stdout=Utils.subprocess.PIPE,
-                               stderr=Utils.subprocess.PIPE)
+                               stderr=Utils.subprocess.PIPE,
+                               env=kw.get('env', {}))
                 ce_out, ce_err = p.communicate()
                 ans = (p.returncode, samba_utils.get_string(ce_out))
                 add_answer(ca_file, msg, ans)