From acaa1794f08b0b8a42e9247f5186e00a888bd437 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 May 2020 22:21:25 -0700 Subject: Suppress remctld output in Perl tests Until I have a better way of handling the interleaving of output, send the output from remctld to /dev/null for the Perl tests. --- perl/t/lib/Util.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'perl/t/lib') diff --git a/perl/t/lib/Util.pm b/perl/t/lib/Util.pm index f9cbbd0..0c29930 100644 --- a/perl/t/lib/Util.pm +++ b/perl/t/lib/Util.pm @@ -120,7 +120,7 @@ sub keytab_valid { # the keytab it uses for authentication, and the configuration file it should # load. sub remctld_spawn { - my ($path, $principal, $keytab, $config) = @_; + my ($path, $principal, $keytab, $config, $silent) = @_; unlink 'test-pid'; my @command = ($path, '-m', '-p', 14373, '-s', $principal, '-P', 'test-pid', '-f', $config, '-S', '-F', '-k', $keytab); @@ -129,7 +129,14 @@ sub remctld_spawn { if (not defined $pid) { die "cannot fork: $!\n"; } elsif ($pid == 0) { - open (STDOUT, '>&STDERR') or die "cannot redirect stdout: $!\n"; + if ($silent) { + open (STDOUT, '>', '/dev/null') + or die "cannot redirect stdout: $!\n"; + open (STDERR, '>', '/dev/null') + or die "cannot redirect stdout: $!\n"; + } else { + 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