Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1# SPDX-License-Identifier: GPL-2.0
2
3source mirror_lib.sh
4
5quick_test_span_gre_dir_ips()
6{
7 local tundev=$1; shift
8
9 do_test_span_dir_ips 10 h3-$tundev "$@"
10}
11
12fail_test_span_gre_dir_ips()
13{
14 local tundev=$1; shift
15
16 do_test_span_dir_ips 0 h3-$tundev "$@"
17}
18
19test_span_gre_dir_ips()
20{
21 local tundev=$1; shift
22
23 test_span_dir_ips h3-$tundev "$@"
24}
25
26full_test_span_gre_dir_ips()
27{
28 local tundev=$1; shift
29 local direction=$1; shift
30 local forward_type=$1; shift
31 local backward_type=$1; shift
32 local what=$1; shift
33 local ip1=$1; shift
34 local ip2=$1; shift
35
36 RET=0
37
38 mirror_install $swp1 $direction $tundev "matchall $tcflags"
39 test_span_dir_ips "h3-$tundev" "$direction" "$forward_type" \
40 "$backward_type" "$ip1" "$ip2"
41 mirror_uninstall $swp1 $direction
42
43 log_test "$direction $what ($tcflags)"
44}
45
46full_test_span_gre_dir_vlan_ips()
47{
48 local tundev=$1; shift
49 local direction=$1; shift
50 local vlan_match=$1; shift
51 local forward_type=$1; shift
52 local backward_type=$1; shift
53 local what=$1; shift
54 local ip1=$1; shift
55 local ip2=$1; shift
56
57 RET=0
58
59 mirror_install $swp1 $direction $tundev "matchall $tcflags"
60
61 test_span_dir_ips "h3-$tundev" "$direction" "$forward_type" \
62 "$backward_type" "$ip1" "$ip2"
63
64 tc filter add dev $h3 ingress pref 77 prot 802.1q \
65 flower $vlan_match ip_proto 0x2f \
66 action pass
67 mirror_test v$h1 $ip1 $ip2 $h3 77 10
68 tc filter del dev $h3 ingress pref 77
69
70 mirror_uninstall $swp1 $direction
71
72 log_test "$direction $what ($tcflags)"
73}
74
75quick_test_span_gre_dir()
76{
77 quick_test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2
78}
79
80fail_test_span_gre_dir()
81{
82 fail_test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2
83}
84
85test_span_gre_dir()
86{
87 test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2
88}
89
90full_test_span_gre_dir()
91{
92 full_test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2
93}
94
95full_test_span_gre_dir_vlan()
96{
97 full_test_span_gre_dir_vlan_ips "$@" 192.0.2.1 192.0.2.2
98}
99
100full_test_span_gre_stp_ips()
101{
102 local tundev=$1; shift
103 local nbpdev=$1; shift
104 local what=$1; shift
105 local ip1=$1; shift
106 local ip2=$1; shift
107 local h3mac=$(mac_get $h3)
108
109 RET=0
110
111 mirror_install $swp1 ingress $tundev "matchall $tcflags"
112 quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
113
114 bridge link set dev $nbpdev state disabled
115 sleep 1
116 fail_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
117
118 bridge link set dev $nbpdev state forwarding
119 sleep 1
120 quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2
121
122 mirror_uninstall $swp1 ingress
123
124 log_test "$what: STP state ($tcflags)"
125}
126
127full_test_span_gre_stp()
128{
129 full_test_span_gre_stp_ips "$@" 192.0.2.1 192.0.2.2
130}