diff mbox series

[v5,mptcp-next,4/5] selftests: mptcp: add fullmesh testcases

Message ID 78d86feae19ea4efd7061a9e92b81475ed035323.1627372396.git.geliangtang@xiaomi.com (mailing list archive)
State Superseded, archived
Delegated to: Mat Martineau
Headers show
Series fullmesh path manager support | expand

Commit Message

Geliang Tang July 27, 2021, 7:58 a.m. UTC
From: Geliang Tang <geliangtang@xiaomi.com>

This patch added the testcases for the fullmesh address flag of the path
manager.

Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 57 ++++++++++++++++++-
 1 file changed, 54 insertions(+), 3 deletions(-)

Comments

Paolo Abeni July 27, 2021, 10:03 a.m. UTC | #1
On Tue, 2021-07-27 at 15:58 +0800, Geliang Tang wrote:
> From: Geliang Tang <geliangtang@xiaomi.com>
> 
> This patch added the testcases for the fullmesh address flag of the path
> manager.
> 
> Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
> ---
>  .../testing/selftests/net/mptcp/mptcp_join.sh | 57 ++++++++++++++++++-
>  1 file changed, 54 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index 937e861e9490..ca19762b9c6e 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -367,7 +367,13 @@ do_transfer()
>  	fi
>  
>  	if [ $addr_nr_ns2 -gt 0 ]; then
> -		let add_nr_ns2=addr_nr_ns2
> +		if [ $addr_nr_ns2 -gt 10 ]; then
> +			let add_nr_ns2=addr_nr_ns2-10
> +			flags=subflow,fullmesh
> +		else
> +			let add_nr_ns2=addr_nr_ns2
> +			flags=subflow
> +		fi
>  		counter=3
>  		sleep 1
>  		while [ $add_nr_ns2 -gt 0 ]; do
> @@ -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
> @@ -1697,6 +1703,46 @@ deny_join_id0_tests()
>  	chk_join_nr "subflow and address allow join id0 2" 1 1 1
>  }
>  
> +fullmesh_tests()
> +{
> +	# fullmesh 1
> +	reset
> +	ip netns exec $ns1 ./pm_nl_ctl limits 8 8
> +	ip netns exec $ns2 ./pm_nl_ctl limits 8 8
> +	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 1" 2 2 2
> +	chk_add_nr 1 1
> +
> +	# fullmesh 2
> +	reset
> +	ip netns exec $ns1 ./pm_nl_ctl limits 8 8
> +	ip netns exec $ns2 ./pm_nl_ctl limits 8 8
> +	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 2" 4 4 4
> +	chk_add_nr 1 1

This 2 tests are a bit redundand, I think. With a single remote known
address, the final topology will be the same as with non-fullmesh
subflows. Perhaps we can keep just one of this cases?

> +
> +	# fullmesh 3
> +	reset
> +	ip netns exec $ns1 ./pm_nl_ctl limits 8 8
> +	ip netns exec $ns2 ./pm_nl_ctl limits 8 8
> +	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal

Here I think we need at least one 'fullmesh' subflow in ns2? Otherwise
this will be a non-fullmesh topology.

> +	run_tests $ns1 $ns2 10.0.1.1 0 0 11 slow
> +	chk_join_nr "fullmesh test 3" 3 3 3
> +	chk_add_nr 1 1
> +
> +	# fullmesh 4
> +	reset
> +	ip netns exec $ns1 ./pm_nl_ctl limits 8 8
> +	ip netns exec $ns2 ./pm_nl_ctl limits 8 8
> +	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal

And perhaps here 2 'fullmesh' subflows? So we test explicitly the most
expected conf:

Client		Server
C1 ----------->	S1
    \       /->
     \     /
    - \ --/
   /   \
  /     \
 /       ----->
C2 ----------->	S2

(not sure how much the above "graph" will be readable :)

Additionally it would be nice to explicitly test a fullmesh topology
where we hit the max_subflows limit, e.g. 2 local address 3 remote ones
and max_subflows=4



> +	run_tests $ns1 $ns2 10.0.1.1 0 0 12 slow
> +	chk_join_nr "fullmesh test 4" 5 5 5
> +	chk_add_nr 1 1
> +}
> +
>  all_tests()
>  {
>  	subflows_tests
> @@ -1712,6 +1758,7 @@ all_tests()
>  	syncookies_tests
>  	checksum_tests
>  	deny_join_id0_tests
> +	fullmesh_tests
>  }
>  
>  usage()
> @@ -1730,6 +1777,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"
> @@ -1765,7 +1813,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
> @@ -1806,6 +1854,9 @@ while getopts 'fsltra64bpkdchCS' opt; do
>  		d)
>  			deny_join_id0_tests
>  			;;
> +		m)
> +			fullmesh_tests
> +			;;
>  		c)
>  			;;
>  		C)
Geliang Tang July 27, 2021, 12:49 p.m. UTC | #2
Paolo Abeni <pabeni@redhat.com> 于2021年7月27日周二 下午6:03写道:
>
> On Tue, 2021-07-27 at 15:58 +0800, Geliang Tang wrote:
> > From: Geliang Tang <geliangtang@xiaomi.com>
> >
> > This patch added the testcases for the fullmesh address flag of the path
> > manager.
> >
> > Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
> > ---
> >  .../testing/selftests/net/mptcp/mptcp_join.sh | 57 ++++++++++++++++++-
> >  1 file changed, 54 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > index 937e861e9490..ca19762b9c6e 100755
> > --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > @@ -367,7 +367,13 @@ do_transfer()
> >       fi
> >
> >       if [ $addr_nr_ns2 -gt 0 ]; then
> > -             let add_nr_ns2=addr_nr_ns2
> > +             if [ $addr_nr_ns2 -gt 10 ]; then
> > +                     let add_nr_ns2=addr_nr_ns2-10
> > +                     flags=subflow,fullmesh
> > +             else
> > +                     let add_nr_ns2=addr_nr_ns2
> > +                     flags=subflow
> > +             fi
> >               counter=3
> >               sleep 1
> >               while [ $add_nr_ns2 -gt 0 ]; do
> > @@ -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
> > @@ -1697,6 +1703,46 @@ deny_join_id0_tests()
> >       chk_join_nr "subflow and address allow join id0 2" 1 1 1
> >  }
> >
> > +fullmesh_tests()
> > +{
> > +     # fullmesh 1
> > +     reset
> > +     ip netns exec $ns1 ./pm_nl_ctl limits 8 8
> > +     ip netns exec $ns2 ./pm_nl_ctl limits 8 8
> > +     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 1" 2 2 2
> > +     chk_add_nr 1 1
> > +
> > +     # fullmesh 2
> > +     reset
> > +     ip netns exec $ns1 ./pm_nl_ctl limits 8 8
> > +     ip netns exec $ns2 ./pm_nl_ctl limits 8 8
> > +     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 2" 4 4 4
> > +     chk_add_nr 1 1
>
> This 2 tests are a bit redundand, I think. With a single remote known
> address, the final topology will be the same as with non-fullmesh
> subflows. Perhaps we can keep just one of this cases?

Drop test 1 in v6.

>
> > +
> > +     # fullmesh 3
> > +     reset
> > +     ip netns exec $ns1 ./pm_nl_ctl limits 8 8
> > +     ip netns exec $ns2 ./pm_nl_ctl limits 8 8
> > +     ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
>
> Here I think we need at least one 'fullmesh' subflow in ns2? Otherwise
> this will be a non-fullmesh topology.
>
> > +     run_tests $ns1 $ns2 10.0.1.1 0 0 11 slow

This 11 means one fullmesh subflow.

> > +     chk_join_nr "fullmesh test 3" 3 3 3
> > +     chk_add_nr 1 1
> > +
> > +     # fullmesh 4
> > +     reset
> > +     ip netns exec $ns1 ./pm_nl_ctl limits 8 8
> > +     ip netns exec $ns2 ./pm_nl_ctl limits 8 8
> > +     ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
>
> And perhaps here 2 'fullmesh' subflows? So we test explicitly the most
> expected conf:

And 12 means two fullmesh subflows. I should add some comments here.

>
> Client          Server
> C1 -----------> S1
>     \       /->
>      \     /
>     - \ --/
>    /   \
>   /     \
>  /       ----->
> C2 -----------> S2
>
> (not sure how much the above "graph" will be readable :)
>
> Additionally it would be nice to explicitly test a fullmesh topology
> where we hit the max_subflows limit, e.g. 2 local address 3 remote ones
> and max_subflows=4

Add a limit test in v6.

>
>
>
> > +     run_tests $ns1 $ns2 10.0.1.1 0 0 12 slow
> > +     chk_join_nr "fullmesh test 4" 5 5 5
> > +     chk_add_nr 1 1
> > +}
> > +
> >  all_tests()
> >  {
> >       subflows_tests
> > @@ -1712,6 +1758,7 @@ all_tests()
> >       syncookies_tests
> >       checksum_tests
> >       deny_join_id0_tests
> > +     fullmesh_tests
> >  }
> >
> >  usage()
> > @@ -1730,6 +1777,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"
> > @@ -1765,7 +1813,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
> > @@ -1806,6 +1854,9 @@ while getopts 'fsltra64bpkdchCS' opt; do
> >               d)
> >                       deny_join_id0_tests
> >                       ;;
> > +             m)
> > +                     fullmesh_tests
> > +                     ;;
> >               c)
> >                       ;;
> >               C)
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 937e861e9490..ca19762b9c6e 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -367,7 +367,13 @@  do_transfer()
 	fi
 
 	if [ $addr_nr_ns2 -gt 0 ]; then
