Skip to content

Commit

Permalink
selftests: mptcp: add fullmesh testcases
Browse files Browse the repository at this point in the history
This patch added the testcases for the fullmesh address flag of the path
manager.

Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Geliang Tang authored and David S. Miller committed Aug 18, 2021
1 parent 371b903 commit 4f49d63
Showing 1 changed file with 62 additions and 2 deletions.
64 changes: 62 additions & 2 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ do_transfer()
fi
fi

flags="subflow"
if [[ "${addr_nr_ns2}" = "fullmesh_"* ]]; then
flags="${flags},fullmesh"
addr_nr_ns2=${addr_nr_ns2:9}
fi

if [ $addr_nr_ns2 -gt 0 ]; then
let add_nr_ns2=addr_nr_ns2
counter=3
Expand All @@ -377,7 +383,7 @@ do_transfer()
else
addr="10.0.$counter.2"
fi
ip netns exec $ns2 ./pm_nl_ctl add $addr flags subflow
ip netns exec $ns2 ./pm_nl_ctl add $addr flags $flags
let counter+=1
let add_nr_ns2-=1
done
Expand Down Expand Up @@ -1686,6 +1692,55 @@ deny_join_id0_tests()
chk_join_nr "subflow and address allow join id0 2" 1 1 1
}

fullmesh_tests()
{
# fullmesh 1
# 2 fullmesh addrs in ns2, added before the connection,
# 1 non-fullmesh addr in ns1, added during the connection.
reset
ip netns exec $ns1 ./pm_nl_ctl limits 0 4
ip netns exec $ns2 ./pm_nl_ctl limits 1 4
ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow,fullmesh
ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow,fullmesh
run_tests $ns1 $ns2 10.0.1.1 0 1 0 slow
chk_join_nr "fullmesh test 2x1" 4 4 4
chk_add_nr 1 1

# fullmesh 2
# 1 non-fullmesh addr in ns1, added before the connection,
# 1 fullmesh addr in ns2, added during the connection.
reset
ip netns exec $ns1 ./pm_nl_ctl limits 1 3
ip netns exec $ns2 ./pm_nl_ctl limits 1 3
ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_1 slow
chk_join_nr "fullmesh test 1x1" 3 3 3
chk_add_nr 1 1

# fullmesh 3
# 1 non-fullmesh addr in ns1, added before the connection,
# 2 fullmesh addrs in ns2, added during the connection.
reset
ip netns exec $ns1 ./pm_nl_ctl limits 2 5
ip netns exec $ns2 ./pm_nl_ctl limits 1 5
ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_2 slow
chk_join_nr "fullmesh test 1x2" 5 5 5
chk_add_nr 1 1

# fullmesh 4
# 1 non-fullmesh addr in ns1, added before the connection,
# 2 fullmesh addrs in ns2, added during the connection,
# limit max_subflows to 4.
reset
ip netns exec $ns1 ./pm_nl_ctl limits 2 4
ip netns exec $ns2 ./pm_nl_ctl limits 1 4
ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
run_tests $ns1 $ns2 10.0.1.1 0 0 fullmesh_2 slow
chk_join_nr "fullmesh test 1x2, limited" 4 4 4
chk_add_nr 1 1
}

all_tests()
{
subflows_tests
Expand All @@ -1701,6 +1756,7 @@ all_tests()
syncookies_tests
checksum_tests
deny_join_id0_tests
fullmesh_tests
}

usage()
Expand All @@ -1719,6 +1775,7 @@ usage()
echo " -k syncookies_tests"
echo " -S checksum_tests"
echo " -d deny_join_id0_tests"
echo " -m fullmesh_tests"
echo " -c capture pcap files"
echo " -C enable data checksum"
echo " -h help"
Expand Down Expand Up @@ -1754,7 +1811,7 @@ if [ $do_all_tests -eq 1 ]; then
exit $ret
fi

while getopts 'fsltra64bpkdchCS' opt; do
while getopts 'fsltra64bpkdmchCS' opt; do
case $opt in
f)
subflows_tests
Expand Down Expand Up @@ -1795,6 +1852,9 @@ while getopts 'fsltra64bpkdchCS' opt; do
d)
deny_join_id0_tests
;;
m)
fullmesh_tests
;;
c)
;;
C)
Expand Down

0 comments on commit 4f49d63

Please sign in to comment.