comparison quic_migration.t @ 1942:00124c7d0ef1

Tests: made sure migrated QUIC connection didn't get stall. While working on connection migration patches, it was observed that connections could easly stuck due to bugs in bytes in-flight accounting. Added a simple test to make sure more data can be sent after confirming a client's ownership of its new address.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 11 Dec 2023 14:13:03 +0400
parents b68471aee5ad
children
comparison
equal deleted inserted replaced
1941:2c4f1019ee0d 1942:00124c7d0ef1
25 25
26 plan(skip_all => '127.0.0.20 local address required') 26 plan(skip_all => '127.0.0.20 local address required')
27 unless defined IO::Socket::INET->new( LocalAddr => '127.0.0.20' ); 27 unless defined IO::Socket::INET->new( LocalAddr => '127.0.0.20' );
28 28
29 my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/) 29 my $t = Test::Nginx->new()->has(qw/http http_v3 cryptx/)
30 ->has_daemon('openssl')->plan(2); 30 ->has_daemon('openssl')->plan(3);
31 31
32 $t->write_file_expand('nginx.conf', <<'EOF'); 32 $t->write_file_expand('nginx.conf', <<'EOF');
33 33
34 %%TEST_GLOBALS%% 34 %%TEST_GLOBALS%%
35 35
104 104
105 $frames = $s->read(all => [{ sid => $s->new_stream(), fin => 1 }]); 105 $frames = $s->read(all => [{ sid => $s->new_stream(), fin => 1 }]);
106 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 106 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
107 is($frame->{headers}{'x-ip'}, '127.0.0.20', 'remote addr after migration'); 107 is($frame->{headers}{'x-ip'}, '127.0.0.20', 'remote addr after migration');
108 108
109 $frames = $s->read(all => [{ sid => $s->new_stream(), fin => 1 }]);
110 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
111 is($frame->{headers}{'x-ip'}, '127.0.0.20', 'next packets after migration');
112
109 # test that $remote_addr is not truncated while in the process of migration; 113 # test that $remote_addr is not truncated while in the process of migration;
110 # the same but migration occurs on receiving a request stream itself, 114 # the same but migration occurs on receiving a request stream itself,
111 # which is the first non-probing frame on the new path; 115 # which is the first non-probing frame on the new path;
112 # this might lead to $remote_addr truncation in the following order: 116 # this might lead to $remote_addr truncation in the following order:
113 # - stream held original sockaddr/addr_text references on stream creation 117 # - stream held original sockaddr/addr_text references on stream creation