1*e7be843bSPierre Pronchery#! /usr/bin/env perl 2*e7be843bSPierre Pronchery# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved. 3*e7be843bSPierre Pronchery# 4*e7be843bSPierre Pronchery# Licensed under the Apache License 2.0 (the "License"). You may not use 5*e7be843bSPierre Pronchery# this file except in compliance with the License. You can obtain a copy 6*e7be843bSPierre Pronchery# in the file LICENSE in the source distribution or at 7*e7be843bSPierre Pronchery# https://www.openssl.org/source/license.html 8*e7be843bSPierre Pronchery 9*e7be843bSPierre Pronchery 10*e7be843bSPierre Proncheryuse OpenSSL::Test; 11*e7be843bSPierre Proncheryuse OpenSSL::Test::Utils; 12*e7be843bSPierre Proncheryuse OpenSSL::Test qw/:DEFAULT data_file bldtop_dir srctop_dir srctop_file/; 13*e7be843bSPierre Pronchery 14*e7be843bSPierre Proncherysetup("test_external_cf_quiche"); 15*e7be843bSPierre Pronchery 16*e7be843bSPierre Proncheryplan skip_all => "No external tests in this configuration" 17*e7be843bSPierre Pronchery if disabled("external-tests"); 18*e7be843bSPierre Proncheryplan skip_all => "Cloudflare quiche tests not available on Windows or VMS" 19*e7be843bSPierre Pronchery if $^O =~ /^(VMS|MSWin32)$/; 20*e7be843bSPierre Proncheryplan skip_all => "Cloudflare quiche tests only available with QUIC support" 21*e7be843bSPierre Pronchery if disabled("quic"); 22*e7be843bSPierre Proncheryplan skip_all => "Cloudflare & Boringssl not checked out" 23*e7be843bSPierre Pronchery if ! -f srctop_file("cloudflare-quiche", "quiche", "deps", "boringssl", "LICENSE"); 24*e7be843bSPierre Pronchery 25*e7be843bSPierre Proncheryplan tests => 3; 26*e7be843bSPierre Pronchery 27*e7be843bSPierre Proncheryok(run(cmd(["sh", data_file("quiche-build.sh")])), 28*e7be843bSPierre Pronchery "running Cloudflare quiche build"); 29*e7be843bSPierre Pronchery 30*e7be843bSPierre Proncheryok(run(cmd(["sh", data_file("quiche-server.sh")])), 31*e7be843bSPierre Pronchery "running Cloudflare quiche server"); 32*e7be843bSPierre Pronchery 33*e7be843bSPierre Proncheryok(run(test(["quic_client_test"])), 34*e7be843bSPierre Pronchery "running quic_client_test"); 35*e7be843bSPierre Pronchery 36*e7be843bSPierre Proncheryopen my $fh, '<', "server.pid" 37*e7be843bSPierre Pronchery or die "Error opening server.pid - $!\n"; 38*e7be843bSPierre Pronchery$serverpid = <$fh>; 39*e7be843bSPierre Proncheryclose($fh); 40*e7be843bSPierre Pronchery 41*e7be843bSPierre Proncherykill('TERM', $serverpid); 42*e7be843bSPierre Proncherysleep(1); 43*e7be843bSPierre Proncherykill('KILL', $serverpid); 44*e7be843bSPierre Proncherywaitpid($serverpid, 0); 45