Commit e67dfb8d authored by Amit Cohen's avatar Amit Cohen Committed by David S. Miller

selftests: Clean forgotten resources as part of cleanup()

Several tests do not set some ports down as part of their cleanup(),
resulting in IPv6 link-local addresses and associated routes not being
deleted.

These leaks were found using a BPF tool that monitors ASIC resources.

Solve this by setting the ports down at the end of the tests.
Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 00190c2b
...@@ -109,6 +109,9 @@ router_destroy() ...@@ -109,6 +109,9 @@ router_destroy()
__addr_add_del $rp1 del 192.0.2.2/24 2001:db8:1::2/64 __addr_add_del $rp1 del 192.0.2.2/24 2001:db8:1::2/64
tc qdisc del dev $rp2 clsact tc qdisc del dev $rp2 clsact
ip link set dev $rp2 down
ip link set dev $rp1 down
} }
setup_prepare() setup_prepare()
......
...@@ -111,6 +111,9 @@ router_destroy() ...@@ -111,6 +111,9 @@ router_destroy()
__addr_add_del $rp1 del 192.0.2.2/24 2001:db8:1::2/64 __addr_add_del $rp1 del 192.0.2.2/24 2001:db8:1::2/64
tc qdisc del dev $rp2 clsact tc qdisc del dev $rp2 clsact
ip link set dev $rp2 down
ip link set dev $rp1 down
} }
setup_prepare() setup_prepare()
......
...@@ -93,7 +93,9 @@ switch_destroy() ...@@ -93,7 +93,9 @@ switch_destroy()
lldptool -T -i $swp1 -V APP -d $(dscp_map 10) >/dev/null lldptool -T -i $swp1 -V APP -d $(dscp_map 10) >/dev/null
lldpad_app_wait_del lldpad_app_wait_del
ip link set dev $swp2 down
ip link set dev $swp2 nomaster ip link set dev $swp2 nomaster
ip link set dev $swp1 down
ip link set dev $swp1 nomaster ip link set dev $swp1 nomaster
ip link del dev br1 ip link del dev br1
} }
......
...@@ -75,7 +75,9 @@ switch_destroy() ...@@ -75,7 +75,9 @@ switch_destroy()
tc qdisc del dev $swp2 clsact tc qdisc del dev $swp2 clsact
tc qdisc del dev $swp1 clsact tc qdisc del dev $swp1 clsact
ip link set dev $swp2 down
ip link set dev $swp2 nomaster ip link set dev $swp2 nomaster
ip link set dev $swp1 down
ip link set dev $swp1 nomaster ip link set dev $swp1 nomaster
ip link del dev br1 ip link del dev br1
} }
......
...@@ -71,7 +71,9 @@ switch_destroy() ...@@ -71,7 +71,9 @@ switch_destroy()
tc qdisc del dev $swp2 clsact tc qdisc del dev $swp2 clsact
tc qdisc del dev $swp1 clsact tc qdisc del dev $swp1 clsact
ip link set dev $swp2 down
ip link set dev $swp2 nomaster ip link set dev $swp2 nomaster
ip link set dev $swp1 down
ip link set dev $swp1 nomaster ip link set dev $swp1 nomaster
ip link del dev br1 ip link del dev br1
} }
......
...@@ -72,7 +72,9 @@ switch_destroy() ...@@ -72,7 +72,9 @@ switch_destroy()
tc qdisc del dev $swp2 clsact tc qdisc del dev $swp2 clsact
tc qdisc del dev $swp1 clsact tc qdisc del dev $swp1 clsact
ip link set dev $swp2 down
ip link set dev $swp2 nomaster ip link set dev $swp2 nomaster
ip link set dev $swp1 down
ip link set dev $swp1 nomaster ip link set dev $swp1 nomaster
ip link del dev br1 ip link del dev br1
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment