diff mbox series

[net] selftests: rtnetlink: use setup_ns in bonding test

Message ID 20240115135922.3662648-1-nicolas.dichtel@6wind.com (mailing list archive)
State Accepted
Commit e9ce7ededf14af3396312f02d1622f4889d676ca
Delegated to: Netdev Maintainers
Headers show
Series [net] selftests: rtnetlink: use setup_ns in bonding test | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success SINGLE THREAD; Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 26 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest pending net-next-2024-01-17--00-00

Commit Message

Nicolas Dichtel Jan. 15, 2024, 1:59 p.m. UTC
This is a follow-up of commit a159cbe81d3b ("selftests: rtnetlink: check
enslaving iface in a bond") after the merge of net-next into net.

The goal is to follow the new convention,
see commit d3b6b1116127 ("selftests/net: convert rtnetlink.sh to run it in
unique namespace") for more details.

Let's use also the generic dummy name instead of defining a new one.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 tools/testing/selftests/net/rtnetlink.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Hangbin Liu Jan. 16, 2024, 12:47 a.m. UTC | #1
On Mon, Jan 15, 2024 at 02:59:22PM +0100, Nicolas Dichtel wrote:
> This is a follow-up of commit a159cbe81d3b ("selftests: rtnetlink: check
> enslaving iface in a bond") after the merge of net-next into net.
> 
> The goal is to follow the new convention,
> see commit d3b6b1116127 ("selftests/net: convert rtnetlink.sh to run it in
> unique namespace") for more details.
> 
> Let's use also the generic dummy name instead of defining a new one.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
>  tools/testing/selftests/net/rtnetlink.sh | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> index a31be0eaaa50..4667d74579d1 100755
> --- a/tools/testing/selftests/net/rtnetlink.sh
> +++ b/tools/testing/selftests/net/rtnetlink.sh
> @@ -1244,21 +1244,19 @@ kci_test_address_proto()
>  
>  kci_test_enslave_bonding()
>  {
> -	local testns="testns"
>  	local bond="bond123"
> -	local dummy="dummy123"
>  	local ret=0
>  
> -	run_cmd ip netns add "$testns"
> -	if [ $ret -ne 0 ]; then
> +	setup_ns testns
> +	if [ $? -ne 0 ]; then
>  		end_test "SKIP bonding tests: cannot add net namespace $testns"
>  		return $ksft_skip
>  	fi
>  
>  	run_cmd ip -netns $testns link add dev $bond type bond mode balance-rr
> -	run_cmd ip -netns $testns link add dev $dummy type dummy
> -	run_cmd ip -netns $testns link set dev $dummy up
> -	run_cmd ip -netns $testns link set dev $dummy master $bond down
> +	run_cmd ip -netns $testns link add dev $devdummy type dummy
> +	run_cmd ip -netns $testns link set dev $devdummy up
> +	run_cmd ip -netns $testns link set dev $devdummy master $bond down
>  	if [ $ret -ne 0 ]; then
>  		end_test "FAIL: initially up interface added to a bond and set down"
>  		ip netns del "$testns"
> -- 
> 2.39.2
> 

Thanks for the update.

Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
patchwork-bot+netdevbpf@kernel.org Jan. 17, 2024, 2 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 15 Jan 2024 14:59:22 +0100 you wrote:
> This is a follow-up of commit a159cbe81d3b ("selftests: rtnetlink: check
> enslaving iface in a bond") after the merge of net-next into net.
> 
> The goal is to follow the new convention,
> see commit d3b6b1116127 ("selftests/net: convert rtnetlink.sh to run it in
> unique namespace") for more details.
> 
> [...]

Here is the summary with links:
  - [net] selftests: rtnetlink: use setup_ns in bonding test
    https://git.kernel.org/netdev/net/c/e9ce7ededf14

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
index a31be0eaaa50..4667d74579d1 100755
--- a/tools/testing/selftests/net/rtnetlink.sh
+++ b/tools/testing/selftests/net/rtnetlink.sh
@@ -1244,21 +1244,19 @@  kci_test_address_proto()
 
 kci_test_enslave_bonding()
 {
-	local testns="testns"
 	local bond="bond123"
-	local dummy="dummy123"
 	local ret=0
 
-	run_cmd ip netns add "$testns"
-	if [ $ret -ne 0 ]; then
+	setup_ns testns
+	if [ $? -ne 0 ]; then
 		end_test "SKIP bonding tests: cannot add net namespace $testns"
 		return $ksft_skip
 	fi
 
 	run_cmd ip -netns $testns link add dev $bond type bond mode balance-rr
-	run_cmd ip -netns $testns link add dev $dummy type dummy
-	run_cmd ip -netns $testns link set dev $dummy up
-	run_cmd ip -netns $testns link set dev $dummy master $bond down
+	run_cmd ip -netns $testns link add dev $devdummy type dummy
+	run_cmd ip -netns $testns link set dev $devdummy up
+	run_cmd ip -netns $testns link set dev $devdummy master $bond down
 	if [ $ret -ne 0 ]; then
 		end_test "FAIL: initially up interface added to a bond and set down"
 		ip netns del "$testns"