@@ -96,6 +96,18 @@ static void multipath_test_set_unreachable(picoquic_test_tls_api_ctx_t* test_ctx
96
96
}
97
97
}
98
98
99
+ static void multipath_test_set_reachable (picoquic_test_tls_api_ctx_t * test_ctx , int link_id )
100
+ {
101
+ if (link_id == 0 ) {
102
+ test_ctx -> c_to_s_link -> is_unreachable = 0 ;
103
+ test_ctx -> s_to_c_link -> is_unreachable = 0 ;
104
+ }
105
+ else {
106
+ test_ctx -> c_to_s_link_2 -> is_unreachable = 0 ;
107
+ test_ctx -> s_to_c_link_2 -> is_unreachable = 0 ;
108
+ }
109
+ }
110
+
99
111
static void multipath_test_unkill_links (picoquic_test_tls_api_ctx_t * test_ctx , int link_id , uint64_t current_time )
100
112
{
101
113
/* Make sure that nothing gets sent on the old links */
@@ -438,6 +450,8 @@ typedef enum {
438
450
multipath_test_nat_challenge ,
439
451
multipath_test_break1 ,
440
452
multipath_test_break2 ,
453
+ multipath_test_break3 ,
454
+ multipath_test_back0 ,
441
455
multipath_test_back1 ,
442
456
multipath_test_perf ,
443
457
multipath_test_callback ,
@@ -911,8 +925,8 @@ int multipath_test_one(uint64_t max_completion_microsec, multipath_test_enum_t t
911
925
912
926
if (ret == 0 && (test_id == multipath_test_drop_first || test_id == multipath_test_drop_second ||
913
927
test_id == multipath_test_renew || test_id == multipath_test_nat || test_id == multipath_test_nat_challenge ||
914
- test_id == multipath_test_break1 || test_id == multipath_test_break2 ||
915
- test_id == multipath_test_back1 || test_id == multipath_test_standup ||
928
+ test_id == multipath_test_break1 || test_id == multipath_test_break2 || test_id == multipath_test_break3 ||
929
+ test_id == multipath_test_back0 || test_id == multipath_test_back1 || test_id == multipath_test_standup ||
916
930
test_id == multipath_test_abandon || test_id == multipath_test_tunnel )) {
917
931
/* If testing a final link drop before completion, perform a
918
932
* partial sending loop and then kill the initial link.
@@ -950,6 +964,10 @@ int multipath_test_one(uint64_t max_completion_microsec, multipath_test_enum_t t
950
964
/* Trigger "destination unreachable" error on next socket call to link 1 */
951
965
multipath_test_set_unreachable (test_ctx , 1 );
952
966
}
967
+ else if (test_id == multipath_test_back0 || test_id == multipath_test_break3 ) {
968
+ /* Trigger "destination unreachable" error on next socket call to link 0 */
969
+ multipath_test_set_unreachable (test_ctx , 0 );
970
+ }
953
971
else if (test_id == multipath_test_tunnel ) {
954
972
/* Break both links */
955
973
multipath_test_kill_links (test_ctx , 0 );
@@ -964,7 +982,7 @@ int multipath_test_one(uint64_t max_completion_microsec, multipath_test_enum_t t
964
982
/* For the "backup scenario", wait a small interval, then bring the path # 1 back up
965
983
* For the "tunnel" scenario, do the same but wait 5 seconds and then restore both links.
966
984
*/
967
- if (ret == 0 && (test_id == multipath_test_back1 || test_id == multipath_test_tunnel )) {
985
+ if (ret == 0 && (test_id == multipath_test_back0 || test_id == multipath_test_back1 || test_id == multipath_test_tunnel )) {
968
986
uint64_t timeout = (test_id == multipath_test_tunnel )?5000000 :1000000 ;
969
987
970
988
ret = tls_api_wait_for_timeout (test_ctx , & simulated_time , timeout );
@@ -973,6 +991,15 @@ int multipath_test_one(uint64_t max_completion_microsec, multipath_test_enum_t t
973
991
{
974
992
DBG_PRINTF ("Wait for %" PRIu64 "us returns %d\n" , timeout , ret );
975
993
}
994
+ else if (test_id == multipath_test_back0 ) {
995
+ multipath_test_set_reachable (test_ctx , 0 );
996
+
997
+ ret = picoquic_probe_new_path (test_ctx -> cnx_client , (struct sockaddr * )& test_ctx -> server_addr ,
998
+ (struct sockaddr * )& test_ctx -> client_addr , simulated_time );
999
+ if (ret != 0 ) {
1000
+ DBG_PRINTF ("Create path on default address returns %d\n" , ret );
1001
+ }
1002
+ }
976
1003
else {
977
1004
if (test_id == multipath_test_tunnel ) {
978
1005
multipath_test_unkill_links (test_ctx , 0 , simulated_time );
@@ -1140,7 +1167,7 @@ int multipath_test_one(uint64_t max_completion_microsec, multipath_test_enum_t t
1140
1167
}
1141
1168
}
1142
1169
1143
- if (ret == 0 && (test_id == multipath_test_break1 || test_id == multipath_test_break2 || test_id == multipath_test_abandon )) {
1170
+ if (ret == 0 && (test_id == multipath_test_break1 || test_id == multipath_test_break2 || test_id == multipath_test_break3 || test_id == multipath_test_abandon )) {
1144
1171
if (test_ctx -> cnx_server -> nb_paths != 1 ) {
1145
1172
DBG_PRINTF ("After break, %d paths on server connection.\n" , test_ctx -> cnx_server -> nb_paths );
1146
1173
ret = -1 ;
@@ -1150,7 +1177,7 @@ int multipath_test_one(uint64_t max_completion_microsec, multipath_test_enum_t t
1150
1177
}
1151
1178
}
1152
1179
1153
- if (ret == 0 && test_id == multipath_test_back1 ) {
1180
+ if (ret == 0 && ( test_id == multipath_test_back0 || test_id == multipath_test_back1 ) ) {
1154
1181
if (test_ctx -> cnx_server -> nb_paths != 2 ) {
1155
1182
DBG_PRINTF ("After break and back, %d paths on server connection.\n" , test_ctx -> cnx_server -> nb_paths );
1156
1183
ret = -1 ;
@@ -1347,6 +1374,15 @@ int multipath_socket_error_test()
1347
1374
return multipath_test_one (max_completion_microsec , multipath_test_break2 );
1348
1375
}
1349
1376
1377
+ /* Test reaction to socket error on first path
1378
+ */
1379
+ int multipath_socket0_error_test ()
1380
+ {
1381
+ uint64_t max_completion_microsec = 10900000 ;
1382
+
1383
+ return multipath_test_one (max_completion_microsec , multipath_test_break3 );
1384
+ }
1385
+
1350
1386
/* Test that abandoned paths are removed after some time
1351
1387
*/
1352
1388
int multipath_abandon_test ()
@@ -1356,6 +1392,16 @@ int multipath_abandon_test()
1356
1392
return multipath_test_one (max_completion_microsec , multipath_test_abandon );
1357
1393
}
1358
1394
1395
+ /* Test that after breaking path 0 we can establish a new path on the
1396
+ * same link when it comes back up.
1397
+ */
1398
+ int multipath_back0_test ()
1399
+ {
1400
+ uint64_t max_completion_microsec = 3300000 ;
1401
+
1402
+ return multipath_test_one (max_completion_microsec , multipath_test_back0 );
1403
+ }
1404
+
1359
1405
/* Test that breaking paths can come back up after some time
1360
1406
*/
1361
1407
int multipath_back1_test ()
0 commit comments