s3: go straight to winbindd_dual_pam_auth() in case of !NT_STATUS_OK
[abartlet/samba.git/.git] / selftest / selftest.pl
index 2aae050590afc7edd92a9c23fb1ce9e17e0feda3..ba6604961684eb0263afd2255c7d1e1cf8b31018 100755 (executable)
@@ -212,6 +212,17 @@ sub cleanup_pcap($$)
        unlink($pcap_file);
 }
 
+# expand strings from %ENV
+sub expand_environment_strings($)
+{
+       my $s = shift;
+       # we use a reverse sort so we do the longer ones first
+       foreach my $k (sort { $b cmp $a } keys %ENV) {
+               $s =~ s/\$$k/$ENV{$k}/g;
+       }
+       return $s;
+}
+
 sub run_testsuite($$$$$)
 {
        my ($envname, $name, $cmd, $i, $totalsuites) = @_;
@@ -255,6 +266,7 @@ sub run_testsuite($$$$$)
        }
 
        print "command: $cmd\n";
+       printf "expanded command: %s\n", expand_environment_strings($cmd);
 
        my $exitcode = $ret >> 8;
 
@@ -348,6 +360,9 @@ exit(1) if (not $result);
 
 ShowHelp() if ($opt_help);
 
+# we want unbuffered output
+$| = 1;
+
 my @tests = @ARGV;
 
 # quick hack to disable rpc validation when using valgrind - its way too slow
@@ -356,6 +371,9 @@ unless (defined($ENV{VALGRIND})) {
        $ENV{MALLOC_CHECK_} = 2;
 }
 
+# make all our python scripts unbuffered
+$ENV{PYTHONUNBUFFERED} = 1;
+
 my $bindir = ($opt_bindir or "$builddir/bin");
 my $bindir_abs = abs_path($bindir);
 
@@ -427,7 +445,7 @@ if ($opt_socket_wrapper_pcap) {
 
 my $socket_wrapper_dir;
 if ($opt_socket_wrapper) {
-       $socket_wrapper_dir = SocketWrapper::setup_dir("$prefix/w", $opt_socket_wrapper_pcap);
+       $socket_wrapper_dir = SocketWrapper::setup_dir("$prefix_abs/w", $opt_socket_wrapper_pcap);
        print "SOCKET_WRAPPER_DIR=$socket_wrapper_dir\n";
 } else {
         unless ($< == 0) { 
@@ -581,6 +599,7 @@ sub write_clientconf($$)
 #We don't want to pass our self-tests if the PAC code is wrong
        gensec:require_pac = true
        modules dir = $ENV{LD_SAMBA_MODULE_PATH}
+       setup directory = ./setup
 ";
        close(CF);
 }