-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests: bonding: cause oops in bond_rr_gen_slave_id
This bonding selftest used to cause a kernel oops on aarch64 and should be architectures agnostic. Signed-off-by: Jonathan Toppins <jtoppins@redhat.com> Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Jonathan Toppins
authored and
Jakub Kicinski
committed
Sep 22, 2022
1 parent
0e400d6
commit 2ffd573
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
# cause kernel oops in bond_rr_gen_slave_id | ||
DEBUG=${DEBUG:-0} | ||
|
||
set -e | ||
test ${DEBUG} -ne 0 && set -x | ||
|
||
finish() | ||
{ | ||
ip netns delete server || true | ||
ip netns delete client || true | ||
ip link del link1_1 || true | ||
} | ||
|
||
trap finish EXIT | ||
|
||
client_ip4=192.168.1.198 | ||
server_ip4=192.168.1.254 | ||
|
||
# setup kernel so it reboots after causing the panic | ||
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 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 | ||
ip netns exec client ip link set dev bond0 up | ||
ip netns exec client ip addr add ${client_ip4}/24 dev bond0 | ||
ip netns exec client ping -c 5 $server_ip4 >/dev/null | ||
|
||
ip netns exec client ip link set dev eth0 down nomaster | ||
ip netns exec client ip link set dev bond0 down | ||
ip netns exec client ip link set dev bond0 type bond mode 0 \ | ||
arp_interval 1000 arp_ip_target "+${server_ip4}" | ||
ip netns exec client ip link set dev eth0 down master bond0 | ||
ip netns exec client ip link set dev bond0 up | ||
ip netns exec client ping -c 5 $server_ip4 >/dev/null | ||
|
||
exit 0 |