print server log on stderr as well as to log file
authorAndrew Tridgell <tridge@samba.org>
Wed, 12 Aug 2009 04:38:55 +0000 (14:38 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 12 Aug 2009 04:38:55 +0000 (14:38 +1000)
I think we are missing some important messages from the server during
'make test' because we don't show the log file contents during
runs. This patch uses tee to put the log messages to stderr so we can
see any server messages associated with the test that caused them.

selftest/target/Samba4.pm

index 0f909ce4b2f1a1f4368cdb6e3589df98aa2e0c61..81ad09dbc00c0153101928c8d0882514aa62e3e6 100644 (file)
@@ -88,9 +88,12 @@ sub check_or_start($$$)
        my $pid = fork();
        if ($pid == 0) {
                open STDIN, $env_vars->{SAMBA_TEST_FIFO};
-               open STDOUT, ">$env_vars->{SAMBA_TEST_LOG}";
+               # we want out from samba to go to the log file, but also
+               # to the users terminal when running 'make test' on the command
+               # line. This puts it on stderr on the terminal
+               open STDOUT, "| tee $env_vars->{SAMBA_TEST_LOG} 1>&2";
                open STDERR, '>&STDOUT';
-               
+
                SocketWrapper::set_default_iface($env_vars->{SOCKET_WRAPPER_DEFAULT_IFACE});
 
                my $valgrind = "";