diff options
author | Zhengchao Shao <shaozhengchao@huawei.com> | 2023-08-26 10:23:30 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-08-28 10:24:08 +0100 |
commit | bf68583624c56bab26b4394fb4721461ded62f94 (patch) | |
tree | 10b90b3cb21bb0e592532ba555b97de46dd40951 /tools | |
parent | 3a1e2f43985af0dea5750c6436f8cb979780c084 (diff) | |
download | linux-stable-bf68583624c56bab26b4394fb4721461ded62f94.tar.gz linux-stable-bf68583624c56bab26b4394fb4721461ded62f94.tar.bz2 linux-stable-bf68583624c56bab26b4394fb4721461ded62f94.zip |
selftests: bonding: create directly devices in the target namespaces
If failed to set link1_1 to netns client, we should delete link1_1 in the
cleanup path. But if set link1_1 to netns client successfully, delete
link1_1 will report warning. So it will be safer creating directly the
devices in the target namespaces.
Reported-by: Hangbin Liu <liuhangbin@gmail.com>
Closes: https://lore.kernel.org/all/ZNyJx1HtXaUzOkNA@Laptop-X1/
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh b/tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh index 7b2d421f09cf..4917dbb35a44 100755 --- a/tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh +++ b/tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh @@ -22,14 +22,12 @@ server_ip4=192.168.1.254 echo 180 >/proc/sys/kernel/panic # build namespaces -ip link add dev link1_1 type veth peer name link1_2 - ip netns add "server" -ip link set dev link1_2 netns server up name eth0 +ip netns add "client" +ip -n client link add eth0 type veth peer name eth0 netns server +ip netns exec server ip link set dev eth0 up ip netns exec server ip addr add ${server_ip4}/24 dev eth0 -ip netns add "client" -ip link set dev link1_1 netns client down name eth0 ip netns exec client ip link add dev bond0 down type bond mode 1 \ miimon 100 all_slaves_active 1 ip netns exec client ip link set dev eth0 down master bond0 |