Skip to content

Commit cd23f93

Browse files
matttbeintel-lab-lkp
authored andcommitted
selftests: mptcp: validate MPJoinRejected counter
The parent commit adds this new counter, incremented when receiving a connection request, if the PM didn't allow the creation of new subflows. Most of the time, it is then kept at 0, except when the PM limits cause the receiver side to reject new MPJoin connections. This is the case in the following tests: - single subflow, limited by server - multiple subflows, limited by server - subflows limited by server w cookies - userspace pm type rejects join - userspace pm type prevents mp_prio Simply set join_syn_rej=1 when checking the MPJoin counters for these tests. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent 456fbd1 commit cd23f93

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ unset sflags
6262
unset fastclose
6363
unset fullmesh
6464
unset speed
65+
unset join_syn_rej
6566
unset join_csum_ns1
6667
unset join_csum_ns2
6768
unset join_fail_nr
@@ -1403,6 +1404,7 @@ chk_join_nr()
14031404
local syn_nr=$1
14041405
local syn_ack_nr=$2
14051406
local ack_nr=$3
1407+
local syn_rej=${join_syn_rej:-0}
14061408
local csum_ns1=${join_csum_ns1:-0}
14071409
local csum_ns2=${join_csum_ns2:-0}
14081410
local fail_nr=${join_fail_nr:-0}
@@ -1468,6 +1470,15 @@ chk_join_nr()
14681470
fail_test "got $count JOIN[s] ack HMAC failure expected 0"
14691471
fi
14701472

1473+
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinRejected")
1474+
if [ -z "$count" ]; then
1475+
rc=${KSFT_SKIP}
1476+
elif [ "$count" != "$syn_rej" ]; then
1477+
rc=${KSFT_FAIL}
1478+
print_check "syn rejected"
1479+
fail_test "got $count JOIN[s] syn rejected expected $syn_rej"
1480+
fi
1481+
14711482
print_results "join Rx" ${rc}
14721483

14731484
join_syn_tx="${join_syn_tx:-${syn_nr}}" \
@@ -1963,7 +1974,8 @@ subflows_tests()
19631974
pm_nl_set_limits $ns2 0 1
19641975
pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow
19651976
run_tests $ns1 $ns2 10.0.1.1
1966-
chk_join_nr 1 1 0
1977+
join_syn_rej=1 \
1978+
chk_join_nr 1 1 0
19671979
fi
19681980

19691981
# subflow
@@ -1992,7 +2004,8 @@ subflows_tests()
19922004
pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow
19932005
pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow
19942006
run_tests $ns1 $ns2 10.0.1.1
1995-
chk_join_nr 2 2 1
2007+
join_syn_rej=1 \
2008+
chk_join_nr 2 2 1
19962009
fi
19972010

19982011
# single subflow, dev
@@ -3061,7 +3074,8 @@ syncookies_tests()
30613074
pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow
30623075
pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow
30633076
run_tests $ns1 $ns2 10.0.1.1
3064-
chk_join_nr 2 1 1
3077+
join_syn_rej=1 \
3078+
chk_join_nr 2 1 1
30653079
fi
30663080

30673081
# test signal address with cookies
@@ -3545,7 +3559,8 @@ userspace_tests()
35453559
pm_nl_set_limits $ns2 1 1
35463560
pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow
35473561
run_tests $ns1 $ns2 10.0.1.1
3548-
chk_join_nr 1 1 0
3562+
join_syn_rej=1 \
3563+
chk_join_nr 1 1 0
35493564
fi
35503565

35513566
# userspace pm type does not send join
@@ -3568,7 +3583,8 @@ userspace_tests()
35683583
pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow
35693584
sflags=backup speed=slow \
35703585
run_tests $ns1 $ns2 10.0.1.1
3571-
chk_join_nr 1 1 0
3586+
join_syn_rej=1 \
3587+
chk_join_nr 1 1 0
35723588
chk_prio_nr 0 0 0 0
35733589
fi
35743590

0 commit comments

Comments
 (0)