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 +++++++++-- perl/t/object/keytab.t | 3 ++- perl/t/verifier/basic.t | 3 ++- 3 files changed, 13 insertions(+), 4 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; diff --git a/perl/t/object/keytab.t b/perl/t/object/keytab.t index dfb96bd..414352f 100755 --- a/perl/t/object/keytab.t +++ b/perl/t/object/keytab.t @@ -3,6 +3,7 @@ # Tests for the keytab object implementation. # # Written by Russ Allbery +# Copyright 2020 Russ Allbery # Copyright 2007-2010, 2013-2014 # The Board of Trustees of the Leland Stanford Junior University # @@ -442,7 +443,7 @@ SKIP: { # Now spawn our remctld server and get a ticket cache. remctld_spawn ($remctld, $principal, 't/data/test.keytab', - 't/data/keytab.conf'); + 't/data/keytab.conf', 1); $ENV{KRB5CCNAME} = 'krb5cc_test'; getcreds ('t/data/test.keytab', $principal); $ENV{KRB5CCNAME} = 'krb5cc_good'; diff --git a/perl/t/verifier/basic.t b/perl/t/verifier/basic.t index 3ee71d6..0e2cc5a 100755 --- a/perl/t/verifier/basic.t +++ b/perl/t/verifier/basic.t @@ -3,6 +3,7 @@ # Tests for the basic wallet ACL verifiers. # # Written by Russ Allbery +# Copyright 2020 Russ Allbery # Copyright 2007-2008, 2010, 2014 # The Board of Trustees of the Leland Stanford Junior University # @@ -76,7 +77,7 @@ SKIP: { # Now spawn our remctld server and get a ticket cache. unlink ('krb5cc_test', 'test-acl', 'test-pid'); remctld_spawn ($remctld, $principal, 't/data/test.keytab', - 't/data/netdb.conf'); + 't/data/netdb.conf', 1); $ENV{KRB5CCNAME} = 'krb5cc_test'; getcreds ('t/data/test.keytab', $principal); -- cgit v1.2.3