Mercurial > hg > nginx-tests
changeset 1896:8b74936ff2ac
Tests: added has_feature() test for CryptX.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 29 May 2023 17:04:36 +0400 |
parents | acd68670b064 |
children | 38f1fd9ca3e6 |
files | h3_absolute_redirect.t h3_headers.t h3_keepalive.t h3_limit_conn.t h3_limit_req.t h3_proxy.t h3_proxy_max_temp_file_size.t h3_reusable.t h3_server_name.t h3_server_tokens.t h3_ssl_reject_handshake.t h3_ssl_session_reuse.t h3_trailers.t lib/Test/Nginx.pm quic_migration.t |
diffstat | 15 files changed, 21 insertions(+), 56 deletions(-) [+] |
line wrap: on
line diff
--- a/h3_absolute_redirect.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_absolute_redirect.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3 proxy rewrite/) +my $t = Test::Nginx->new()->has(qw/http http_v3 proxy rewrite cryptx/) ->has_daemon('openssl')->plan(23); $t->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_headers.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_headers.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3 proxy rewrite/) +my $t = Test::Nginx->new()->has(qw/http http_v3 proxy rewrite cryptx/) ->has_daemon('openssl')->plan(68) ->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_keepalive.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_keepalive.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3/) +my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/) ->has_daemon('openssl')->plan(15) ->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_limit_conn.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_limit_conn.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3 limit_conn proxy/) +my $t = Test::Nginx->new()->has(qw/http http_v3 limit_conn proxy cryptx/) ->has_daemon('openssl')->plan(2); $t->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_limit_req.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_limit_req.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3 proxy limit_req/) +my $t = Test::Nginx->new()->has(qw/http http_v3 proxy limit_req cryptx/) ->has_daemon('openssl')->plan(6); $t->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_proxy.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_proxy.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3 proxy/) +my $t = Test::Nginx->new()->has(qw/http http_v3 proxy cryptx/) ->has_daemon('openssl')->plan(3) ->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_proxy_max_temp_file_size.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_proxy_max_temp_file_size.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3 proxy/) +my $t = Test::Nginx->new()->has(qw/http http_v3 proxy cryptx/) ->has_daemon('openssl')->plan(4); $t->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_reusable.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_reusable.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3/) +my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/) ->has_daemon('openssl')->plan(1) ->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_server_name.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_server_name.t Mon May 29 17:04:36 2023 +0400 @@ -24,11 +24,8 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - my $t = Test::Nginx->new() - ->has(qw/http http_ssl http_v2 http_v3 rewrite socket_ssl_alpn/) + ->has(qw/http http_ssl http_v2 http_v3 rewrite socket_ssl_alpn cryptx/) ->has_daemon('openssl')->plan(6); $t->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_server_tokens.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_server_tokens.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3 rewrite/) +my $t = Test::Nginx->new()->has(qw/http http_v3 rewrite cryptx/) ->has_daemon('openssl')->plan(12); $t->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_ssl_reject_handshake.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_ssl_reject_handshake.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3/) +my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/) ->has_daemon('openssl')->plan(7) ->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_ssl_session_reuse.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_ssl_session_reuse.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3/) +my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/) ->has_daemon('openssl')->plan(8) ->write_file_expand('nginx.conf', <<'EOF');
--- a/h3_trailers.t Wed May 24 19:11:17 2023 +0400 +++ b/h3_trailers.t Mon May 29 17:04:36 2023 +0400 @@ -23,10 +23,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - -my $t = Test::Nginx->new()->has(qw/http http_v3/) +my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/) ->has_daemon('openssl')->plan(8); $t->write_file_expand('nginx.conf', <<'EOF');
--- a/lib/Test/Nginx.pm Wed May 24 19:11:17 2023 +0400 +++ b/lib/Test/Nginx.pm Mon May 29 17:04:36 2023 +0400 @@ -288,6 +288,13 @@ return 1; } + if ($feature eq 'cryptx') { + eval { require Crypt::Misc; }; + return 0 if $@; + eval { die if $Crypt::Misc::VERSION < 0.067; }; + return !$@; + } + return 0; }
--- a/quic_migration.t Wed May 24 19:11:17 2023 +0400 +++ b/quic_migration.t Mon May 29 17:04:36 2023 +0400 @@ -23,13 +23,10 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -eval { require Crypt::Misc; die if $Crypt::Misc::VERSION < 0.067; }; -plan(skip_all => 'CryptX version >= 0.067 required') if $@; - plan(skip_all => '127.0.0.20 local address required') unless defined IO::Socket::INET->new( LocalAddr => '127.0.0.20' ); -my $t = Test::Nginx->new()->has(qw/http http_v3/) +my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/) ->has_daemon('openssl')->plan(2); $t->write_file_expand('nginx.conf', <<'EOF');