diff 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
line wrap: on
line diff
--- a/quic_migration.t
+++ b/quic_migration.t
@@ -129,7 +129,13 @@ is($frame->{headers}{'x-ip'}, '127.0.0.2
 $s->{scid} = "connection_id_1";
 $s->{dcid} = $frame->{cid};
 
-$frames = $s->read(all => [{ sid => $s->new_stream(), fin => 1 }]);
+my $sid = $s->new_stream();
+
+$frames = $s->read(all => [{ type => 'PATH_CHALLENGE' }]);
+($frame) = grep { $_->{type} eq "PATH_CHALLENGE" } @$frames;
+$s->path_response($frame->{data});
+
+$frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
 is($frame->{headers}{'x-ip'}, '127.0.0.1', 'remote addr on migration');