]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/recipes/79-test_http.t
80-test_cmp_http.t: Improve the way the test server is launched and killed
[thirdparty/openssl.git] / test / recipes / 79-test_http.t
CommitLineData
29f178bd
DDO
1#! /usr/bin/env perl
2# Copyright 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
10use OpenSSL::Test qw/:DEFAULT srctop_file/;
11use OpenSSL::Test::Utils;
12
13setup("test_http");
14
5d8ea84e 15plan tests => 2;
29f178bd
DDO
16
17SKIP: {
18 skip "sockets disabled", 1 if disabled("sock");
5d8ea84e
DDO
19 skip "OCSP disabled", 1 if disabled("ocsp");
20 my $cmd = [qw{openssl ocsp -index any -port 0}];
21 my @output = run(app($cmd), capture => 1);
d63053bb
DDO
22 ok($output[0] =~ /^ACCEPT (0.0.0.0|\[::\]):(\d+?) PID=(\d+)$/
23 && $2 >= 1024 && $3 > 0,
24 "HTTP server auto-selects and reports local port >= 1024 and pid > 0");
29f178bd 25}
5d8ea84e
DDO
26
27ok(run(test(["http_test", srctop_file("test", "certs", "ca-cert.pem")])));