Skip to content

Commit bf68583

Browse files
zhengchaoshaodavem330
authored andcommitted
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>
1 parent 3a1e2f4 commit bf68583

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ server_ip4=192.168.1.254
2222
echo 180 >/proc/sys/kernel/panic
2323

2424
# build namespaces
25-
ip link add dev link1_1 type veth peer name link1_2
26-
2725
ip netns add "server"
28-
ip link set dev link1_2 netns server up name eth0
26+
ip netns add "client"
27+
ip -n client link add eth0 type veth peer name eth0 netns server
28+
ip netns exec server ip link set dev eth0 up
2929
ip netns exec server ip addr add ${server_ip4}/24 dev eth0
3030

31-
ip netns add "client"
32-
ip link set dev link1_1 netns client down name eth0
3331
ip netns exec client ip link add dev bond0 down type bond mode 1 \
3432
miimon 100 all_slaves_active 1
3533
ip netns exec client ip link set dev eth0 down master bond0

0 commit comments

Comments
 (0)