From 7d0a9f5a06c807855335b9553a15ba312a7562ff Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Sep 2012 20:40:13 +1000 Subject: 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 Autobuild-Date(master): Sun Sep 30 02:30:40 CEST 2012 on sn-devel-104 --- selftest/selftest.pl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'selftest') 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) { -- cgit