WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / net / forwarding / bridge_vlan_unaware.sh
blobc15c6c85c9849ba768e74c478028a2d837c40426
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 # 10 Seconds ageing time.
31 ip link add dev br0 type bridge ageing_time 1000 mcast_snooping 0
33 ip link set dev $swp1 master br0
34 ip link set dev $swp2 master br0
36 ip link set dev br0 up
37 ip link set dev $swp1 up
38 ip link set dev $swp2 up
41 switch_destroy()
43 ip link set dev $swp2 down
44 ip link set dev $swp1 down
46 ip link del dev br0
49 setup_prepare()
51 h1=${NETIFS[p1]}
52 swp1=${NETIFS[p2]}
54 swp2=${NETIFS[p3]}
55 h2=${NETIFS[p4]}
57 vrf_prepare
59 h1_create
60 h2_create
62 switch_create
65 cleanup()
67 pre_cleanup
69 switch_destroy
71 h2_destroy
72 h1_destroy
74 vrf_cleanup
77 ping_ipv4()
79 ping_test $h1 192.0.2.2
82 ping_ipv6()
84 ping6_test $h1 2001:db8:1::2
87 learning()
89 learning_test "br0" $swp1 $h1 $h2
92 flooding()
94 flood_test $swp2 $h1 $h2
97 trap cleanup EXIT
99 setup_prepare
100 setup_wait
102 tests_run
104 exit $EXIT_STATUS