]>
git.ipfire.org Git - thirdparty/openssl.git/blob - test/recipes/20-test_provider.t
2 # Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
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
15 setup
("test_provider");
20 skip
"No default provider?", 6
21 unless ok
(run
(app
([qw(openssl provider default)])),
22 "try running 'openssl provider default'");
24 my $prev = 2; # The amount of lines from -v
25 my @checks = qw( -v -vv -vvv );
26 my %op = ( -v
=> '==',
32 my @cmd = ('openssl', 'provider', $_, 'default');
33 my @lines = ( map { (my $x = $_) =~ s
|\R
$||; $x }
34 run
(app
([@cmd]), capture
=> 1) );
36 my $curr = scalar @lines;
37 my $cmp = "$curr $op{$_} $prev";
40 "'openssl provider $_ default' line count $op{$_} $prev");
41 ok
($lines[0] eq '[ default ]',
42 "'openssl provider -v default' first line is '[ default ]'");
49 skip
"No null provider?", 1
50 unless ok
(run
(app
([qw(openssl provider null)])),
51 "try running 'openssl provider null'");
53 my @cmd = ('openssl', 'provider', '-vvv', 'null');
54 my @lines = ( map { (my $x = $_) =~ s
|\R
$||; $x }
55 run
(app
([@cmd]), capture
=> 1) );
57 my $curr = scalar @lines;
58 my $cmp = "$curr == 1";
60 "'openssl provider $_ default' line count == 1");