]> eyrie.org Git - kerberos/wallet.git/commitdiff
Suppress remctld output in Perl tests
authorRuss Allbery <eagle@eyrie.org>
Mon, 18 May 2020 05:21:25 +0000 (22:21 -0700)
committerRuss Allbery <eagle@eyrie.org>
Mon, 18 May 2020 05:21:59 +0000 (22:21 -0700)
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
perl/t/object/keytab.t
perl/t/verifier/basic.t

index f9cbbd0b97b5383a90fb7e892a5dcaf67cf9a896..0c29930b40c693cdedb5a7589ed801a49c250f89 100644 (file)
@@ -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;
index dfb96bdb2de13cdd9c78cf0c53dac63ea45f237e..414352f070f3b344d4778999147aa87dde6ceaa1 100755 (executable)
@@ -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';
index 3ee71d6207e1c5be3fa6cd96ca588d976fea7e80..0e2cc5af073ec94a1052943cc05a684884a18ecc 100755 (executable)
@@ -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);