comparison stream_proxy_ssl_conf_command.t @ 1606:e4e0695552ed

Tests: fixed stream_proxy_ssl_conf_command.t. The stream_proxy_ssl_conf_command.t test used stream return module to return the response. Since this ignores actual request, but the perl test code used http_get(). This might result in the request being sent after the response is returned and the connection closed by the server, resulting in RST being generated and no response seen by the client at all. Fix is to use "stream(...)->read()" instead of http_get(), so no request is sent at all, eliminating possibility of RST being generated.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 10 Nov 2020 05:03:29 +0300
parents 4be791074207
children f3ba4c74de31
comparison
equal deleted inserted replaced
1605:aa5a61d1254b 1606:e4e0695552ed
14 14
15 BEGIN { use FindBin; chdir($FindBin::Bin); } 15 BEGIN { use FindBin; chdir($FindBin::Bin); }
16 16
17 use lib 'lib'; 17 use lib 'lib';
18 use Test::Nginx; 18 use Test::Nginx;
19 use Test::Nginx::Stream qw/ stream /;
19 20
20 ############################################################################### 21 ###############################################################################
21 22
22 select STDERR; $| = 1; 23 select STDERR; $| = 1;
23 select STDOUT; $| = 1; 24 select STDOUT; $| = 1;
79 $t->write_file('index.html', ''); 80 $t->write_file('index.html', '');
80 $t->try_run('no proxy_ssl_conf_command')->plan(1); 81 $t->try_run('no proxy_ssl_conf_command')->plan(1);
81 82
82 ############################################################################### 83 ###############################################################################
83 84
84 like(http_get('/'), qr/CN=override/, 'Certificate'); 85 like(stream('127.0.0.1:' . port(8080))->read(), qr/CN=override/,
86 'Certificate');
85 87
86 ############################################################################### 88 ###############################################################################