aboutsummaryrefslogtreecommitdiff
path: root/perl
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
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')
-rw-r--r--perl/t/lib/Util.pm11
-rwxr-xr-xperl/t/object/keytab.t3
-rwxr-xr-xperl/t/verifier/basic.t3
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 <eagle@eyrie.org>
+# Copyright 2020 Russ Allbery <eagle@eyrie.org>
# 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 <eagle@eyrie.org>
+# Copyright 2020 Russ Allbery <eagle@eyrie.org>
# 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);