selftests: rtnetlink: use setup_ns in bonding test
This is a follow-up of commita159cbe81d
("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 commitd3b6b11161
("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> Reviewed-by: Hangbin Liu <liuhangbin@gmail.com> Link: https://lore.kernel.org/r/20240115135922.3662648-1-nicolas.dichtel@6wind.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
97eb5d51b4
commit
e9ce7ededf
1 changed files with 5 additions and 7 deletions
|
@ -1244,21 +1244,19 @@ kci_test_address_proto()
|
||||||
|
|
||||||
kci_test_enslave_bonding()
|
kci_test_enslave_bonding()
|
||||||
{
|
{
|
||||||
local testns="testns"
|
|
||||||
local bond="bond123"
|
local bond="bond123"
|
||||||
local dummy="dummy123"
|
|
||||||
local ret=0
|
local ret=0
|
||||||
|
|
||||||
run_cmd ip netns add "$testns"
|
setup_ns testns
|
||||||
if [ $ret -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
end_test "SKIP bonding tests: cannot add net namespace $testns"
|
end_test "SKIP bonding tests: cannot add net namespace $testns"
|
||||||
return $ksft_skip
|
return $ksft_skip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_cmd ip -netns $testns link add dev $bond type bond mode balance-rr
|
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 add dev $devdummy type dummy
|
||||||
run_cmd ip -netns $testns link set dev $dummy up
|
run_cmd ip -netns $testns link set dev $devdummy up
|
||||||
run_cmd ip -netns $testns link set dev $dummy master $bond down
|
run_cmd ip -netns $testns link set dev $devdummy master $bond down
|
||||||
if [ $ret -ne 0 ]; then
|
if [ $ret -ne 0 ]; then
|
||||||
end_test "FAIL: initially up interface added to a bond and set down"
|
end_test "FAIL: initially up interface added to a bond and set down"
|
||||||
ip netns del "$testns"
|
ip netns del "$testns"
|
||||||
|
|
Loading…
Add table
Reference in a new issue