comparison quic_migration.t @ 1932:b68471aee5ad

Tests: improved test for a stream initiating QUIC path migration. Previously, the test mostly passed due to a push timer scheduled for an unrelated delayed ACK, and the new path had enough data received to send response back when the push timer fired. Otherwise, the test could fail due to unvalidated address. Now it is fixed to perform path validation.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 21 Aug 2023 17:10:57 +0400
parents 8b74936ff2ac
children 00124c7d0ef1
comparison
equal deleted inserted replaced
1931:afe4af958e53 1932:b68471aee5ad
127 PeerAddr => '127.0.0.1:' . port(8980), 127 PeerAddr => '127.0.0.1:' . port(8980),
128 ); 128 );
129 $s->{scid} = "connection_id_1"; 129 $s->{scid} = "connection_id_1";
130 $s->{dcid} = $frame->{cid}; 130 $s->{dcid} = $frame->{cid};
131 131
132 $frames = $s->read(all => [{ sid => $s->new_stream(), fin => 1 }]); 132 my $sid = $s->new_stream();
133
134 $frames = $s->read(all => [{ type => 'PATH_CHALLENGE' }]);
135 ($frame) = grep { $_->{type} eq "PATH_CHALLENGE" } @$frames;
136 $s->path_response($frame->{data});
137
138 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
133 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 139 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
134 is($frame->{headers}{'x-ip'}, '127.0.0.1', 'remote addr on migration'); 140 is($frame->{headers}{'x-ip'}, '127.0.0.1', 'remote addr on migration');
135 141
136 ############################################################################### 142 ###############################################################################