diff options
author | Rich Salz <rsalz@openssl.org> | 2017-03-14 14:53:35 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-03-14 15:18:07 -0400 |
commit | 4772610ccf306eb53980c2771cba550a5ce36d1c (patch) | |
tree | 8dae614395e47c7e307e23872dcc528165997582 /test/recipes | |
parent | 703324a7e7d471b2b31523f4b74805f9144771f9 (diff) |
Add test for -nameout output
Using a cert with Cyrillic characters, kindly supplied by Dmitry Belyavsky
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2943)
Diffstat (limited to 'test/recipes')
-rw-r--r-- | test/recipes/25-test_x509.t | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/recipes/25-test_x509.t b/test/recipes/25-test_x509.t index 98a8d324e9..f5ef0f9963 100644 --- a/test/recipes/25-test_x509.t +++ b/test/recipes/25-test_x509.t @@ -15,10 +15,25 @@ use OpenSSL::Test qw/:DEFAULT srctop_file/; setup("test_x509"); -plan tests => 5; +plan tests => 9; require_ok(srctop_file('test','recipes','tconversion.pl')); +my $pem = srctop_file("test/certs", "cyrillic.pem"); +my $out = "cyrillic.out"; +my $msb = srctop_file("test/certs", "cyrillic.msb"); +my $utf = srctop_file("test/certs", "cyrillic.utf8"); + +ok(run(app(["openssl", "x509", "-text", "-in", $pem, "-out", $out, + "-nameopt", "esc_msb"]))); +is(cmp_text($out, srctop_file("test/certs", "cyrillic.msb")), + 0, 'Comparing esc_msb output'); +ok(run(app(["openssl", "x509", "-text", "-in", $pem, "-out", $out, + "-nameopt", "utf8"]))); +is(cmp_text($out, srctop_file("test/certs", "cyrillic.utf8")), + 0, 'Comparing utf8 output'); +unlink $out; + subtest 'x509 -- x.509 v1 certificate' => sub { tconversion("x509", srctop_file("test","testx509.pem")); }; |