]> eyrie.org Git - kerberos/wallet.git/commitdiff
Send remctl test output to stderr
authorRuss Allbery <eagle@eyrie.org>
Mon, 18 May 2020 03:44:05 +0000 (20:44 -0700)
committerRuss Allbery <eagle@eyrie.org>
Mon, 18 May 2020 03:47:16 +0000 (20:47 -0700)
We were sending stderr to stdout for remctl output, but sometimes
tests would fail because the remctl output was intermixed with the
test output and confused runtests.  runtests only looks at stdout
for test output and sends stderr to /dev/null, so send remctl
output there.

This isn't a great solution since it interferes with debugging
tests.  The correct solution is to implement the same logging and
polling that's used by C TAP Harness, although that's more difficult
to do in Perl.  But it should make the immediate problem go away.

Continue to send the message about which remctl command line is in
use to stdout, but prefix it with # so that it is a TAP comment.

perl/t/lib/Util.pm

index c58337365cf4faedc9b9526e2119c33ab293966c..f9cbbd0b97b5383a90fb7e892a5dcaf67cf9a896 100644 (file)
@@ -1,6 +1,7 @@
 # Utility class for wallet tests.
 #
 # Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2020 Russ Allbery <eagle@eyrie.org>
 # Copyright 2007-2008, 2014
 #     The Board of Trustees of the Leland Stanford Junior University
 #
@@ -18,7 +19,7 @@ use Wallet::Config;
 # This version should be increased on any code change to this module.  Always
 # use two digits for the minor version with a leading zero if necessary so
 # that it will sort properly.
-$VERSION = '0.03';
+$VERSION = '0.04';
 
 use Exporter ();
 @ISA    = qw(Exporter);
@@ -123,12 +124,12 @@ sub remctld_spawn {
     unlink 'test-pid';
     my @command = ($path, '-m', '-p', 14373, '-s', $principal, '-P',
                    'test-pid', '-f', $config, '-S', '-F', '-k', $keytab);
-    print "Starting remctld: @command\n";
+    print "Starting remctld: @command\n";
     my $pid = fork;
     if (not defined $pid) {
         die "cannot fork: $!\n";
     } elsif ($pid == 0) {
-        open (STDERR, '>&STDOUT') or die "cannot redirect stderr: $!\n";
+        open (STDOUT, '>&STDERR') or die "cannot redirect stdout: $!\n";
         exec (@command) or die "cannot exec $path: $!\n";
     } else {
         my $tries = 0;