Mercurial > hg > nginx-tests
comparison mail_ssl_conf_command.t @ 1860:58951cf933e1
Tests: added has_feature() test for SSL libraries.
This makes it possible to further simplify various SSL tests. It also
avoids direct testing of the $t->{_configure_args} internal field, and
implements proper comparison of version numbers.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 18 May 2023 18:07:06 +0300 |
parents | ce4a06d72256 |
children | 7b7b64569f55 |
comparison
equal
deleted
inserted
replaced
1859:5f46af4707e7 | 1860:58951cf933e1 |
---|---|
30 Net::SSLeay::SSLeay_add_ssl_algorithms(); | 30 Net::SSLeay::SSLeay_add_ssl_algorithms(); |
31 Net::SSLeay::randomize(); | 31 Net::SSLeay::randomize(); |
32 }; | 32 }; |
33 plan(skip_all => 'Net::SSLeay not installed') if $@; | 33 plan(skip_all => 'Net::SSLeay not installed') if $@; |
34 | 34 |
35 my $t = Test::Nginx->new()->has(qw/mail mail_ssl imap/) | 35 my $t = Test::Nginx->new()->has(qw/mail mail_ssl imap openssl:1.0.2/) |
36 ->has_daemon('openssl'); | 36 ->has_daemon('openssl'); |
37 | 37 |
38 $t->{_configure_args} =~ /OpenSSL ([\d\.]+)/; | |
39 plan(skip_all => 'OpenSSL too old') unless defined $1 and $1 ge '1.0.2'; | |
40 plan(skip_all => 'no ssl_conf_command') if $t->has_module('BoringSSL'); | 38 plan(skip_all => 'no ssl_conf_command') if $t->has_module('BoringSSL'); |
41 | 39 |
42 $t->write_file_expand('nginx.conf', <<'EOF'); | 40 $t->write_file_expand('nginx.conf', <<'EOF'); |
43 | 41 |
44 %%TEST_GLOBALS%% | 42 %%TEST_GLOBALS%% |