Skip to content

Commit 935ff5b

Browse files
matttbePaolo Abeni
authored andcommitted
selftests: mptcp: join: validate backup in MPJ
A peer can notify the other one that a subflow has to be treated as "backup" by two different ways: either by sending a dedicated MP_PRIO notification, or by setting the backup flag in the MP_JOIN handshake. The selftests were previously monitoring the former, but not the latter. This is what is now done here by looking at these new MIB counters when validating the 'backup' cases: MPTcpExtMPJoinSynBackupRx MPTcpExtMPJoinSynAckBackupRx 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 will help to validate a new fix for an issue introduced by this commit ID. Fixes: 4596a2c ("mptcp: allow creating non-backup subflows") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 4dde0d7 commit 935ff5b

1 file changed

Lines changed: 32 additions & 10 deletions

File tree

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

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,8 @@ chk_prio_nr()
16341634
{
16351635
local mp_prio_nr_tx=$1
16361636
local mp_prio_nr_rx=$2
1637+
local mpj_syn=$3
1638+
local mpj_syn_ack=$4
16371639
local count
16381640

16391641
print_check "ptx"
@@ -1655,6 +1657,26 @@ chk_prio_nr()
16551657
else
16561658
print_ok
16571659
fi
1660+
1661+
print_check "syn backup"
1662+
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinSynBackupRx")
1663+
if [ -z "$count" ]; then
1664+
print_skip
1665+
elif [ "$count" != "$mpj_syn" ]; then
1666+
fail_test "got $count JOIN[s] syn with Backup expected $mpj_syn"
1667+
else
1668+
print_ok
1669+
fi
1670+
1671+
print_check "synack backup"
1672+
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynAckBackupRx")
1673+
if [ -z "$count" ]; then
1674+
print_skip
1675+
elif [ "$count" != "$mpj_syn_ack" ]; then
1676+
fail_test "got $count JOIN[s] synack with Backup expected $mpj_syn_ack"
1677+
else
1678+
print_ok
1679+
fi
16581680
}
16591681

16601682
chk_subflow_nr()
@@ -2612,7 +2634,7 @@ backup_tests()
26122634
sflags=nobackup speed=slow \
26132635
run_tests $ns1 $ns2 10.0.1.1
26142636
chk_join_nr 1 1 1
2615-
chk_prio_nr 0 1
2637+
chk_prio_nr 0 1 1 0
26162638
fi
26172639

26182640
# single address, backup
@@ -2625,7 +2647,7 @@ backup_tests()
26252647
run_tests $ns1 $ns2 10.0.1.1
26262648
chk_join_nr 1 1 1
26272649
chk_add_nr 1 1
2628-
chk_prio_nr 1 1
2650+
chk_prio_nr 1 1 0 0
26292651
fi
26302652

26312653
# single address with port, backup
@@ -2638,7 +2660,7 @@ backup_tests()
26382660
run_tests $ns1 $ns2 10.0.1.1
26392661
chk_join_nr 1 1 1
26402662
chk_add_nr 1 1
2641-
chk_prio_nr 1 1
2663+
chk_prio_nr 1 1 0 0
26422664
fi
26432665

26442666
if reset "mpc backup" &&
@@ -2647,7 +2669,7 @@ backup_tests()
26472669
speed=slow \
26482670
run_tests $ns1 $ns2 10.0.1.1
26492671
chk_join_nr 0 0 0
2650-
chk_prio_nr 0 1
2672+
chk_prio_nr 0 1 0 0
26512673
fi
26522674

26532675
if reset "mpc backup both sides" &&
@@ -2657,7 +2679,7 @@ backup_tests()
26572679
speed=slow \
26582680
run_tests $ns1 $ns2 10.0.1.1
26592681
chk_join_nr 0 0 0
2660-
chk_prio_nr 1 1
2682+
chk_prio_nr 1 1 0 0
26612683
fi
26622684

26632685
if reset "mpc switch to backup" &&
@@ -2666,7 +2688,7 @@ backup_tests()
26662688
sflags=backup speed=slow \
26672689
run_tests $ns1 $ns2 10.0.1.1
26682690
chk_join_nr 0 0 0
2669-
chk_prio_nr 0 1
2691+
chk_prio_nr 0 1 0 0
26702692
fi
26712693

26722694
if reset "mpc switch to backup both sides" &&
@@ -2676,7 +2698,7 @@ backup_tests()
26762698
sflags=backup speed=slow \
26772699
run_tests $ns1 $ns2 10.0.1.1
26782700
chk_join_nr 0 0 0
2679-
chk_prio_nr 1 1
2701+
chk_prio_nr 1 1 0 0
26802702
fi
26812703
}
26822704

@@ -3053,7 +3075,7 @@ fullmesh_tests()
30533075
addr_nr_ns2=1 sflags=backup,fullmesh speed=slow \
30543076
run_tests $ns1 $ns2 10.0.1.1
30553077
chk_join_nr 2 2 2
3056-
chk_prio_nr 0 1
3078+
chk_prio_nr 0 1 1 0
30573079
chk_rm_nr 0 1
30583080
fi
30593081

@@ -3066,7 +3088,7 @@ fullmesh_tests()
30663088
sflags=nobackup,nofullmesh speed=slow \
30673089
run_tests $ns1 $ns2 10.0.1.1
30683090
chk_join_nr 2 2 2
3069-
chk_prio_nr 0 1
3091+
chk_prio_nr 0 1 1 0
30703092
chk_rm_nr 0 1
30713093
fi
30723094
}
@@ -3318,7 +3340,7 @@ userspace_tests()
33183340
sflags=backup speed=slow \
33193341
run_tests $ns1 $ns2 10.0.1.1
33203342
chk_join_nr 1 1 0
3321-
chk_prio_nr 0 0
3343+
chk_prio_nr 0 0 0 0
33223344
fi
33233345

33243346
# userspace pm type prevents rm_addr

0 commit comments

Comments
 (0)