aboutsummaryrefslogtreecommitdiff
path: root/perl/t/lib
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2020-05-17 22:21:25 -0700
committerRuss Allbery <eagle@eyrie.org>2020-05-17 22:21:59 -0700
commitacaa1794f08b0b8a42e9247f5186e00a888bd437 (patch)
treed005cf7dbdb098321147af350a6fb76fee28ba23 /perl/t/lib
parent303d68b41763b0aab62cd37190ded99998d8afc5 (diff)
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.
Diffstat (limited to 'perl/t/lib')
-rw-r--r--perl/t/lib/Util.pm11
1 files changed, 9 insertions, 2 deletions
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;