From c60d58ee05141b058fcb03381a3b34bb7d70c15a Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 May 2020 20:44:05 -0700 Subject: Send remctl test output to stderr 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/perl/t/lib/Util.pm b/perl/t/lib/Util.pm index c583373..f9cbbd0 100644 --- a/perl/t/lib/Util.pm +++ b/perl/t/lib/Util.pm @@ -1,6 +1,7 @@ # Utility class for wallet tests. # # Written by Russ Allbery +# Copyright 2020 Russ Allbery # 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; -- cgit v1.2.3