1 | #! /usr/bin/env perl
|
---|
2 | # Copyright 2023 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 |
|
---|
10 | use OpenSSL::Test;
|
---|
11 | use OpenSSL::Test::Utils;
|
---|
12 | use OpenSSL::Test qw/:DEFAULT data_file bldtop_dir srctop_dir srctop_file/;
|
---|
13 |
|
---|
14 | setup("test_external_cf_quiche");
|
---|
15 |
|
---|
16 | plan skip_all => "No external tests in this configuration"
|
---|
17 | if disabled("external-tests");
|
---|
18 | plan skip_all => "Cloudflare quiche tests not available on Windows or VMS"
|
---|
19 | if $^O =~ /^(VMS|MSWin32)$/;
|
---|
20 | plan skip_all => "Cloudflare quiche tests only available with QUIC support"
|
---|
21 | if disabled("quic");
|
---|
22 | plan skip_all => "Cloudflare & Boringssl not checked out"
|
---|
23 | if ! -f srctop_file("cloudflare-quiche", "quiche", "deps", "boringssl", "LICENSE");
|
---|
24 |
|
---|
25 | plan tests => 3;
|
---|
26 |
|
---|
27 | ok(run(cmd(["sh", data_file("quiche-build.sh")])),
|
---|
28 | "running Cloudflare quiche build");
|
---|
29 |
|
---|
30 | ok(run(cmd(["sh", data_file("quiche-server.sh")])),
|
---|
31 | "running Cloudflare quiche server");
|
---|
32 |
|
---|
33 | ok(run(test(["quic_client_test"])),
|
---|
34 | "running quic_client_test");
|
---|
35 |
|
---|
36 | open my $fh, '<', "server.pid"
|
---|
37 | or die "Error opening server.pid - $!\n";
|
---|
38 | $serverpid = <$fh>;
|
---|
39 | close($fh);
|
---|
40 |
|
---|
41 | kill('TERM', $serverpid);
|
---|
42 | sleep(1);
|
---|
43 | kill('KILL', $serverpid);
|
---|
44 | waitpid($serverpid, 0);
|
---|