20-test_nocache.t revision 1.1 1 #! /usr/bin/env perl
2 # Copyright 2016-2025 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 use strict;
10 use warnings;
11
12 use OpenSSL::Test qw/:DEFAULT bldtop_file srctop_file bldtop_dir with/;
13 use OpenSSL::Test::Utils;
14
15 setup("test_nocache");
16
17 plan tests => 4;
18
19 ok(run(app(["openssl", "list", "-mac-algorithms"],
20 stdout => "listout.txt")),
21 "List mac algorithms - default configuration");
22 open DATA, "listout.txt";
23 my @match = grep /MAC/, <DATA>;
24 close DATA;
25 ok(scalar @match > 1 ? 1 : 0, "Several algorithms are listed - default configuration");
26
27 $ENV{OPENSSL_CONF} = bldtop_file("test", "nocache-and-default.cnf");
28 ok(run(app(["openssl", "list", "-mac-algorithms"],
29 stdout => "listout.txt")),
30 "List mac algorithms");
31 open DATA, "listout.txt";
32 my @match = grep /MAC/, <DATA>;
33 close DATA;
34 ok(scalar @match > 1 ? 1 : 0, "Several algorithms are listed - nocache-and-default");
35