summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2021-04-28 12:51:49 +1000
committerShane Lontis <shane.lontis@oracle.com>2021-04-30 16:04:52 +1000
commite9d62da6c305d947530d91e412fdb21a8d8e3510 (patch)
tree85779474a2d93c84c351e697aed8627c269c2040 /test
parent9ac653d81a857a5452f9f25278a24e1dfb226905 (diff)
Fix CRL app so that stdin works.
Fixes #15031 The maybe_stdin needed to be passed to load_key_certs_crls(). Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15058)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/25-test_crl.t17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/recipes/25-test_crl.t b/test/recipes/25-test_crl.t
index a17383f043..1d6200e6d4 100644
--- a/test/recipes/25-test_crl.t
+++ b/test/recipes/25-test_crl.t
@@ -15,7 +15,7 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/;
setup("test_crl");
-plan tests => 8;
+plan tests => 9;
require_ok(srctop_file('test','recipes','tconversion.pl'));
@@ -39,6 +39,11 @@ ok(compare1stline([qw{openssl crl -noout -hash -in},
srctop_file('test', 'testcrl.pem')],
'106cd822'));
+ok(compare1stline_stdin([qw{openssl crl -hash -noout}],
+ srctop_file("test","testcrl.pem"),
+ '106cd822'),
+ "crl piped input test");
+
ok(run(app(["openssl", "crl", "-text", "-in", $pem, "-out", $out,
"-nameopt", "utf8"])));
is(cmp_text($out, srctop_file("test/certs", "cyrillic_crl.utf8")),
@@ -53,3 +58,13 @@ sub compare1stline {
note "Expected ", $str;
return 0;
}
+
+sub compare1stline_stdin {
+ my ($cmdarray, $infile, $str) = @_;
+ my @lines = run(app($cmdarray, stdin => $infile), capture => 1);
+
+ return 1 if $lines[0] =~ m|^\Q${str}\E\R$|;
+ note "Got ", $lines[0];
+ note "Expected ", $str;
+ return 0;
+}