81-test_cmp_cli.t: Do connections to 127.0.0.1 (e.g., Mock server) without proxy
[openssl.git] / test / recipes / 99-test_fuzz.t
1 #!/usr/bin/env perl
2 # Copyright 2016-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 use strict;
10 use warnings;
11
12 use OpenSSL::Glob;
13 use OpenSSL::Test qw/:DEFAULT srctop_file/;
14 use OpenSSL::Test::Utils;
15
16 setup("test_fuzz");
17
18 my @fuzzers = ('asn1', 'asn1parse', 'bignum', 'bndiv', 'client', 'conf', 'crl', 'server', 'x509');
19 if (!disabled("cmp")) {
20     push @fuzzers, 'cmp';
21 }
22 if (!disabled("cms")) {
23     push @fuzzers, 'cms';
24 }
25 if (!disabled("ct")) {
26     push @fuzzers, 'ct';
27 }
28 plan tests => scalar @fuzzers;
29
30 foreach my $f (@fuzzers) {
31     subtest "Fuzzing $f" => sub {
32         my @dirs = glob(srctop_file('fuzz', 'corpora', $f));
33         push @dirs, glob(srctop_file('fuzz', 'corpora', "$f-*"));
34
35         plan skip_all => "No corpora for $f-test" unless @dirs;
36
37         plan tests => scalar @dirs;
38
39         foreach (@dirs) {
40             ok(run(fuzz(["$f-test", $_])));
41         }
42     }
43 }