2 # SPDX-License-Identifier: GPL-2.0
4 ALL_TESTS
="ping_ipv4 ping_ipv6 flooding"
11 simple_if_init
$h1 192.0.2.1/24 2001:db8
:1::1/64
16 simple_if_fini
$h1 192.0.2.1/24 2001:db8
:1::1/64
21 simple_if_init
$h2 192.0.2.2/24 2001:db8
:1::2/64
26 simple_if_fini
$h2 192.0.2.2/24 2001:db8
:1::2/64
31 simple_if_init
$h3 192.0.2.3/24 2001:db8
:1::3/64
36 simple_if_fini
$h3 192.0.2.3/24 2001:db8
:1::3/64
41 ip link add dev br0
type bridge
43 ip link
set dev
$swp1 master br0
44 ip link
set dev
$swp2 master br0
45 ip link
set dev
$swp3 master br0
47 ip link
set dev
$swp1 type bridge_slave isolated on
48 check_err $?
"Can't set isolation on port $swp1"
49 ip link
set dev
$swp2 type bridge_slave isolated on
50 check_err $?
"Can't set isolation on port $swp2"
51 ip link
set dev
$swp3 type bridge_slave isolated off
52 check_err $?
"Can't disable isolation on port $swp3"
54 ip link
set dev br0 up
55 ip link
set dev
$swp1 up
56 ip link
set dev
$swp2 up
57 ip link
set dev
$swp3 up
62 ip link
set dev
$swp3 down
63 ip link
set dev
$swp2 down
64 ip link
set dev
$swp1 down
105 ping_do
$h1 192.0.2.2
106 check_fail $?
"Ping worked when it should not have"
109 ping_do
$h3 192.0.2.2
110 check_err $?
"Ping didn't work when it should have"
112 log_test
"Isolated port ping"
118 ping6_do
$h1 2001:db8
:1::2
119 check_fail $?
"Ping6 worked when it should not have"
122 ping6_do
$h3 2001:db8
:1::2
123 check_err $?
"Ping6 didn't work when it should have"
125 log_test
"Isolated port ping6"
130 local mac
=de
:ad
:be
:ef
:13:37
134 flood_test_do false
$mac $ip $h1 $h2
135 check_err $?
"Packet was flooded when it should not have been"
138 flood_test_do true
$mac $ip $h3 $h2
139 check_err $?
"Packet was not flooded when it should have been"
141 log_test
"Isolated port flooding"