Skip to content

Commit

Permalink
selftests: mptcp: use minus values for removing address numbers
Browse files Browse the repository at this point in the history
This patch changes the removing addresses numbers to minus values, left
the plus values for the adding addresses numbers.

Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
geliangtang authored and jenkins-tessares committed Jan 21, 2021
1 parent f8ed6ab commit 2dab810
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ do_transfer()
srv_proto="$4"
connect_addr="$5"
test_link_fail="$6"
rm_nr_ns1="$7"
rm_nr_ns2="$8"
addr_nr_ns1="$7"
addr_nr_ns2="$8"
speed="$9"
bkup="${10}"

Expand Down Expand Up @@ -264,7 +264,8 @@ do_transfer()
fi
cpid=$!

if [ $rm_nr_ns1 -gt 0 ]; then
if [ $addr_nr_ns1 -lt 0 ]; then
let rm_nr_ns1=-addr_nr_ns1
if [ $rm_nr_ns1 -lt 8 ]; then
counter=1
sleep 1
Expand All @@ -281,7 +282,8 @@ do_transfer()
fi
fi

if [ $rm_nr_ns2 -gt 0 ]; then
if [ $addr_nr_ns2 -lt 0 ]; then
let rm_nr_ns2=-addr_nr_ns2
if [ $rm_nr_ns2 -lt 8 ]; then
counter=1
sleep 1
Expand Down Expand Up @@ -368,8 +370,8 @@ run_tests()
connector_ns="$2"
connect_addr="$3"
test_linkfail="${4:-0}"
rm_nr_ns1="${5:-0}"
rm_nr_ns2="${6:-0}"
addr_nr_ns1="${5:-0}"
addr_nr_ns2="${6:-0}"
speed="${7:-fast}"
bkup="${8:-""}"
lret=0
Expand All @@ -386,7 +388,7 @@ run_tests()
fi

do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP ${connect_addr} \
${test_linkfail} ${rm_nr_ns1} ${rm_nr_ns2} ${speed} ${bkup}
${test_linkfail} ${addr_nr_ns1} ${addr_nr_ns2} ${speed} ${bkup}
lret=$?

if [ "$test_linkfail" -eq 1 ];then
Expand Down Expand Up @@ -677,7 +679,7 @@ reset
ip netns exec $ns1 ./pm_nl_ctl limits 0 1
ip netns exec $ns2 ./pm_nl_ctl limits 0 1
ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
run_tests $ns1 $ns2 10.0.1.1 0 0 1 slow
run_tests $ns1 $ns2 10.0.1.1 0 0 -1 slow
chk_join_nr "remove single subflow" 1 1 1
chk_rm_nr 1 1

Expand All @@ -687,7 +689,7 @@ ip netns exec $ns1 ./pm_nl_ctl limits 0 2
ip netns exec $ns2 ./pm_nl_ctl limits 0 2
ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow
ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
run_tests $ns1 $ns2 10.0.1.1 0 0 2 slow
run_tests $ns1 $ns2 10.0.1.1 0 0 -2 slow
chk_join_nr "remove multiple subflows" 2 2 2
chk_rm_nr 2 2

Expand All @@ -696,7 +698,7 @@ reset
ip netns exec $ns1 ./pm_nl_ctl limits 0 1
ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
ip netns exec $ns2 ./pm_nl_ctl limits 1 1
run_tests $ns1 $ns2 10.0.1.1 0 1 0 slow
run_tests $ns1 $ns2 10.0.1.1 0 -1 0 slow
chk_join_nr "remove single address" 1 1 1
chk_add_nr 1 1
chk_rm_nr 0 0
Expand All @@ -707,7 +709,7 @@ ip netns exec $ns1 ./pm_nl_ctl limits 0 2
ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
ip netns exec $ns2 ./pm_nl_ctl limits 1 2
ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
run_tests $ns1 $ns2 10.0.1.1 0 1 1 slow
run_tests $ns1 $ns2 10.0.1.1 0 -1 -1 slow
chk_join_nr "remove subflow and signal" 2 2 2
chk_add_nr 1 1
chk_rm_nr 1 1
Expand All @@ -719,7 +721,7 @@ ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
ip netns exec $ns2 ./pm_nl_ctl limits 1 3
ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
ip netns exec $ns2 ./pm_nl_ctl add 10.0.4.2 flags subflow
run_tests $ns1 $ns2 10.0.1.1 0 1 2 slow
run_tests $ns1 $ns2 10.0.1.1 0 -1 -2 slow
chk_join_nr "remove subflows and signal" 3 3 3
chk_add_nr 1 1
chk_rm_nr 2 2
Expand All @@ -731,7 +733,7 @@ ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
ip netns exec $ns2 ./pm_nl_ctl limits 1 3
ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
ip netns exec $ns2 ./pm_nl_ctl add 10.0.4.2 flags subflow
run_tests $ns1 $ns2 10.0.1.1 0 8 8 slow
run_tests $ns1 $ns2 10.0.1.1 0 -8 -8 slow
chk_join_nr "flush subflows and signal" 3 3 3
chk_add_nr 1 1
chk_rm_nr 2 2
Expand Down Expand Up @@ -774,7 +776,7 @@ reset
ip netns exec $ns1 ./pm_nl_ctl limits 0 1
ip netns exec $ns1 ./pm_nl_ctl add dead:beef:2::1 flags signal
ip netns exec $ns2 ./pm_nl_ctl limits 1 1
run_tests $ns1 $ns2 dead:beef:1::1 0 1 0 slow
run_tests $ns1 $ns2 dead:beef:1::1 0 -1 0 slow
chk_join_nr "remove single address IPv6" 1 1 1
chk_add_nr 1 1
chk_rm_nr 0 0
Expand All @@ -785,7 +787,7 @@ ip netns exec $ns1 ./pm_nl_ctl limits 0 2
ip netns exec $ns1 ./pm_nl_ctl add dead:beef:2::1 flags signal
ip netns exec $ns2 ./pm_nl_ctl limits 1 2
ip netns exec $ns2 ./pm_nl_ctl add dead:beef:3::2 flags subflow
run_tests $ns1 $ns2 dead:beef:1::1 0 1 1 slow
run_tests $ns1 $ns2 dead:beef:1::1 0 -1 -1 slow
chk_join_nr "remove subflow and signal IPv6" 2 2 2
chk_add_nr 1 1
chk_rm_nr 1 1
Expand Down

0 comments on commit 2dab810

Please sign in to comment.