Skip to content

Commit 1084058

Browse files
committed
Tests: added has_feature() test for CryptX.
1 parent 488d1d3 commit 1084058

15 files changed

+21
-56
lines changed

h3_absolute_redirect.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy rewrite/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy rewrite cryptx/)
3027
->has_daemon('openssl')->plan(23);
3128

3229
$t->write_file_expand('nginx.conf', <<'EOF');

h3_headers.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy rewrite/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy rewrite cryptx/)
3027
->has_daemon('openssl')->plan(68)
3128
->write_file_expand('nginx.conf', <<'EOF');
3229

h3_keepalive.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/)
3027
->has_daemon('openssl')->plan(15)
3128
->write_file_expand('nginx.conf', <<'EOF');
3229

h3_limit_conn.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3 limit_conn proxy/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 limit_conn proxy cryptx/)
3027
->has_daemon('openssl')->plan(2);
3128

3229
$t->write_file_expand('nginx.conf', <<'EOF');

h3_limit_req.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy limit_req/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy limit_req cryptx/)
3027
->has_daemon('openssl')->plan(6);
3128

3229
$t->write_file_expand('nginx.conf', <<'EOF');

h3_proxy.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy cryptx/)
3027
->has_daemon('openssl')->plan(3)
3128
->write_file_expand('nginx.conf', <<'EOF');
3229

h3_proxy_max_temp_file_size.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 proxy cryptx/)
3027
->has_daemon('openssl')->plan(4);
3128

3229
$t->write_file_expand('nginx.conf', <<'EOF');

h3_reusable.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/)
3027
->has_daemon('openssl')->plan(1)
3128
->write_file_expand('nginx.conf', <<'EOF');
3229

h3_server_name.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@ use Test::Nginx::HTTP3;
2424
select STDERR; $| = 1;
2525
select STDOUT; $| = 1;
2626

27-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
28-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
29-
3027
my $t = Test::Nginx->new()
31-
->has(qw/http http_ssl http_v2 http_v3 rewrite socket_ssl_alpn/)
28+
->has(qw/http http_ssl http_v2 http_v3 rewrite socket_ssl_alpn cryptx/)
3229
->has_daemon('openssl')->plan(6);
3330

3431
$t->write_file_expand('nginx.conf', <<'EOF');

h3_server_tokens.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3 rewrite/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 rewrite cryptx/)
3027
->has_daemon('openssl')->plan(12);
3128

3229
$t->write_file_expand('nginx.conf', <<'EOF');

h3_ssl_reject_handshake.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/)
3027
->has_daemon('openssl')->plan(7)
3128
->write_file_expand('nginx.conf', <<'EOF');
3229

h3_ssl_session_reuse.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/)
3027
->has_daemon('openssl')->plan(8)
3128
->write_file_expand('nginx.conf', <<'EOF');
3229

h3_trailers.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
29-
my $t = Test::Nginx->new()->has(qw/http http_v3/)
26+
my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/)
3027
->has_daemon('openssl')->plan(8);
3128

3229
$t->write_file_expand('nginx.conf', <<'EOF');

lib/Test/Nginx.pm

+7
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,13 @@ sub has_feature($) {
288288
return 1;
289289
}
290290

291+
if ($feature eq 'cryptx') {
292+
eval { require Crypt::Misc; };
293+
return 0 if $@;
294+
eval { die if $Crypt::Misc::VERSION < 0.067; };
295+
return !$@;
296+
}
297+
291298
return 0;
292299
}
293300

quic_migration.t

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ use Test::Nginx::HTTP3;
2323
select STDERR; $| = 1;
2424
select STDOUT; $| = 1;
2525

26-
eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; };
27-
plan(skip_all => 'CryptX version >= 0.067 required') if $@;
28-
2926
plan(skip_all => '127.0.0.20 local address required')
3027
unless defined IO::Socket::INET->new( LocalAddr => '127.0.0.20' );
3128

32-
my $t = Test::Nginx->new()->has(qw/http http_v3/)
29+
my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/)
3330
->has_daemon('openssl')->plan(2);
3431

3532
$t->write_file_expand('nginx.conf', <<'EOF');

0 commit comments

Comments
 (0)