Tests: Fix the display of test vars in screen --testenv
authorMatthieu Patou <mat@matws.net>
Thu, 3 Jan 2013 22:33:45 +0000 (14:33 -0800)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Jan 2013 12:03:52 +0000 (13:03 +0100)
The form bash -c echo "important stuff blabla bla" && LD_LIBARY_PATH bash
is not working in screen when it's working in xterm and the in_screen
script already wrap all the command within a bash shell so there is no
need to re-force bash as the echo will execute in a bash shell

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jan 22 13:03:52 CET 2013 on sn-devel-104

selftest/selftest.pl

index 4ac5aeb2a4ef38ac7547b227942062a71a3ade5a..639c8a2fd7c133a26e1a282fe52bdddd12da065e 100755 (executable)
@@ -849,13 +849,7 @@ if ($opt_testenv) {
 
        my $envvarstr = exported_envvars_str($testenv_vars);
 
-       my @term = ();
-       if ($ENV{TERMINAL}) {
-           @term = ($ENV{TERMINAL});
-       } else {
-           @term = ("xterm", "-e");
-       }
-       my @term_args = ("bash", "-c", "echo -e \"
+       my @term_args = ("echo -e \"
 Welcome to the Samba4 Test environment '$testenv_name'
 
 This matches the client environment used in make test
@@ -867,6 +861,13 @@ SMB_CONF_PATH=\$SMB_CONF_PATH
 
 $envvarstr
 \" && LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH} bash");
+       my @term = ();
+       if ($ENV{TERMINAL}) {
+           @term = ($ENV{TERMINAL});
+       } else {
+           @term = ("xterm", "-e");
+           unshift(@term_args, ("bash", "-c"));
+       }
 
        system(@term, @term_args);