-		let add_nr_ns2=addr_nr_ns2
+		if [ $addr_nr_ns2 -gt 10 ]; then
+			let add_nr_ns2=addr_nr_ns2-10
+			flags=subflow,fullmesh
+		else
+			let add_nr_ns2=addr_nr_ns2
+			flags=subflow
+		fi
 		counter=3
 		sleep 1
 		while [ $add_nr_ns2 -gt 0 ]; do
@@ -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
@@ -1697,6 +1703,46 @@  deny_join_id0_tests()
 	chk_join_nr "subflow and address allow join id0 2" 1 1 1
 }
 
+fullmesh_tests()
+{
+	# fullmesh 1
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 8 8
+	ip netns exec $ns2 ./pm_nl_ctl limits 8 8
+	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 1" 2 2 2
+	chk_add_nr 1 1
+
+	# fullmesh 2
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 8 8
+	ip netns exec $ns2 ./pm_nl_ctl limits 8 8
+	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 2" 4 4 4
+	chk_add_nr 1 1
+
+	# fullmesh 3
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 8 8
+	ip netns exec $ns2 ./pm_nl_ctl limits 8 8
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
+	run_tests $ns1 $ns2 10.0.1.1 0 0 11 slow
+	chk_join_nr "fullmesh test 3" 3 3 3
+	chk_add_nr 1 1
+
+	# fullmesh 4
+	reset
+	ip netns exec $ns1 ./pm_nl_ctl limits 8 8
+	ip netns exec $ns2 ./pm_nl_ctl limits 8 8
+	ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal
+	run_tests $ns1 $ns2 10.0.1.1 0 0 12 slow
+	chk_join_nr "fullmesh test 4" 5 5 5
+	chk_add_nr 1 1
+}
+
 all_tests()
 {
 	subflows_tests
@@ -1712,6 +1758,7 @@  all_tests()
 	syncookies_tests
 	checksum_tests
 	deny_join_id0_tests
+	fullmesh_tests
 }
 
 usage()
@@ -1730,6 +1777,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"
@@ -1765,7 +1813,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
@@ -1806,6 +1854,9 @@  while getopts 'fsltra64bpkdchCS' opt; do
 		d)
 			deny_join_id0_tests
 			;;
+		m)
+			fullmesh_tests
+			;;
 		c)
 			;;
 		C)