[PATCH mptcp-next v2 2/2] selftests: mptcp: add set_flags tests in pm_netlink.sh

Geliang Tang posted 2 patches 4 years ago
Maintainers: "David S. Miller" <davem@davemloft.net>, Matthieu Baerts <matthieu.baerts@tessares.net>, Shuah Khan <shuah@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Mat Martineau <mathew.j.martineau@linux.intel.com>
There is a newer version of this series
[PATCH mptcp-next v2 2/2] selftests: mptcp: add set_flags tests in pm_netlink.sh
Posted by Geliang Tang 4 years ago
This patch added the setting flags test cases, using both addr-based and
id-based lookups for the setting address.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 tools/testing/selftests/net/mptcp/pm_netlink.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh
index cbacf9f6538b..55df8b4e33fa 100755
--- a/tools/testing/selftests/net/mptcp/pm_netlink.sh
+++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh
@@ -164,4 +164,14 @@ id 253 flags  10.0.0.5
 id 254 flags  10.0.0.2
 id 255 flags  10.0.0.3" "wrap-around ids"
 
+ip netns exec $ns1 ./pm_nl_ctl flush
+ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1 flags subflow
+ip netns exec $ns1 ./pm_nl_ctl set 10.0.1.1 flags backup
+ip netns exec $ns1 ./pm_nl_ctl set 10.0.1.1 flags nobackup
+ip netns exec $ns1 ./pm_nl_ctl set id 1 flags fullmesh
+ip netns exec $ns1 ./pm_nl_ctl set id 1 flags nofullmesh
+ip netns exec $ns1 ./pm_nl_ctl set id 1 flags backup,fullmesh
+check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \
+subflow,backup,fullmesh 10.0.1.1" "set flags"
+
 exit $ret
-- 
2.31.1


Re: [PATCH mptcp-next v2 2/2] selftests: mptcp: add set_flags tests in pm_netlink.sh
Posted by Mat Martineau 4 years ago
On Sat, 22 Jan 2022, Geliang Tang wrote:

> This patch added the setting flags test cases, using both addr-based and
> id-based lookups for the setting address.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> tools/testing/selftests/net/mptcp/pm_netlink.sh | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh
> index cbacf9f6538b..55df8b4e33fa 100755
> --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh
> +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh
> @@ -164,4 +164,14 @@ id 253 flags  10.0.0.5
> id 254 flags  10.0.0.2
> id 255 flags  10.0.0.3" "wrap-around ids"
>
> +ip netns exec $ns1 ./pm_nl_ctl flush
> +ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1 flags subflow
> +ip netns exec $ns1 ./pm_nl_ctl set 10.0.1.1 flags backup
> +ip netns exec $ns1 ./pm_nl_ctl set 10.0.1.1 flags nobackup
> +ip netns exec $ns1 ./pm_nl_ctl set id 1 flags fullmesh
> +ip netns exec $ns1 ./pm_nl_ctl set id 1 flags nofullmesh
> +ip netns exec $ns1 ./pm_nl_ctl set id 1 flags backup,fullmesh
> +check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \
> +subflow,backup,fullmesh 10.0.1.1" "set flags"
> +

I think it would be worth it to check more of the intermediate states with 
"pm_nl_ctl dump", not just after the last command. The first four 'set' 
commands could have been broken and that wouldn't be detected.

--
Mat Martineau
Intel