drm/atomic-helper: document drm_atomic_helper_check() restrictions
[drm/drm-misc.git] / tools / testing / selftests / net / forwarding / mirror_gre_neigh.sh
blob2cbfbecf25c8fc8c5a5061aabebe26d01c6f2ce1
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
4 # This test uses standard topology for testing gretap. See
5 # mirror_gre_topo_lib.sh for more details.
7 # Test for mirroring to gretap and ip6gretap, such that the neighbor entry for
8 # the tunnel remote address has invalid address at the time that the mirroring
9 # is set up. Later on, the neighbor is deleted and it is expected to be
10 # reinitialized using the usual ARP process, and the mirroring offload updated.
12 ALL_TESTS="
13 test_gretap
14 test_ip6gretap
17 NUM_NETIFS=6
18 source lib.sh
19 source mirror_lib.sh
20 source mirror_gre_lib.sh
21 source mirror_gre_topo_lib.sh
23 setup_prepare()
25 h1=${NETIFS[p1]}
26 swp1=${NETIFS[p2]}
28 swp2=${NETIFS[p3]}
29 h2=${NETIFS[p4]}
31 swp3=${NETIFS[p5]}
32 h3=${NETIFS[p6]}
34 vrf_prepare
35 mirror_gre_topo_create
37 ip address add dev $swp3 192.0.2.129/28
38 ip address add dev $h3 192.0.2.130/28
40 ip address add dev $swp3 2001:db8:2::1/64
41 ip address add dev $h3 2001:db8:2::2/64
44 cleanup()
46 pre_cleanup
48 ip address del dev $h3 2001:db8:2::2/64
49 ip address del dev $swp3 2001:db8:2::1/64
51 ip address del dev $h3 192.0.2.130/28
52 ip address del dev $swp3 192.0.2.129/28
54 mirror_gre_topo_destroy
55 vrf_cleanup
58 test_span_gre_neigh()
60 local addr=$1; shift
61 local tundev=$1; shift
62 local direction=$1; shift
63 local forward_type=$1; shift
64 local backward_type=$1; shift
65 local what=$1; shift
67 RET=0
69 ip neigh replace dev $swp3 $addr lladdr 00:11:22:33:44:55
70 mirror_install $swp1 $direction $tundev "matchall"
71 fail_test_span_gre_dir $tundev "$forward_type" "$backward_type"
72 ip neigh del dev $swp3 $addr
73 quick_test_span_gre_dir $tundev "$forward_type" "$backward_type"
74 mirror_uninstall $swp1 $direction
76 log_test "$direction $what: neighbor change"
79 test_gretap()
81 test_span_gre_neigh 192.0.2.130 gt4 ingress 8 0 "mirror to gretap"
82 test_span_gre_neigh 192.0.2.130 gt4 egress 0 8 "mirror to gretap"
85 test_ip6gretap()
87 test_span_gre_neigh 2001:db8:2::2 gt6 ingress 8 0 "mirror to ip6gretap"
88 test_span_gre_neigh 2001:db8:2::2 gt6 egress 0 8 "mirror to ip6gretap"
91 trap cleanup EXIT
93 setup_prepare
94 setup_wait
96 tests_run
98 exit $EXIT_STATUS