81-test_cmp_cli.t: Do connections to 127.0.0.1 (e.g., Mock server) without proxy
[openssl.git] / test / recipes / 25-test_rusext.t
1 #! /usr/bin/env perl
2 # Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
3 #
4 # Licensed under the Apache License 2.0 (the "License").  You may not use
5 # this file except in compliance with the License.  You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
8
9
10 use strict;
11 use warnings;
12
13 use File::Spec;
14 use OpenSSL::Test::Utils;
15 use OpenSSL::Test qw/:DEFAULT srctop_file/;
16
17 setup("test_rusext");
18
19 plan tests => 5;
20
21 require_ok(srctop_file('test', 'recipes', 'tconversion.pl'));
22 my $pem = srctop_file("test/certs", "grfc.pem");
23 my $out_msb = "grfc.msb";
24 my $out_utf8 = "grfc.utf8";
25
26 ok(run(app(["openssl", "x509", "-text", "-in", $pem, "-out", $out_msb,
27             "-nameopt", "esc_msb", "-certopt", "no_pubkey"])));
28 is(cmp_text($out_msb, srctop_file('test', 'recipes', '25-test_rusext_data', 'grfc.msb')),
29    0, 'Comparing esc_msb output');
30 ok(run(app(["openssl", "x509", "-text", "-in", $pem, "-out", $out_utf8,
31             "-nameopt", "utf8", "-certopt", "no_pubkey"])));
32 is(cmp_text($out_utf8, srctop_file('test', 'recipes', '25-test_rusext_data', 'grfc.utf8')),
33    0, 'Comparing utf8 output');