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