95-test_external_cf_quiche.t 1.4 KB

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