Skip to content

Commit

Permalink
selftests: mptcp: delete uncontinuous removing ids
Browse files Browse the repository at this point in the history
The removing addresses testcases can only deal with the continuous ids.
This patch added the uncontinuous removing ids support.

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 4f49d63 commit f7713dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,18 @@ do_transfer()
let rm_nr_ns1=-addr_nr_ns1
if [ $rm_nr_ns1 -lt 8 ]; then
counter=1
pos=1
dump=(`ip netns exec ${listener_ns} ./pm_nl_ctl dump`)
if [ ${#dump[@]} -gt 0 ]; then
id=${dump[1]}
sleep 1

while [ $counter -le $rm_nr_ns1 ]
do
id=${dump[$pos]}
ip netns exec ${listener_ns} ./pm_nl_ctl del $id
sleep 1
let counter+=1
let id+=1
let pos+=5
done
fi
elif [ $rm_nr_ns1 -eq 8 ]; then
Expand Down Expand Up @@ -392,17 +393,18 @@ do_transfer()
let rm_nr_ns2=-addr_nr_ns2
if [ $rm_nr_ns2 -lt 8 ]; then
counter=1
pos=1
dump=(`ip netns exec ${connector_ns} ./pm_nl_ctl dump`)
if [ ${#dump[@]} -gt 0 ]; then
id=${dump[1]}
sleep 1

while [ $counter -le $rm_nr_ns2 ]
do
id=${dump[$pos]}
ip netns exec ${connector_ns} ./pm_nl_ctl del $id
sleep 1
let counter+=1
let id+=1
let pos+=5
done
fi
elif [ $rm_nr_ns2 -eq 8 ]; then
Expand Down

0 comments on commit f7713dd

Please sign in to comment.