xref: /freebsd/crypto/openssl/test/recipes/70-test_quic_multistream.t (revision e7be843b4a162e68651d3911f0357ed464915629)
1*e7be843bSPierre Pronchery#! /usr/bin/env perl
2*e7be843bSPierre Pronchery# Copyright 2022-2025 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 Proncheryuse OpenSSL::Test qw/:DEFAULT srctop_file result_dir data_file/;
10*e7be843bSPierre Proncheryuse OpenSSL::Test::Utils;
11*e7be843bSPierre Proncheryuse File::Temp qw(tempfile);
12*e7be843bSPierre Proncheryuse File::Path 2.00 qw(rmtree mkpath);
13*e7be843bSPierre Pronchery
14*e7be843bSPierre Proncherysetup("test_quic_multistream");
15*e7be843bSPierre Pronchery
16*e7be843bSPierre Proncheryplan skip_all => "QUIC protocol is not supported by this OpenSSL build"
17*e7be843bSPierre Pronchery    if disabled('quic');
18*e7be843bSPierre Pronchery
19*e7be843bSPierre Proncheryplan tests => 2;
20*e7be843bSPierre Pronchery
21*e7be843bSPierre Proncherymy $qlog_output;
22*e7be843bSPierre Proncheryif (!disabled('qlog')) {
23*e7be843bSPierre Pronchery    $qlog_output = result_dir("qlog-output");
24*e7be843bSPierre Pronchery    print "# Writing qlog output to $qlog_output\n";
25*e7be843bSPierre Pronchery    rmtree($qlog_output, { safe => 1 });
26*e7be843bSPierre Pronchery    mkdir($qlog_output);
27*e7be843bSPierre Pronchery    $ENV{QLOGDIR} = $qlog_output;
28*e7be843bSPierre Pronchery}
29*e7be843bSPierre Pronchery
30*e7be843bSPierre Pronchery$ENV{OSSL_QFILTER} = "* -quic:unknown_event quic:another_unknown_event";
31*e7be843bSPierre Pronchery
32*e7be843bSPierre Proncheryok(run(test(["quic_multistream_test",
33*e7be843bSPierre Pronchery             srctop_file("test", "certs", "servercert.pem"),
34*e7be843bSPierre Pronchery             srctop_file("test", "certs", "serverkey.pem")])));
35*e7be843bSPierre Pronchery
36*e7be843bSPierre ProncherySKIP: {
37*e7be843bSPierre Pronchery    skip "no qlog", 1 if disabled('qlog');
38*e7be843bSPierre Pronchery    skip "not running CI tests", 1 unless $ENV{OSSL_RUN_CI_TESTS};
39*e7be843bSPierre Pronchery
40*e7be843bSPierre Pronchery    subtest "check qlog output" => sub {
41*e7be843bSPierre Pronchery        plan tests => 1;
42*e7be843bSPierre Pronchery
43*e7be843bSPierre Pronchery        ok(run(cmd([data_file("verify-qlog.py")], exe_shell => "python3")),
44*e7be843bSPierre Pronchery               "running qlog verification script");
45*e7be843bSPierre Pronchery    };
46*e7be843bSPierre Pronchery}
47