]>
Commit | Line | Data |
---|---|---|
29f178bd | 1 | #! /usr/bin/env perl |
da1c088f | 2 | # Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved. |
29f178bd DDO |
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 | ||
10 | use OpenSSL::Test qw/:DEFAULT srctop_file/; | |
11 | use OpenSSL::Test::Utils; | |
12 | ||
13 | setup("test_http"); | |
14 | ||
3ca28c9e VK |
15 | plan skip_all => "HTTP protocol is not supported by this OpenSSL build" |
16 | if disabled('http'); | |
17 | plan skip_all => "not supported by no-sock build" if disabled('sock'); | |
18 | ||
5d8ea84e | 19 | plan tests => 2; |
29f178bd DDO |
20 | |
21 | SKIP: { | |
22 | skip "sockets disabled", 1 if disabled("sock"); | |
5d8ea84e | 23 | skip "OCSP disabled", 1 if disabled("ocsp"); |
3ca28c9e | 24 | skip "HTTP disabled", 1 if disabled("http"); |
5d8ea84e DDO |
25 | my $cmd = [qw{openssl ocsp -index any -port 0}]; |
26 | my @output = run(app($cmd), capture => 1); | |
53d0d01f | 27 | $output[0] =~ s/\r\n/\n/g; |
d63053bb DDO |
28 | ok($output[0] =~ /^ACCEPT (0.0.0.0|\[::\]):(\d+?) PID=(\d+)$/ |
29 | && $2 >= 1024 && $3 > 0, | |
30 | "HTTP server auto-selects and reports local port >= 1024 and pid > 0"); | |
29f178bd | 31 | } |
5d8ea84e DDO |
32 | |
33 | ok(run(test(["http_test", srctop_file("test", "certs", "ca-cert.pem")]))); |