Skip to content

Commit f833470

Browse files
matttbePaolo Abeni
authored andcommitted
selftests: mptcp: join: check backup support in signal endp
Before the previous commit, 'signal' endpoints with the 'backup' flag were ignored when sending the MP_JOIN. The MPTCP Join selftest has then been modified to validate this case: the "single address, backup" test, is now validating the MP_JOIN with a backup flag as it is what we expect it to do with such name. The previous version has been kept, but renamed to "single address, switch to backup" to avoid confusions. The "single address with port, backup" test is also now validating the MPJ with a backup flag, which makes more sense than checking the switch to backup with an MP_PRIO. The "mpc backup both sides" test is now validating that the backup flag is also set in MP_JOIN from and to the addresses used in the initial subflow, using the special ID 0. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: 4596a2c ("mptcp: allow creating non-backup subflows") Cc: [email protected] Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 6834097 commit f833470

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,6 +2639,19 @@ backup_tests()
26392639

26402640
# single address, backup
26412641
if reset "single address, backup" &&
2642+
continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
2643+
pm_nl_set_limits $ns1 0 1
2644+
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,backup
2645+
pm_nl_set_limits $ns2 1 1
2646+
sflags=nobackup speed=slow \
2647+
run_tests $ns1 $ns2 10.0.1.1
2648+
chk_join_nr 1 1 1
2649+
chk_add_nr 1 1
2650+
chk_prio_nr 1 0 0 1
2651+
fi
2652+
2653+
# single address, switch to backup
2654+
if reset "single address, switch to backup" &&
26422655
continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
26432656
pm_nl_set_limits $ns1 0 1
26442657
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2654,13 +2667,13 @@ backup_tests()
26542667
if reset "single address with port, backup" &&
26552668
continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
26562669
pm_nl_set_limits $ns1 0 1
2657-
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal port 10100
2670+
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,backup port 10100
26582671
pm_nl_set_limits $ns2 1 1
2659-
sflags=backup speed=slow \
2672+
sflags=nobackup speed=slow \
26602673
run_tests $ns1 $ns2 10.0.1.1
26612674
chk_join_nr 1 1 1
26622675
chk_add_nr 1 1
2663-
chk_prio_nr 1 1 0 0
2676+
chk_prio_nr 1 0 0 1
26642677
fi
26652678

26662679
if reset "mpc backup" &&
@@ -2674,12 +2687,21 @@ backup_tests()
26742687

26752688
if reset "mpc backup both sides" &&
26762689
continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
2677-
pm_nl_add_endpoint $ns1 10.0.1.1 flags subflow,backup
2690+
pm_nl_set_limits $ns1 0 2
2691+
pm_nl_set_limits $ns2 1 2
2692+
pm_nl_add_endpoint $ns1 10.0.1.1 flags signal,backup
26782693
pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow,backup
2694+
2695+
# 10.0.2.2 (non-backup) -> 10.0.1.1 (backup)
2696+
pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow
2697+
# 10.0.1.2 (backup) -> 10.0.2.1 (non-backup)
2698+
pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
2699+
ip -net "$ns2" route add 10.0.2.1 via 10.0.1.1 dev ns2eth1 # force this path
2700+
26792701
speed=slow \
26802702
run_tests $ns1 $ns2 10.0.1.1
2681-
chk_join_nr 0 0 0
2682-
chk_prio_nr 1 1 0 0
2703+
chk_join_nr 2 2 2
2704+
chk_prio_nr 1 1 1 1
26832705
fi
26842706

26852707
if reset "mpc switch to backup" &&

0 commit comments

Comments
 (0)