From: Frederik Wedel-Heinen Date: Tue, 30 Jan 2024 09:31:00 +0000 (+0100) Subject: Skip tests if build does not support dtls1.2 or tls1.2 X-Git-Tag: openssl-3.3.0-alpha1~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f7694c825131e3f364388e42cda5aeac0f37754;p=thirdparty%2Fopenssl.git Skip tests if build does not support dtls1.2 or tls1.2 Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/23319) --- diff --git a/test/recipes/70-test_sslrecords.t b/test/recipes/70-test_sslrecords.t index 02110714e9e..a7d13c3abc8 100644 --- a/test/recipes/70-test_sslrecords.t +++ b/test/recipes/70-test_sslrecords.t @@ -26,9 +26,6 @@ plan skip_all => "$test_name needs the dynamic engine feature enabled" plan skip_all => "$test_name needs the sock feature enabled" if disabled("sock"); -plan skip_all => "$test_name needs TLSv1.2 enabled" - if disabled("tls1_2"); - my $testplanisset = 0; my $inject_recs_num = undef; my $content_type = undef; @@ -37,15 +34,31 @@ my $fatal_alert = undef; # set by filters at expected fatal alerts my $sslv2testtype = undef; my $proxy_start_success = 0; -# Run tests with TLS -run_tests(0); -# Run tests with DTLS -run_tests(1); +my $proxy = TLSProxy::Proxy->new( + undef, + cmdstr(app([ "openssl" ]), display => 1), + srctop_file("apps", "server.pem"), + (!$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE}) +); + +$proxy->start() or plan skip_all => "Unable to start up Proxy for tests"; +plan tests => 42; + +SKIP: { + skip "TLS 1.2 is disabled", 21 if disabled("tls1_2"); + # Run tests with TLS + run_tests(0); +} + +SKIP: { + skip "DTLS 1.2 is disabled", 21 if disabled("dtls1_2"); + # Run tests with DTLS + run_tests(1); +} sub run_tests { my $run_test_as_dtls = shift; - my $proxy; if ($run_test_as_dtls == 1) { $proxy = TLSProxy::Proxy->new_dtls( \&add_empty_recs_filter, @@ -71,11 +84,7 @@ sub run_tests $fatal_alert = 0; $proxy->serverflags("-tls1_2"); $proxy->clientflags("-no_tls1_3"); - $proxy->start() or plan skip_all => "Unable to start up Proxy for tests"; - if ($testplanisset == 0) { - plan tests => 42; - $testplanisset = 1; - } + $proxy->start(); ok($fatal_alert, "Out of context empty records test"); }