Skip to content

Commit

Permalink
selftests: mptcp: set addr id for removing testcases
Browse files Browse the repository at this point in the history
The removing testcases can only delete the addresses from id 1, this
patch added the support for deleting the addresses from any id that user
set.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
  • Loading branch information
geliangtang authored and jenkins-tessares committed Feb 26, 2021
1 parent 524fba0 commit 318e055
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions tools/testing/selftests/net/mptcp/mptcp_join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,19 @@ do_transfer()
let rm_nr_ns1=-addr_nr_ns1
if [ $rm_nr_ns1 -lt 8 ]; then
counter=1
sleep 1

while [ $counter -le $rm_nr_ns1 ]
do
ip netns exec ${listener_ns} ./pm_nl_ctl del $counter
dump=(`ip netns exec ${listener_ns} ./pm_nl_ctl dump`)
if [ ${#dump[@]} -gt 0 ]; then
id=${dump[1]}
sleep 1
let counter+=1
done

while [ $counter -le $rm_nr_ns1 ]
do
ip netns exec ${listener_ns} ./pm_nl_ctl del $id
sleep 1
let counter+=1
let id+=1
done
fi
else
sleep 1
ip netns exec ${listener_ns} ./pm_nl_ctl flush
Expand All @@ -320,14 +325,19 @@ do_transfer()
let rm_nr_ns2=-addr_nr_ns2
if [ $rm_nr_ns2 -lt 8 ]; then
counter=1
sleep 1

while [ $counter -le $rm_nr_ns2 ]
do
ip netns exec ${connector_ns} ./pm_nl_ctl del $counter
dump=(`ip netns exec ${connector_ns} ./pm_nl_ctl dump`)
if [ ${#dump[@]} -gt 0 ]; then
id=${dump[1]}
sleep 1
let counter+=1
done

while [ $counter -le $rm_nr_ns2 ]
do
ip netns exec ${connector_ns} ./pm_nl_ctl del $id
sleep 1
let counter+=1
let id+=1
done
fi
else
sleep 1
ip netns exec ${connector_ns} ./pm_nl_ctl flush
Expand Down

0 comments on commit 318e055

Please sign in to comment.