Commit f87744ad authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

selftests: mptcp: set addr id for removing testcases

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.
Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7028ba8a
...@@ -284,14 +284,19 @@ do_transfer() ...@@ -284,14 +284,19 @@ do_transfer()
let rm_nr_ns1=-addr_nr_ns1 let rm_nr_ns1=-addr_nr_ns1
if [ $rm_nr_ns1 -lt 8 ]; then if [ $rm_nr_ns1 -lt 8 ]; then
counter=1 counter=1
sleep 1 dump=(`ip netns exec ${listener_ns} ./pm_nl_ctl dump`)
if [ ${#dump[@]} -gt 0 ]; then
while [ $counter -le $rm_nr_ns1 ] id=${dump[1]}
do
ip netns exec ${listener_ns} ./pm_nl_ctl del $counter
sleep 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 else
sleep 1 sleep 1
ip netns exec ${listener_ns} ./pm_nl_ctl flush ip netns exec ${listener_ns} ./pm_nl_ctl flush
...@@ -318,14 +323,19 @@ do_transfer() ...@@ -318,14 +323,19 @@ do_transfer()
let rm_nr_ns2=-addr_nr_ns2 let rm_nr_ns2=-addr_nr_ns2
if [ $rm_nr_ns2 -lt 8 ]; then if [ $rm_nr_ns2 -lt 8 ]; then
counter=1 counter=1
sleep 1 dump=(`ip netns exec ${connector_ns} ./pm_nl_ctl dump`)
if [ ${#dump[@]} -gt 0 ]; then
while [ $counter -le $rm_nr_ns2 ] id=${dump[1]}
do
ip netns exec ${connector_ns} ./pm_nl_ctl del $counter
sleep 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 else
sleep 1 sleep 1
ip netns exec ${connector_ns} ./pm_nl_ctl flush ip netns exec ${connector_ns} ./pm_nl_ctl flush
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment