xref: /freebsd/crypto/openssl/test/recipes/20-test_cli_list.t (revision 88b8b7f0c4e9948667a2279e78e975a784049cba)
1*88b8b7f0SEnji Cooper#! /usr/bin/env perl
2*88b8b7f0SEnji Cooper# Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
3*88b8b7f0SEnji Cooper#
4*88b8b7f0SEnji Cooper# Licensed under the Apache License 2.0 (the "License").  You may not use
5*88b8b7f0SEnji Cooper# this file except in compliance with the License.  You can obtain a copy
6*88b8b7f0SEnji Cooper# in the file LICENSE in the source distribution or at
7*88b8b7f0SEnji Cooper# https://www.openssl.org/source/license.html
8*88b8b7f0SEnji Cooper
9*88b8b7f0SEnji Cooperuse strict;
10*88b8b7f0SEnji Cooperuse warnings;
11*88b8b7f0SEnji Cooper
12*88b8b7f0SEnji Cooperuse OpenSSL::Test qw/:DEFAULT bldtop_file srctop_file bldtop_dir with/;
13*88b8b7f0SEnji Cooperuse OpenSSL::Test::Utils;
14*88b8b7f0SEnji Cooper
15*88b8b7f0SEnji Coopersetup("test_cli_list");
16*88b8b7f0SEnji Cooper
17*88b8b7f0SEnji Cooperplan tests => 2;
18*88b8b7f0SEnji Cooper
19*88b8b7f0SEnji Cooperok(run(app(["openssl", "list", "-skey-managers"],
20*88b8b7f0SEnji Cooper        stdout => "listout.txt")),
21*88b8b7f0SEnji Cooper"List skey managers - default configuration");
22*88b8b7f0SEnji Cooperopen DATA, "listout.txt";
23*88b8b7f0SEnji Coopermy @match = grep /secret key/, <DATA>;
24*88b8b7f0SEnji Cooperclose DATA;
25*88b8b7f0SEnji Cooperok(scalar @match > 1 ? 1 : 0, "Several skey managers are listed - default configuration");
26