changeset 1472:7ae2747ee593

Tests: more stream_limit_rate.t tests.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 25 Apr 2019 13:40:34 +0300
parents 054f06c8a1e6
children ddbde6c5b0cd
files stream_limit_rate.t
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/stream_limit_rate.t
+++ b/stream_limit_rate.t
@@ -25,7 +25,7 @@ use Test::Nginx::Stream qw/ stream /;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/stream/)->plan(8)
+my $t = Test::Nginx->new()->has(qw/stream/)->plan(9)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -98,15 +98,18 @@ my $str = '1234567890' x 100;
 my %r = response($str, peer => '127.0.0.1:' . port(8081));
 is($r{'data'}, $str, 'exact limit');
 
-%r = response($str, peer => '127.0.0.1:' . port(8082));
-is($r{'data'}, $str, 'unlimited');
+%r = response($str . 'extra', peer => '127.0.0.1:' . port(8082));
+is($r{'data'}, $str . 'extra', 'unlimited');
 
 SKIP: {
-skip 'unsafe on VM', 2 unless $ENV{TEST_NGINX_UNSAFE};
+skip 'unsafe on VM', 3 unless $ENV{TEST_NGINX_UNSAFE};
 
 # if interaction between backend and client is slow then proxy can add extra
 # bytes to upload/download data
 
+%r = response($str . 'extra', peer => '127.0.0.1:' . port(8081));
+is($r{'data'}, $str, 'limited');
+
 %r = response($str, peer => '127.0.0.1:' . port(8083), readonce => 1);
 is($r{'data'}, '1', 'download - one byte');