Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / testing / selftests / net / forwarding / bridge_vlan_unaware.sh
blob1c8a26046589fdc035d4ecce3091b410fb21ce58
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
4 ALL_TESTS="ping_ipv4 ping_ipv6 learning flooding"
5 NUM_NETIFS=4
6 source lib.sh
8 h1_create()
10 simple_if_init $h1 192.0.2.1/24 2001:db8:1::1/64
13 h1_destroy()
15 simple_if_fini $h1 192.0.2.1/24 2001:db8:1::1/64
18 h2_create()
20 simple_if_init $h2 192.0.2.2/24 2001:db8:1::2/64
23 h2_destroy()
25 simple_if_fini $h2 192.0.2.2/24 2001:db8:1::2/64
28 switch_create()
30 ip link add dev br0 type bridge \
31 ageing_time $LOW_AGEING_TIME \
32 mcast_snooping 0
34 ip link set dev $swp1 master br0
35 ip link set dev $swp2 master br0
37 ip link set dev br0 up
38 ip link set dev $swp1 up
39 ip link set dev $swp2 up
42 switch_destroy()
44 ip link set dev $swp2 down
45 ip link set dev $swp1 down
47 ip link del dev br0
50 setup_prepare()
52 h1=${NETIFS[p1]}
53 swp1=${NETIFS[p2]}
55 swp2=${NETIFS[p3]}
56 h2=${NETIFS[p4]}
58 vrf_prepare
60 h1_create
61 h2_create
63 switch_create
66 cleanup()
68 pre_cleanup
70 switch_destroy
72 h2_destroy
73 h1_destroy
75 vrf_cleanup
78 ping_ipv4()
80 ping_test $h1 192.0.2.2
83 ping_ipv6()
85 ping6_test $h1 2001:db8:1::2
88 learning()
90 learning_test "br0" $swp1 $h1 $h2
93 flooding()
95 flood_test $swp2 $h1 $h2
98 trap cleanup EXIT
100 setup_prepare
101 setup_wait
103 tests_run
105 exit $EXIT_STATUS