summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-09-29 20:40:13 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-09-30 02:30:39 +0200
commit7d0a9f5a06c807855335b9553a15ba312a7562ff (patch)
tree6a3881a828800941699d7e7052d4cbc2866ee929 /selftest
parente576bf5310bc9de9686a71539e9a1b60b4fba5cc (diff)
downloadsamba-7d0a9f5a06c807855335b9553a15ba312a7562ff.tar.gz
samba-7d0a9f5a06c807855335b9553a15ba312a7562ff.tar.bz2
samba-7d0a9f5a06c807855335b9553a15ba312a7562ff.zip
selftest: use an array when starting testenv with system()
By reduing the need for escapes and forcing the use of bash, this seems to allow 'make testenv' to start on FreeBSD Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sun Sep 30 02:30:40 CEST 2012 on sn-devel-104
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/selftest.pl14
1 files changed, 11 insertions, 3 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index b636910f52..b50853e54d 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -838,8 +838,13 @@ if ($opt_testenv) {
my $envvarstr = exported_envvars_str($testenv_vars);
- my $term = ($ENV{TERMINAL} or "xterm -e");
- system("$term 'echo -e \"
+ my @term = ();
+ if ($ENV{TERMINAL}) {
+ @term = ($ENV{TERMINAL});
+ } else {
+ @term = ("xterm", "-e");
+ }
+ my @term_args = ("bash", "-c", "echo -e \"
Welcome to the Samba4 Test environment '$testenv_name'
This matches the client environment used in make test
@@ -850,7 +855,10 @@ TORTURE_OPTIONS=\$TORTURE_OPTIONS
SMB_CONF_PATH=\$SMB_CONF_PATH
$envvarstr
-\" && LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH} bash'");
+\" && LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH} bash");
+
+ system(@term, @term_args);
+
teardown_env($testenv_name);
} elsif ($opt_list) {
foreach (@todo) {