2 # SPDX-License-Identifier: GPL-2.0
4 # Check that route PMTU values match expectations, and that initial device MTU
5 # values are assigned correctly
7 # Tests currently implemented:
10 # Set up two namespaces, A and B, with two paths between them over routers
11 # R1 and R2 (also implemented with namespaces), with different MTUs:
13 # segment a_r1 segment b_r1 a_r1: 2000
14 # .--------------R1--------------. b_r1: 1400
16 # '--------------R2--------------' b_r2: 1500
17 # segment a_r2 segment b_r2
19 # Check that PMTU exceptions with the correct PMTU are created. Then
20 # decrease and increase the MTU of the local link for one of the paths,
21 # A to R1, checking that route exception PMTU changes accordingly over
22 # this path. Also check that locked exceptions are created when an ICMP
23 # message advertising a PMTU smaller than net.ipv4.route.min_pmtu is
27 # Same as pmtu_ipv4, except for locked PMTU tests, using IPv6
29 # - pmtu_ipv4_vxlan4_exception
30 # Set up the same network topology as pmtu_ipv4, create a VXLAN tunnel
31 # over IPv4 between A and B, routed via R1. On the link between R1 and B,
32 # set a MTU lower than the VXLAN MTU and the MTU on the link between A and
33 # R1. Send IPv4 packets, exceeding the MTU between R1 and B, over VXLAN
34 # from A to B and check that the PMTU exception is created with the right
37 # - pmtu_ipv6_vxlan4_exception
38 # Same as pmtu_ipv4_vxlan4_exception, but send IPv6 packets from A to B
40 # - pmtu_ipv4_vxlan6_exception
41 # Same as pmtu_ipv4_vxlan4_exception, but use IPv6 transport from A to B
43 # - pmtu_ipv6_vxlan6_exception
44 # Same as pmtu_ipv4_vxlan6_exception, but send IPv6 packets from A to B
46 # - pmtu_ipv4_geneve4_exception
47 # Same as pmtu_ipv4_vxlan4_exception, but using a GENEVE tunnel instead of
50 # - pmtu_ipv6_geneve4_exception
51 # Same as pmtu_ipv6_vxlan4_exception, but using a GENEVE tunnel instead of
54 # - pmtu_ipv4_geneve6_exception
55 # Same as pmtu_ipv4_vxlan6_exception, but using a GENEVE tunnel instead of
58 # - pmtu_ipv6_geneve6_exception
59 # Same as pmtu_ipv6_vxlan6_exception, but using a GENEVE tunnel instead of
62 # - pmtu_ipv{4,6}_br_vxlan{4,6}_exception
63 # Set up three namespaces, A, B, and C, with routing between A and B over
64 # R1. R2 is unused in these tests. A has a veth connection to C, and is
65 # connected to B via a VXLAN endpoint, which is directly bridged to C.
66 # MTU on the B-R1 link is lower than other MTUs.
68 # Check that both C and A are able to communicate with B over the VXLAN
69 # tunnel, and that PMTU exceptions with the correct values are created.
71 # segment a_r1 segment b_r1 b_r1: 4000
72 # .--------------R1--------------. everything
73 # C---veth A B else: 5000
75 # '---- - - - - - VXLAN - - - - - - - '
77 # - pmtu_ipv{4,6}_br_geneve{4,6}_exception
78 # Same as pmtu_ipv{4,6}_br_vxlan{4,6}_exception, with a GENEVE tunnel
81 # - pmtu_ipv{4,6}_ovs_vxlan{4,6}_exception
82 # Set up two namespaces, B, and C, with routing between the init namespace
83 # and B over R1. A and R2 are unused in these tests. The init namespace
84 # has a veth connection to C, and is connected to B via a VXLAN endpoint,
85 # which is handled by Open vSwitch and bridged to C. MTU on the B-R1 link
86 # is lower than other MTUs.
88 # Check that C is able to communicate with B over the VXLAN tunnel, and
89 # that PMTU exceptions with the correct values are created.
91 # segment a_r1 segment b_r1 b_r1: 4000
92 # .--------------R1--------------. everything
93 # C---veth init B else: 5000
95 # '---- - - - - - VXLAN - - - - - - - '
97 # - pmtu_ipv{4,6}_ovs_geneve{4,6}_exception
98 # Same as pmtu_ipv{4,6}_ovs_vxlan{4,6}_exception, with a GENEVE tunnel
101 # - pmtu_ipv{4,6}_fou{4,6}_exception
102 # Same as pmtu_ipv4_vxlan4, but using a direct IPv4/IPv6 encapsulation
103 # (FoU) over IPv4/IPv6, instead of VXLAN
105 # - pmtu_ipv{4,6}_fou{4,6}_exception
106 # Same as pmtu_ipv4_vxlan4, but using a generic UDP IPv4/IPv6
107 # encapsulation (GUE) over IPv4/IPv6, instead of VXLAN
109 # - pmtu_ipv{4,6}_ipv{4,6}_exception
110 # Same as pmtu_ipv4_vxlan4, but using a IPv4/IPv6 tunnel over IPv4/IPv6,
113 # - pmtu_vti4_exception
114 # Set up vti tunnel on top of veth, with xfrm states and policies, in two
115 # namespaces with matching endpoints. Check that route exception is not
116 # created if link layer MTU is not exceeded, then exceed it and check that
117 # exception is created with the expected PMTU. The approach described
118 # below for IPv6 doesn't apply here, because, on IPv4, administrative MTU
119 # changes alone won't affect PMTU
121 # - pmtu_vti6_exception
122 # Set up vti6 tunnel on top of veth, with xfrm states and policies, in two
123 # namespaces with matching endpoints. Check that route exception is
124 # created by exceeding link layer MTU with ping to other endpoint. Then
125 # decrease and increase MTU of tunnel, checking that route exception PMTU
126 # changes accordingly
128 # - pmtu_vti4_default_mtu
129 # Set up vti4 tunnel on top of veth, in two namespaces with matching
130 # endpoints. Check that MTU assigned to vti interface is the MTU of the
131 # lower layer (veth) minus additional lower layer headers (zero, for veth)
132 # minus IPv4 header length
134 # - pmtu_vti6_default_mtu
135 # Same as above, for IPv6
137 # - pmtu_vti4_link_add_mtu
138 # Set up vti4 interface passing MTU value at link creation, check MTU is
139 # configured, and that link is not created with invalid MTU values
141 # - pmtu_vti6_link_add_mtu
142 # Same as above, for IPv6
144 # - pmtu_vti6_link_change_mtu
145 # Set up two dummy interfaces with different MTUs, create a vti6 tunnel
146 # and check that configured MTU is used on link creation and changes, and
147 # that MTU is properly calculated instead when MTU is not configured from
150 # - cleanup_ipv4_exception
151 # Similar to pmtu_ipv4_vxlan4_exception, but explicitly generate PMTU
152 # exceptions on multiple CPUs and check that the veth device tear-down
153 # happens in a timely manner
155 # - cleanup_ipv6_exception
156 # Same as above, but use IPv6 transport from A to B
158 # - list_flush_ipv4_exception
159 # Using the same topology as in pmtu_ipv4, create exceptions, and check
160 # they are shown when listing exception caches, gone after flushing them
162 # - list_flush_ipv6_exception
163 # Using the same topology as in pmtu_ipv6, create exceptions, and check
164 # they are shown when listing exception caches, gone after flushing them
167 # Kselftest framework requirement - SKIP code is 4.
174 # Some systems don't have a ping6 binary anymore
175 which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
177 # Name Description re-run with nh
179 pmtu_ipv4_exception ipv4: PMTU exceptions 1
180 pmtu_ipv6_exception ipv6: PMTU exceptions 1
181 pmtu_ipv4_vxlan4_exception IPv4 over vxlan4: PMTU exceptions 1
182 pmtu_ipv6_vxlan4_exception IPv6 over vxlan4: PMTU exceptions 1
183 pmtu_ipv4_vxlan6_exception IPv4 over vxlan6: PMTU exceptions 1
184 pmtu_ipv6_vxlan6_exception IPv6 over vxlan6: PMTU exceptions 1
185 pmtu_ipv4_geneve4_exception IPv4 over geneve4: PMTU exceptions 1
186 pmtu_ipv6_geneve4_exception IPv6 over geneve4: PMTU exceptions 1
187 pmtu_ipv4_geneve6_exception IPv4 over geneve6: PMTU exceptions 1
188 pmtu_ipv6_geneve6_exception IPv6 over geneve6: PMTU exceptions 1
189 pmtu_ipv4_br_vxlan4_exception IPv4, bridged vxlan4: PMTU exceptions 1
190 pmtu_ipv6_br_vxlan4_exception IPv6, bridged vxlan4: PMTU exceptions 1
191 pmtu_ipv4_br_vxlan6_exception IPv4, bridged vxlan6: PMTU exceptions 1
192 pmtu_ipv6_br_vxlan6_exception IPv6, bridged vxlan6: PMTU exceptions 1
193 pmtu_ipv4_br_geneve4_exception IPv4, bridged geneve4: PMTU exceptions 1
194 pmtu_ipv6_br_geneve4_exception IPv6, bridged geneve4: PMTU exceptions 1
195 pmtu_ipv4_br_geneve6_exception IPv4, bridged geneve6: PMTU exceptions 1
196 pmtu_ipv6_br_geneve6_exception IPv6, bridged geneve6: PMTU exceptions 1
197 pmtu_ipv4_ovs_vxlan4_exception IPv4, OVS vxlan4: PMTU exceptions 1
198 pmtu_ipv6_ovs_vxlan4_exception IPv6, OVS vxlan4: PMTU exceptions 1
199 pmtu_ipv4_ovs_vxlan6_exception IPv4, OVS vxlan6: PMTU exceptions 1
200 pmtu_ipv6_ovs_vxlan6_exception IPv6, OVS vxlan6: PMTU exceptions 1
201 pmtu_ipv4_ovs_geneve4_exception IPv4, OVS geneve4: PMTU exceptions 1
202 pmtu_ipv6_ovs_geneve4_exception IPv6, OVS geneve4: PMTU exceptions 1
203 pmtu_ipv4_ovs_geneve6_exception IPv4, OVS geneve6: PMTU exceptions 1
204 pmtu_ipv6_ovs_geneve6_exception IPv6, OVS geneve6: PMTU exceptions 1
205 pmtu_ipv4_fou4_exception IPv4 over fou4: PMTU exceptions 1
206 pmtu_ipv6_fou4_exception IPv6 over fou4: PMTU exceptions 1
207 pmtu_ipv4_fou6_exception IPv4 over fou6: PMTU exceptions 1
208 pmtu_ipv6_fou6_exception IPv6 over fou6: PMTU exceptions 1
209 pmtu_ipv4_gue4_exception IPv4 over gue4: PMTU exceptions 1
210 pmtu_ipv6_gue4_exception IPv6 over gue4: PMTU exceptions 1
211 pmtu_ipv4_gue6_exception IPv4 over gue6: PMTU exceptions 1
212 pmtu_ipv6_gue6_exception IPv6 over gue6: PMTU exceptions 1
213 pmtu_ipv4_ipv4_exception IPv4 over IPv4: PMTU exceptions 1
214 pmtu_ipv6_ipv4_exception IPv6 over IPv4: PMTU exceptions 1
215 pmtu_ipv4_ipv6_exception IPv4 over IPv6: PMTU exceptions 1
216 pmtu_ipv6_ipv6_exception IPv6 over IPv6: PMTU exceptions 1
217 pmtu_vti6_exception vti6: PMTU exceptions 0
218 pmtu_vti4_exception vti4: PMTU exceptions 0
219 pmtu_vti4_default_mtu vti4: default MTU assignment 0
220 pmtu_vti6_default_mtu vti6: default MTU assignment 0
221 pmtu_vti4_link_add_mtu vti4: MTU setting on link creation 0
222 pmtu_vti6_link_add_mtu vti6: MTU setting on link creation 0
223 pmtu_vti6_link_change_mtu vti6: MTU changes on link changes 0
224 cleanup_ipv4_exception ipv4: cleanup of cached exceptions 1
225 cleanup_ipv6_exception ipv6: cleanup of cached exceptions 1
226 list_flush_ipv4_exception ipv4: list and flush cached exceptions 1
227 list_flush_ipv6_exception ipv6: list and flush cached exceptions 1"
234 ns_a="ip netns exec ${NS_A}"
235 ns_b="ip netns exec ${NS_B}"
236 ns_c="ip netns exec ${NS_C}"
237 ns_r1="ip netns exec ${NS_R1}"
238 ns_r2="ip netns exec ${NS_R2}"
240 # Addressing and routing for tests with routers: four network segments, with
241 # index SEGMENT between 1 and 4, a common prefix (PREFIX4 or PREFIX6) and an
242 # identifier ID, which is 1 for hosts (A and B), 2 for routers (R1 and R2).
244 # - IPv4: PREFIX4.SEGMENT.ID (/24)
245 # - IPv6: PREFIX6:SEGMENT::ID (/64)
259 # Traffic from A to B goes through R1 by default, and through R2, if destined to
260 # B's address on the b_r2 segment.
261 # Traffic from B to A goes through R1.
262 # ns destination gateway
264 A default ${prefix4}.${a_r1}.2
265 A ${prefix4}.${b_r2}.1 ${prefix4}.${a_r2}.2
266 B default ${prefix4}.${b_r1}.2
268 A default ${prefix6}:${a_r1}::2
269 A ${prefix6}:${b_r2}::1 ${prefix6}:${a_r2}::2
270 B default ${prefix6}:${b_r1}::2
274 # ns family nh id destination gateway
276 A 4 41 ${prefix4}.${a_r1}.2 veth_A-R1
277 A 4 42 ${prefix4}.${a_r2}.2 veth_A-R2
278 B 4 41 ${prefix4}.${b_r1}.2 veth_B-R1
280 A 6 61 ${prefix6}:${a_r1}::2 veth_A-R1
281 A 6 62 ${prefix6}:${a_r2}::2 veth_A-R2
282 B 6 61 ${prefix6}:${b_r1}::2 veth_B-R1
285 # nexthop id correlates to id in nexthops config above
286 # ns family prefix nh id
289 A 4 ${prefix4}.${b_r2}.1 42
293 A 6 ${prefix6}:${b_r2}::1 62
297 veth4_a_addr="192.168.1.1"
298 veth4_b_addr="192.168.1.2"
299 veth4_c_addr="192.168.2.10"
301 veth6_a_addr="fd00:1::a"
302 veth6_b_addr="fd00:1::b"
303 veth6_c_addr="fd00:2::c"
306 tunnel4_a_addr="192.168.2.1"
307 tunnel4_b_addr="192.168.2.2"
309 tunnel6_a_addr="fd00:2::a"
310 tunnel6_b_addr="fd00:2::b"
313 dummy6_0_prefix="fc00:1000::"
314 dummy6_1_prefix="fc00:1001::"
321 err_buf="${err_buf}${1}
333 if [ "$VERBOSE" = "1" ]; then
334 printf " COMMAND: $cmd\n"
339 if [ "$VERBOSE" = "1" -a -n "$out" ]; then
347 # Find the auto-generated name for this namespace
357 if [ "${outer}" = "4" ]; then
358 modprobe fou || return 2
359 a_addr="${prefix4}.${a_r1}.1"
360 b_addr="${prefix4}.${b_r1}.1"
361 if [ "${inner}" = "4" ]; then
369 modprobe fou6 || return 2
370 a_addr="${prefix6}:${a_r1}::1"
371 b_addr="${prefix6}:${b_r1}::1"
372 if [ "${inner}" = "4" ]; then
383 run_cmd ${ns_a} ip fou add port 5555 ipproto ${ipproto} || return 2
384 run_cmd ${ns_a} ip link add ${encap}_a type ${type} ${mode} local ${a_addr} remote ${b_addr} encap ${encap} encap-sport auto encap-dport 5556 || return 2
386 run_cmd ${ns_b} ip fou add port 5556 ipproto ${ipproto}
387 run_cmd ${ns_b} ip link add ${encap}_b type ${type} ${mode} local ${b_addr} remote ${a_addr} encap ${encap} encap-sport auto encap-dport 5555
389 if [ "${inner}" = "4" ]; then
390 run_cmd ${ns_a} ip addr add ${tunnel4_a_addr}/${tunnel4_mask} dev ${encap}_a
391 run_cmd ${ns_b} ip addr add ${tunnel4_b_addr}/${tunnel4_mask} dev ${encap}_b
393 run_cmd ${ns_a} ip addr add ${tunnel6_a_addr}/${tunnel6_mask} dev ${encap}_a
394 run_cmd ${ns_b} ip addr add ${tunnel6_b_addr}/${tunnel6_mask} dev ${encap}_b
397 run_cmd ${ns_a} ip link set ${encap}_a up
398 run_cmd ${ns_b} ip link set ${encap}_b up
402 setup_fou_or_gue 4 4 fou
406 setup_fou_or_gue 4 6 fou
410 setup_fou_or_gue 6 4 fou
414 setup_fou_or_gue 6 6 fou
418 setup_fou_or_gue 4 4 gue
422 setup_fou_or_gue 4 6 gue
426 setup_fou_or_gue 6 4 gue
430 setup_fou_or_gue 6 6 gue
433 setup_ipvX_over_ipvY() {
437 if [ "${outer}" -eq 4 ]; then
438 a_addr="${prefix4}.${a_r1}.1"
439 b_addr="${prefix4}.${b_r1}.1"
440 if [ "${inner}" -eq 4 ]; then
448 a_addr="${prefix6}:${a_r1}::1"
449 b_addr="${prefix6}:${b_r1}::1"
451 if [ "${inner}" -eq 4 ]; then
458 run_cmd ${ns_a} ip link add ip_a type ${type} local ${a_addr} remote ${b_addr} mode ${mode} || return 2
459 run_cmd ${ns_b} ip link add ip_b type ${type} local ${b_addr} remote ${a_addr} mode ${mode}
461 run_cmd ${ns_a} ip link set ip_a up
462 run_cmd ${ns_b} ip link set ip_b up
464 if [ "${inner}" = "4" ]; then
465 run_cmd ${ns_a} ip addr add ${tunnel4_a_addr}/${tunnel4_mask} dev ip_a
466 run_cmd ${ns_b} ip addr add ${tunnel4_b_addr}/${tunnel4_mask} dev ip_b
468 run_cmd ${ns_a} ip addr add ${tunnel6_a_addr}/${tunnel6_mask} dev ip_a
469 run_cmd ${ns_b} ip addr add ${tunnel6_b_addr}/${tunnel6_mask} dev ip_b
474 setup_ipvX_over_ipvY 4 4
478 setup_ipvX_over_ipvY 6 4
482 setup_ipvX_over_ipvY 4 6
486 setup_ipvX_over_ipvY 6 6
490 for n in ${NS_A} ${NS_B} ${NS_C} ${NS_R1} ${NS_R2}; do
491 ip netns add ${n} || return 1
493 # Disable DAD, so that we don't have to wait to use the
494 # configured IPv6 addresses
495 ip netns exec ${n} sysctl -q net/ipv6/conf/default/accept_dad=0
500 run_cmd ${ns_a} ip link add veth_a type veth peer name veth_b || return 1
501 run_cmd ${ns_a} ip link set veth_b netns ${NS_B}
503 run_cmd ${ns_a} ip addr add ${veth4_a_addr}/${veth4_mask} dev veth_a
504 run_cmd ${ns_b} ip addr add ${veth4_b_addr}/${veth4_mask} dev veth_b
506 run_cmd ${ns_a} ip addr add ${veth6_a_addr}/${veth6_mask} dev veth_a
507 run_cmd ${ns_b} ip addr add ${veth6_b_addr}/${veth6_mask} dev veth_b
509 run_cmd ${ns_a} ip link set veth_a up
510 run_cmd ${ns_b} ip link set veth_b up
521 [ ${proto} -eq 6 ] && vti_type="vti6" || vti_type="vti"
523 run_cmd ${ns_a} ip link add vti${proto}_a type ${vti_type} local ${veth_a_addr} remote ${veth_b_addr} key 10 || return 1
524 run_cmd ${ns_b} ip link add vti${proto}_b type ${vti_type} local ${veth_b_addr} remote ${veth_a_addr} key 10
526 run_cmd ${ns_a} ip addr add ${vti_a_addr}/${vti_mask} dev vti${proto}_a
527 run_cmd ${ns_b} ip addr add ${vti_b_addr}/${vti_mask} dev vti${proto}_b
529 run_cmd ${ns_a} ip link set vti${proto}_a up
530 run_cmd ${ns_b} ip link set vti${proto}_b up
534 setup_vti 4 ${veth4_a_addr} ${veth4_b_addr} ${tunnel4_a_addr} ${tunnel4_b_addr} ${tunnel4_mask}
538 setup_vti 6 ${veth6_a_addr} ${veth6_b_addr} ${tunnel6_a_addr} ${tunnel6_b_addr} ${tunnel6_mask}
541 setup_vxlan_or_geneve() {
548 if [ "${type}" = "vxlan" ]; then
549 opts="${opts} ttl 64 dstport 4789"
550 opts_a="local ${a_addr}"
551 opts_b="local ${b_addr}"
557 run_cmd ${ns_a} ip link add ${type}_a type ${type} id 1 ${opts_a} remote ${b_addr} ${opts} || return 1
558 run_cmd ${ns_b} ip link add ${type}_b type ${type} id 1 ${opts_b} remote ${a_addr} ${opts}
560 if [ -n "${br_if_a}" ]; then
561 run_cmd ${ns_a} ip addr add ${tunnel4_a_addr}/${tunnel4_mask} dev ${br_if_a}
562 run_cmd ${ns_a} ip addr add ${tunnel6_a_addr}/${tunnel6_mask} dev ${br_if_a}
563 run_cmd ${ns_a} ip link set ${type}_a master ${br_if_a}
565 run_cmd ${ns_a} ip addr add ${tunnel4_a_addr}/${tunnel4_mask} dev ${type}_a
566 run_cmd ${ns_a} ip addr add ${tunnel6_a_addr}/${tunnel6_mask} dev ${type}_a
569 run_cmd ${ns_b} ip addr add ${tunnel4_b_addr}/${tunnel4_mask} dev ${type}_b
570 run_cmd ${ns_b} ip addr add ${tunnel6_b_addr}/${tunnel6_mask} dev ${type}_b
572 run_cmd ${ns_a} ip link set ${type}_a up
573 run_cmd ${ns_b} ip link set ${type}_b up
577 setup_vxlan_or_geneve geneve ${prefix4}.${a_r1}.1 ${prefix4}.${b_r1}.1 "df set"
581 setup_vxlan_or_geneve vxlan ${prefix4}.${a_r1}.1 ${prefix4}.${b_r1}.1 "df set"
585 setup_vxlan_or_geneve geneve ${prefix6}:${a_r1}::1 ${prefix6}:${b_r1}::1 ""
589 setup_vxlan_or_geneve vxlan ${prefix6}:${a_r1}::1 ${prefix6}:${b_r1}::1 ""
592 setup_bridged_geneve4() {
593 setup_vxlan_or_geneve geneve ${prefix4}.${a_r1}.1 ${prefix4}.${b_r1}.1 "df set" "br0"
596 setup_bridged_vxlan4() {
597 setup_vxlan_or_geneve vxlan ${prefix4}.${a_r1}.1 ${prefix4}.${b_r1}.1 "df set" "br0"
600 setup_bridged_geneve6() {
601 setup_vxlan_or_geneve geneve ${prefix6}:${a_r1}::1 ${prefix6}:${b_r1}::1 "" "br0"
604 setup_bridged_vxlan6() {
605 setup_vxlan_or_geneve vxlan ${prefix6}:${a_r1}::1 ${prefix6}:${b_r1}::1 "" "br0"
613 run_cmd ${ns_a} ip -${proto} xfrm state add src ${veth_a_addr} dst ${veth_b_addr} spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel || return 1
614 run_cmd ${ns_a} ip -${proto} xfrm state add src ${veth_b_addr} dst ${veth_a_addr} spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
615 run_cmd ${ns_a} ip -${proto} xfrm policy add dir out mark 10 tmpl src ${veth_a_addr} dst ${veth_b_addr} proto esp mode tunnel
616 run_cmd ${ns_a} ip -${proto} xfrm policy add dir in mark 10 tmpl src ${veth_b_addr} dst ${veth_a_addr} proto esp mode tunnel
618 run_cmd ${ns_b} ip -${proto} xfrm state add src ${veth_a_addr} dst ${veth_b_addr} spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
619 run_cmd ${ns_b} ip -${proto} xfrm state add src ${veth_b_addr} dst ${veth_a_addr} spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
620 run_cmd ${ns_b} ip -${proto} xfrm policy add dir out mark 10 tmpl src ${veth_b_addr} dst ${veth_a_addr} proto esp mode tunnel
621 run_cmd ${ns_b} ip -${proto} xfrm policy add dir in mark 10 tmpl src ${veth_a_addr} dst ${veth_b_addr} proto esp mode tunnel
625 setup_xfrm 4 ${veth4_a_addr} ${veth4_b_addr}
629 setup_xfrm 6 ${veth6_a_addr} ${veth6_b_addr}
632 setup_routing_old() {
633 for i in ${routes}; do
634 [ "${ns}" = "" ] && ns="${i}" && continue
635 [ "${addr}" = "" ] && addr="${i}" && continue
636 [ "${gw}" = "" ] && gw="${i}"
638 ns_name="$(nsname ${ns})"
640 ip -n ${ns_name} route add ${addr} via ${gw}
642 ns=""; addr=""; gw=""
646 setup_routing_new() {
647 for i in ${nexthops}; do
648 [ "${ns}" = "" ] && ns="${i}" && continue
649 [ "${fam}" = "" ] && fam="${i}" && continue
650 [ "${nhid}" = "" ] && nhid="${i}" && continue
651 [ "${gw}" = "" ] && gw="${i}" && continue
652 [ "${dev}" = "" ] && dev="${i}"
654 ns_name="$(nsname ${ns})"
656 ip -n ${ns_name} -${fam} nexthop add id ${nhid} via ${gw} dev ${dev}
658 ns=""; fam=""; nhid=""; gw=""; dev=""
662 for i in ${routes_nh}; do
663 [ "${ns}" = "" ] && ns="${i}" && continue
664 [ "${fam}" = "" ] && fam="${i}" && continue
665 [ "${addr}" = "" ] && addr="${i}" && continue
666 [ "${nhid}" = "" ] && nhid="${i}"
668 ns_name="$(nsname ${ns})"
670 ip -n ${ns_name} -${fam} route add ${addr} nhid ${nhid}
672 ns=""; fam=""; addr=""; nhid=""
677 for i in ${NS_R1} ${NS_R2}; do
678 ip netns exec ${i} sysctl -q net/ipv4/ip_forward=1
679 ip netns exec ${i} sysctl -q net/ipv6/conf/all/forwarding=1
682 for i in ${routing_addrs}; do
683 [ "${ns}" = "" ] && ns="${i}" && continue
684 [ "${peer}" = "" ] && peer="${i}" && continue
685 [ "${segment}" = "" ] && segment="${i}"
687 ns_name="$(nsname ${ns})"
688 peer_name="$(nsname ${peer})"
689 if="veth_${ns}-${peer}"
690 ifpeer="veth_${peer}-${ns}"
693 ip link add ${if} up netns ${ns_name} type veth peer name ${ifpeer} netns ${peer_name} || return 1
694 ip -n ${peer_name} link set dev ${ifpeer} up
697 ip -n ${ns_name} addr add ${prefix4}.${segment}.1/24 dev ${if}
698 ip -n ${ns_name} addr add ${prefix6}:${segment}::1/64 dev ${if}
700 ip -n ${peer_name} addr add ${prefix4}.${segment}.2/24 dev ${ifpeer}
701 ip -n ${peer_name} addr add ${prefix6}:${segment}::2/64 dev ${ifpeer}
703 ns=""; peer=""; segment=""
706 if [ "$USE_NH" = "yes" ]; then
716 run_cmd ${ns_a} ip link add br0 type bridge || return 2
717 run_cmd ${ns_a} ip link set br0 up
719 run_cmd ${ns_c} ip link add veth_C-A type veth peer name veth_A-C
720 run_cmd ${ns_c} ip link set veth_A-C netns ns-A
722 run_cmd ${ns_a} ip link set veth_A-C up
723 run_cmd ${ns_c} ip link set veth_C-A up
724 run_cmd ${ns_c} ip addr add ${veth4_c_addr}/${veth4_mask} dev veth_C-A
725 run_cmd ${ns_c} ip addr add ${veth6_c_addr}/${veth6_mask} dev veth_C-A
726 run_cmd ${ns_a} ip link set veth_A-C master br0
729 setup_ovs_vxlan_or_geneve() {
734 if [ "${type}" = "vxlan" ]; then
735 opts="${opts} ttl 64 dstport 4789"
736 opts_b="local ${b_addr}"
739 run_cmd ovs-vsctl add-port ovs_br0 ${type}_a -- \
740 set interface ${type}_a type=${type} \
741 options:remote_ip=${b_addr} options:key=1 options:csum=true || return 1
743 run_cmd ${ns_b} ip link add ${type}_b type ${type} id 1 ${opts_b} remote ${a_addr} ${opts} || return 1
745 run_cmd ${ns_b} ip addr add ${tunnel4_b_addr}/${tunnel4_mask} dev ${type}_b
746 run_cmd ${ns_b} ip addr add ${tunnel6_b_addr}/${tunnel6_mask} dev ${type}_b
748 run_cmd ${ns_b} ip link set ${type}_b up
751 setup_ovs_geneve4() {
752 setup_ovs_vxlan_or_geneve geneve ${prefix4}.${a_r1}.1 ${prefix4}.${b_r1}.1
756 setup_ovs_vxlan_or_geneve vxlan ${prefix4}.${a_r1}.1 ${prefix4}.${b_r1}.1
759 setup_ovs_geneve6() {
760 setup_ovs_vxlan_or_geneve geneve ${prefix6}:${a_r1}::1 ${prefix6}:${b_r1}::1
764 setup_ovs_vxlan_or_geneve vxlan ${prefix6}:${a_r1}::1 ${prefix6}:${b_r1}::1
768 run_cmd ovs-vsctl add-br ovs_br0 || return 2
769 run_cmd ip link set ovs_br0 up
771 run_cmd ${ns_c} ip link add veth_C-A type veth peer name veth_A-C
772 run_cmd ${ns_c} ip link set veth_A-C netns 1
774 run_cmd ip link set veth_A-C up
775 run_cmd ${ns_c} ip link set veth_C-A up
776 run_cmd ${ns_c} ip addr add ${veth4_c_addr}/${veth4_mask} dev veth_C-A
777 run_cmd ${ns_c} ip addr add ${veth6_c_addr}/${veth6_mask} dev veth_C-A
778 run_cmd ovs-vsctl add-port ovs_br0 veth_A-C
780 # Move veth_A-R1 to init
781 run_cmd ${ns_a} ip link set veth_A-R1 netns 1
782 run_cmd ip addr add ${prefix4}.${a_r1}.1/${veth4_mask} dev veth_A-R1
783 run_cmd ip addr add ${prefix6}:${a_r1}::1/${veth6_mask} dev veth_A-R1
784 run_cmd ip link set veth_A-R1 up
785 run_cmd ip route add ${prefix4}.${b_r1}.1 via ${prefix4}.${a_r1}.2
786 run_cmd ip route add ${prefix6}:${b_r1}::1 via ${prefix6}:${a_r1}::2
790 [ "$(id -u)" -ne 0 ] && echo " need to run as root" && return $ksft_skip
794 eval setup_${arg} || { echo " ${arg} not supported"; return 1; }
799 [ $TRACING -eq 0 ] && return
802 [ "${ns_cmd}" = "" ] && ns_cmd="${arg}" && continue
803 ${ns_cmd} tcpdump -s 0 -i "${arg}" -w "${name}_${arg}.pcap" 2> /dev/null &
804 tcpdump_pids="${tcpdump_pids} $!"
811 for pid in ${tcpdump_pids}; do
816 for n in ${NS_A} ${NS_B} ${NS_C} ${NS_R1} ${NS_R2}; do
817 ip netns del ${n} 2> /dev/null
820 ip link del veth_A-C 2>/dev/null
821 ip link del veth_A-R1 2>/dev/null
822 ovs-vsctl --if-exists del-port vxlan_a 2>/dev/null
823 ovs-vsctl --if-exists del-br ovs_br0 2>/dev/null
831 ${ns_cmd} ip link set dev ${dev} mtu ${mtu}
838 for i in ${input}; do
839 [ ${next} -eq 1 -a "${i}" = "lock" ] && next=2 && continue
840 [ ${next} -eq 1 ] && echo "${i}" && return
841 [ ${next} -eq 2 ] && echo "lock ${i}" && return
842 [ "${i}" = "mtu" ] && next=1
850 ${ns_cmd} ip link show dev "${name}"
857 mtu_parse "$(link_get "${ns_cmd}" ${name})"
860 route_get_dst_exception() {
864 ${ns_cmd} ip route get "${dst}"
867 route_get_dst_pmtu_from_exception() {
871 mtu_parse "$(route_get_dst_exception "${ns_cmd}" ${dst})"
879 [ "${expected}" = "any" ] && [ -n "${value}" ] && return 0
880 [ "${value}" = "${expected}" ] && return 0
881 [ -z "${value}" ] && err " PMTU exception wasn't created after ${event}" && return 1
882 [ -z "${expected}" ] && err " PMTU exception shouldn't exist after ${event}" && return 1
883 err " found PMTU exception with incorrect MTU ${value}, expected ${expected}, after ${event}"
890 setup namespaces routing || return 2
891 trace "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
892 "${ns_r1}" veth_R1-B "${ns_b}" veth_B-R1 \
893 "${ns_a}" veth_A-R2 "${ns_r2}" veth_R2-A \
894 "${ns_r2}" veth_R2-B "${ns_b}" veth_B-R2
896 if [ ${family} -eq 4 ]; then
898 dst1="${prefix4}.${b_r1}.1"
899 dst2="${prefix4}.${b_r2}.1"
902 dst1="${prefix6}:${b_r1}::1"
903 dst2="${prefix6}:${b_r2}::1"
906 # Set up initial MTU values
907 mtu "${ns_a}" veth_A-R1 2000
908 mtu "${ns_r1}" veth_R1-A 2000
909 mtu "${ns_r1}" veth_R1-B 1400
910 mtu "${ns_b}" veth_B-R1 1400
912 mtu "${ns_a}" veth_A-R2 2000
913 mtu "${ns_r2}" veth_R2-A 2000
914 mtu "${ns_r2}" veth_R2-B 1500
915 mtu "${ns_b}" veth_B-R2 1500
917 # Create route exceptions
918 run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1800 ${dst1}
919 run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1800 ${dst2}
921 # Check that exceptions have been created with the correct PMTU
922 pmtu_1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})"
923 check_pmtu_value "1400" "${pmtu_1}" "exceeding MTU" || return 1
924 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
925 check_pmtu_value "1500" "${pmtu_2}" "exceeding MTU" || return 1
927 # Decrease local MTU below PMTU, check for PMTU decrease in route exception
928 mtu "${ns_a}" veth_A-R1 1300
929 mtu "${ns_r1}" veth_R1-A 1300
930 pmtu_1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})"
931 check_pmtu_value "1300" "${pmtu_1}" "decreasing local MTU" || return 1
932 # Second exception shouldn't be modified
933 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
934 check_pmtu_value "1500" "${pmtu_2}" "changing local MTU on a link not on this path" || return 1
936 # Increase MTU, check for PMTU increase in route exception
937 mtu "${ns_a}" veth_A-R1 1700
938 mtu "${ns_r1}" veth_R1-A 1700
939 pmtu_1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})"
940 check_pmtu_value "1700" "${pmtu_1}" "increasing local MTU" || return 1
941 # Second exception shouldn't be modified
942 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
943 check_pmtu_value "1500" "${pmtu_2}" "changing local MTU on a link not on this path" || return 1
945 # Skip PMTU locking tests for IPv6
946 [ $family -eq 6 ] && return 0
948 # Decrease remote MTU on path via R2, get new exception
949 mtu "${ns_r2}" veth_R2-B 400
950 mtu "${ns_b}" veth_B-R2 400
951 run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1400 ${dst2}
952 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
953 check_pmtu_value "lock 552" "${pmtu_2}" "exceeding MTU, with MTU < min_pmtu" || return 1
955 # Decrease local MTU below PMTU
956 mtu "${ns_a}" veth_A-R2 500
957 mtu "${ns_r2}" veth_R2-A 500
958 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
959 check_pmtu_value "500" "${pmtu_2}" "decreasing local MTU" || return 1
962 mtu "${ns_a}" veth_A-R2 1500
963 mtu "${ns_r2}" veth_R2-A 1500
964 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
965 check_pmtu_value "1500" "${pmtu_2}" "increasing local MTU" || return 1
968 run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1400 ${dst2}
969 pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
970 check_pmtu_value "lock 552" "${pmtu_2}" "exceeding MTU, with MTU < min_pmtu" || return 1
973 test_pmtu_ipv4_exception() {
977 test_pmtu_ipv6_exception() {
981 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception() {
987 if [ ${outer_family} -eq 4 ]; then
988 setup namespaces routing ${type}4 || return 2
989 # IPv4 header UDP header VXLAN/GENEVE header Ethernet header
990 exp_mtu=$((${ll_mtu} - 20 - 8 - 8 - 14))
992 setup namespaces routing ${type}6 || return 2
993 # IPv6 header UDP header VXLAN/GENEVE header Ethernet header
994 exp_mtu=$((${ll_mtu} - 40 - 8 - 8 - 14))
997 trace "${ns_a}" ${type}_a "${ns_b}" ${type}_b \
998 "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
999 "${ns_b}" veth_B-R1 "${ns_r1}" veth_R1-B
1001 if [ ${family} -eq 4 ]; then
1003 dst=${tunnel4_b_addr}
1006 dst=${tunnel6_b_addr}
1009 # Create route exception by exceeding link layer MTU
1010 mtu "${ns_a}" veth_A-R1 $((${ll_mtu} + 1000))
1011 mtu "${ns_r1}" veth_R1-A $((${ll_mtu} + 1000))
1012 mtu "${ns_b}" veth_B-R1 ${ll_mtu}
1013 mtu "${ns_r1}" veth_R1-B ${ll_mtu}
1015 mtu "${ns_a}" ${type}_a $((${ll_mtu} + 1000))
1016 mtu "${ns_b}" ${type}_b $((${ll_mtu} + 1000))
1017 run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${dst}
1019 # Check that exception was created
1020 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})"
1021 check_pmtu_value ${exp_mtu} "${pmtu}" "exceeding link layer MTU on ${type} interface"
1024 test_pmtu_ipv4_vxlan4_exception() {
1025 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception vxlan 4 4
1028 test_pmtu_ipv6_vxlan4_exception() {
1029 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception vxlan 6 4
1032 test_pmtu_ipv4_geneve4_exception() {
1033 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception geneve 4 4
1036 test_pmtu_ipv6_geneve4_exception() {
1037 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception geneve 6 4
1040 test_pmtu_ipv4_vxlan6_exception() {
1041 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception vxlan 4 6
1044 test_pmtu_ipv6_vxlan6_exception() {
1045 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception vxlan 6 6
1048 test_pmtu_ipv4_geneve6_exception() {
1049 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception geneve 4 6
1052 test_pmtu_ipv6_geneve6_exception() {
1053 test_pmtu_ipvX_over_vxlanY_or_geneveY_exception geneve 6 6
1056 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception() {
1062 if [ ${outer_family} -eq 4 ]; then
1063 setup namespaces routing bridge bridged_${type}4 || return 2
1064 # IPv4 header UDP header VXLAN/GENEVE header Ethernet header
1065 exp_mtu=$((${ll_mtu} - 20 - 8 - 8 - 14))
1067 setup namespaces routing bridge bridged_${type}6 || return 2
1068 # IPv6 header UDP header VXLAN/GENEVE header Ethernet header
1069 exp_mtu=$((${ll_mtu} - 40 - 8 - 8 - 14))
1072 trace "${ns_a}" ${type}_a "${ns_b}" ${type}_b \
1073 "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
1074 "${ns_b}" veth_B-R1 "${ns_r1}" veth_R1-B \
1075 "${ns_a}" br0 "${ns_a}" veth-A-C \
1078 if [ ${family} -eq 4 ]; then
1080 dst=${tunnel4_b_addr}
1083 dst=${tunnel6_b_addr}
1086 # Create route exception by exceeding link layer MTU
1087 mtu "${ns_a}" veth_A-R1 $((${ll_mtu} + 1000))
1088 mtu "${ns_a}" br0 $((${ll_mtu} + 1000))
1089 mtu "${ns_a}" veth_A-C $((${ll_mtu} + 1000))
1090 mtu "${ns_c}" veth_C-A $((${ll_mtu} + 1000))
1091 mtu "${ns_r1}" veth_R1-A $((${ll_mtu} + 1000))
1092 mtu "${ns_b}" veth_B-R1 ${ll_mtu}
1093 mtu "${ns_r1}" veth_R1-B ${ll_mtu}
1095 mtu "${ns_a}" ${type}_a $((${ll_mtu} + 1000))
1096 mtu "${ns_b}" ${type}_b $((${ll_mtu} + 1000))
1098 run_cmd ${ns_c} ${ping} -q -M want -i 0.1 -c 10 -s $((${ll_mtu} + 500)) ${dst} || return 1
1099 run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${dst} || return 1
1101 # Check that exceptions were created
1102 pmtu="$(route_get_dst_pmtu_from_exception "${ns_c}" ${dst})"
1103 check_pmtu_value ${exp_mtu} "${pmtu}" "exceeding link layer MTU on bridged ${type} interface"
1104 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})"
1105 check_pmtu_value ${exp_mtu} "${pmtu}" "exceeding link layer MTU on locally bridged ${type} interface"
1108 test_pmtu_ipv4_br_vxlan4_exception() {
1109 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception vxlan 4 4
1112 test_pmtu_ipv6_br_vxlan4_exception() {
1113 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception vxlan 6 4
1116 test_pmtu_ipv4_br_geneve4_exception() {
1117 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception geneve 4 4
1120 test_pmtu_ipv6_br_geneve4_exception() {
1121 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception geneve 6 4
1124 test_pmtu_ipv4_br_vxlan6_exception() {
1125 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception vxlan 4 6
1128 test_pmtu_ipv6_br_vxlan6_exception() {
1129 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception vxlan 6 6
1132 test_pmtu_ipv4_br_geneve6_exception() {
1133 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception geneve 4 6
1136 test_pmtu_ipv6_br_geneve6_exception() {
1137 test_pmtu_ipvX_over_bridged_vxlanY_or_geneveY_exception geneve 6 6
1140 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception() {
1146 if [ ${outer_family} -eq 4 ]; then
1147 setup namespaces routing ovs_bridge ovs_${type}4 || return 2
1148 # IPv4 header UDP header VXLAN/GENEVE header Ethernet header
1149 exp_mtu=$((${ll_mtu} - 20 - 8 - 8 - 14))
1151 setup namespaces routing ovs_bridge ovs_${type}6 || return 2
1152 # IPv6 header UDP header VXLAN/GENEVE header Ethernet header
1153 exp_mtu=$((${ll_mtu} - 40 - 8 - 8 - 14))
1156 if [ "${type}" = "vxlan" ]; then
1157 tun_a="vxlan_sys_4789"
1158 elif [ "${type}" = "geneve" ]; then
1159 tun_a="genev_sys_6081"
1162 trace "" "${tun_a}" "${ns_b}" ${type}_b \
1163 "" veth_A-R1 "${ns_r1}" veth_R1-A \
1164 "${ns_b}" veth_B-R1 "${ns_r1}" veth_R1-B \
1165 "" ovs_br0 "" veth-A-C \
1168 if [ ${family} -eq 4 ]; then
1170 dst=${tunnel4_b_addr}
1173 dst=${tunnel6_b_addr}
1176 # Create route exception by exceeding link layer MTU
1177 mtu "" veth_A-R1 $((${ll_mtu} + 1000))
1178 mtu "" ovs_br0 $((${ll_mtu} + 1000))
1179 mtu "" veth_A-C $((${ll_mtu} + 1000))
1180 mtu "${ns_c}" veth_C-A $((${ll_mtu} + 1000))
1181 mtu "${ns_r1}" veth_R1-A $((${ll_mtu} + 1000))
1182 mtu "${ns_b}" veth_B-R1 ${ll_mtu}
1183 mtu "${ns_r1}" veth_R1-B ${ll_mtu}
1185 mtu "" ${tun_a} $((${ll_mtu} + 1000))
1186 mtu "${ns_b}" ${type}_b $((${ll_mtu} + 1000))
1188 run_cmd ${ns_c} ${ping} -q -M want -i 0.1 -c 20 -s $((${ll_mtu} + 500)) ${dst} || return 1
1190 # Check that exceptions were created
1191 pmtu="$(route_get_dst_pmtu_from_exception "${ns_c}" ${dst})"
1192 check_pmtu_value ${exp_mtu} "${pmtu}" "exceeding link layer MTU on Open vSwitch ${type} interface"
1195 test_pmtu_ipv4_ovs_vxlan4_exception() {
1196 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception vxlan 4 4
1199 test_pmtu_ipv6_ovs_vxlan4_exception() {
1200 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception vxlan 6 4
1203 test_pmtu_ipv4_ovs_geneve4_exception() {
1204 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception geneve 4 4
1207 test_pmtu_ipv6_ovs_geneve4_exception() {
1208 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception geneve 6 4
1211 test_pmtu_ipv4_ovs_vxlan6_exception() {
1212 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception vxlan 4 6
1215 test_pmtu_ipv6_ovs_vxlan6_exception() {
1216 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception vxlan 6 6
1219 test_pmtu_ipv4_ovs_geneve6_exception() {
1220 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception geneve 4 6
1223 test_pmtu_ipv6_ovs_geneve6_exception() {
1224 test_pmtu_ipvX_over_ovs_vxlanY_or_geneveY_exception geneve 6 6
1227 test_pmtu_ipvX_over_fouY_or_gueY() {
1233 setup namespaces routing ${encap}${outer_family}${inner_family} || return 2
1234 trace "${ns_a}" ${encap}_a "${ns_b}" ${encap}_b \
1235 "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
1236 "${ns_b}" veth_B-R1 "${ns_r1}" veth_R1-B
1238 if [ ${inner_family} -eq 4 ]; then
1240 dst=${tunnel4_b_addr}
1243 dst=${tunnel6_b_addr}
1246 if [ "${encap}" = "gue" ]; then
1252 if [ ${outer_family} -eq 4 ]; then
1253 # IPv4 header UDP header
1254 exp_mtu=$((${ll_mtu} - 20 - 8 - ${encap_overhead}))
1256 # IPv6 header Option 4 UDP header
1257 exp_mtu=$((${ll_mtu} - 40 - 8 - 8 - ${encap_overhead}))
1260 # Create route exception by exceeding link layer MTU
1261 mtu "${ns_a}" veth_A-R1 $((${ll_mtu} + 1000))
1262 mtu "${ns_r1}" veth_R1-A $((${ll_mtu} + 1000))
1263 mtu "${ns_b}" veth_B-R1 ${ll_mtu}
1264 mtu "${ns_r1}" veth_R1-B ${ll_mtu}
1266 mtu "${ns_a}" ${encap}_a $((${ll_mtu} + 1000))
1267 mtu "${ns_b}" ${encap}_b $((${ll_mtu} + 1000))
1268 run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${dst}
1270 # Check that exception was created
1271 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})"
1272 check_pmtu_value ${exp_mtu} "${pmtu}" "exceeding link layer MTU on ${encap} interface"
1275 test_pmtu_ipv4_fou4_exception() {
1276 test_pmtu_ipvX_over_fouY_or_gueY 4 4 fou
1279 test_pmtu_ipv6_fou4_exception() {
1280 test_pmtu_ipvX_over_fouY_or_gueY 6 4 fou
1283 test_pmtu_ipv4_fou6_exception() {
1284 test_pmtu_ipvX_over_fouY_or_gueY 4 6 fou
1287 test_pmtu_ipv6_fou6_exception() {
1288 test_pmtu_ipvX_over_fouY_or_gueY 6 6 fou
1291 test_pmtu_ipv4_gue4_exception() {
1292 test_pmtu_ipvX_over_fouY_or_gueY 4 4 gue
1295 test_pmtu_ipv6_gue4_exception() {
1296 test_pmtu_ipvX_over_fouY_or_gueY 6 4 gue
1299 test_pmtu_ipv4_gue6_exception() {
1300 test_pmtu_ipvX_over_fouY_or_gueY 4 6 gue
1303 test_pmtu_ipv6_gue6_exception() {
1304 test_pmtu_ipvX_over_fouY_or_gueY 6 6 gue
1307 test_pmtu_ipvX_over_ipvY_exception() {
1312 setup namespaces routing ip${inner}ip${outer} || return 2
1314 trace "${ns_a}" ip_a "${ns_b}" ip_b \
1315 "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
1316 "${ns_b}" veth_B-R1 "${ns_r1}" veth_R1-B
1318 if [ ${inner} -eq 4 ]; then
1320 dst=${tunnel4_b_addr}
1323 dst=${tunnel6_b_addr}
1326 if [ ${outer} -eq 4 ]; then
1328 exp_mtu=$((${ll_mtu} - 20))
1330 # IPv6 header Option 4
1331 exp_mtu=$((${ll_mtu} - 40 - 8))
1334 # Create route exception by exceeding link layer MTU
1335 mtu "${ns_a}" veth_A-R1 $((${ll_mtu} + 1000))
1336 mtu "${ns_r1}" veth_R1-A $((${ll_mtu} + 1000))
1337 mtu "${ns_b}" veth_B-R1 ${ll_mtu}
1338 mtu "${ns_r1}" veth_R1-B ${ll_mtu}
1340 mtu "${ns_a}" ip_a $((${ll_mtu} + 1000)) || return
1341 mtu "${ns_b}" ip_b $((${ll_mtu} + 1000)) || return
1342 run_cmd ${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${dst}
1344 # Check that exception was created
1345 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})"
1346 check_pmtu_value ${exp_mtu} "${pmtu}" "exceeding link layer MTU on ip${inner}ip${outer} interface"
1349 test_pmtu_ipv4_ipv4_exception() {
1350 test_pmtu_ipvX_over_ipvY_exception 4 4
1353 test_pmtu_ipv6_ipv4_exception() {
1354 test_pmtu_ipvX_over_ipvY_exception 6 4
1357 test_pmtu_ipv4_ipv6_exception() {
1358 test_pmtu_ipvX_over_ipvY_exception 4 6
1361 test_pmtu_ipv6_ipv6_exception() {
1362 test_pmtu_ipvX_over_ipvY_exception 6 6
1365 test_pmtu_vti4_exception() {
1366 setup namespaces veth vti4 xfrm4 || return 2
1367 trace "${ns_a}" veth_a "${ns_b}" veth_b \
1368 "${ns_a}" vti4_a "${ns_b}" vti4_b
1371 vti_mtu=$((veth_mtu - 20))
1373 # SPI SN IV ICV pad length next header
1374 esp_payload_rfc4106=$((vti_mtu - 4 - 4 - 8 - 16 - 1 - 1))
1375 ping_payload=$((esp_payload_rfc4106 - 28))
1377 mtu "${ns_a}" veth_a ${veth_mtu}
1378 mtu "${ns_b}" veth_b ${veth_mtu}
1379 mtu "${ns_a}" vti4_a ${vti_mtu}
1380 mtu "${ns_b}" vti4_b ${vti_mtu}
1382 # Send DF packet without exceeding link layer MTU, check that no
1383 # exception is created
1384 run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s ${ping_payload} ${tunnel4_b_addr}
1385 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel4_b_addr})"
1386 check_pmtu_value "" "${pmtu}" "sending packet smaller than PMTU (IP payload length ${esp_payload_rfc4106})" || return 1
1388 # Now exceed link layer MTU by one byte, check that exception is created
1389 # with the right PMTU value
1390 run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s $((ping_payload + 1)) ${tunnel4_b_addr}
1391 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel4_b_addr})"
1392 check_pmtu_value "${esp_payload_rfc4106}" "${pmtu}" "exceeding PMTU (IP payload length $((esp_payload_rfc4106 + 1)))"
1395 test_pmtu_vti6_exception() {
1396 setup namespaces veth vti6 xfrm6 || return 2
1397 trace "${ns_a}" veth_a "${ns_b}" veth_b \
1398 "${ns_a}" vti6_a "${ns_b}" vti6_b
1401 # Create route exception by exceeding link layer MTU
1402 mtu "${ns_a}" veth_a 4000
1403 mtu "${ns_b}" veth_b 4000
1404 mtu "${ns_a}" vti6_a 5000
1405 mtu "${ns_b}" vti6_b 5000
1406 run_cmd ${ns_a} ${ping6} -q -i 0.1 -w 1 -s 60000 ${tunnel6_b_addr}
1408 # Check that exception was created
1409 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel6_b_addr})"
1410 check_pmtu_value any "${pmtu}" "creating tunnel exceeding link layer MTU" || return 1
1412 # Decrease tunnel MTU, check for PMTU decrease in route exception
1413 mtu "${ns_a}" vti6_a 3000
1414 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel6_b_addr})"
1415 check_pmtu_value "3000" "${pmtu}" "decreasing tunnel MTU" || fail=1
1417 # Increase tunnel MTU, check for PMTU increase in route exception
1418 mtu "${ns_a}" vti6_a 9000
1419 pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel6_b_addr})"
1420 check_pmtu_value "9000" "${pmtu}" "increasing tunnel MTU" || fail=1
1425 test_pmtu_vti4_default_mtu() {
1426 setup namespaces veth vti4 || return 2
1428 # Check that MTU of vti device is MTU of veth minus IPv4 header length
1429 veth_mtu="$(link_get_mtu "${ns_a}" veth_a)"
1430 vti4_mtu="$(link_get_mtu "${ns_a}" vti4_a)"
1431 if [ $((veth_mtu - vti4_mtu)) -ne 20 ]; then
1432 err " vti MTU ${vti4_mtu} is not veth MTU ${veth_mtu} minus IPv4 header length"
1437 test_pmtu_vti6_default_mtu() {
1438 setup namespaces veth vti6 || return 2
1440 # Check that MTU of vti device is MTU of veth minus IPv6 header length
1441 veth_mtu="$(link_get_mtu "${ns_a}" veth_a)"
1442 vti6_mtu="$(link_get_mtu "${ns_a}" vti6_a)"
1443 if [ $((veth_mtu - vti6_mtu)) -ne 40 ]; then
1444 err " vti MTU ${vti6_mtu} is not veth MTU ${veth_mtu} minus IPv6 header length"
1449 test_pmtu_vti4_link_add_mtu() {
1450 setup namespaces || return 2
1452 run_cmd ${ns_a} ip link add vti4_a type vti local ${veth4_a_addr} remote ${veth4_b_addr} key 10
1453 [ $? -ne 0 ] && err " vti not supported" && return 2
1454 run_cmd ${ns_a} ip link del vti4_a
1460 # Check invalid values first
1461 for v in $((min - 1)) $((max + 1)); do
1462 run_cmd ${ns_a} ip link add vti4_a mtu ${v} type vti local ${veth4_a_addr} remote ${veth4_b_addr} key 10
1463 # This can fail, or MTU can be adjusted to a proper value
1464 [ $? -ne 0 ] && continue
1465 mtu="$(link_get_mtu "${ns_a}" vti4_a)"
1466 if [ ${mtu} -lt ${min} -o ${mtu} -gt ${max} ]; then
1467 err " vti tunnel created with invalid MTU ${mtu}"
1470 run_cmd ${ns_a} ip link del vti4_a
1473 # Now check valid values
1474 for v in ${min} 1300 ${max}; do
1475 run_cmd ${ns_a} ip link add vti4_a mtu ${v} type vti local ${veth4_a_addr} remote ${veth4_b_addr} key 10
1476 mtu="$(link_get_mtu "${ns_a}" vti4_a)"
1477 run_cmd ${ns_a} ip link del vti4_a
1478 if [ "${mtu}" != "${v}" ]; then
1479 err " vti MTU ${mtu} doesn't match configured value ${v}"
1487 test_pmtu_vti6_link_add_mtu() {
1488 setup namespaces || return 2
1490 run_cmd ${ns_a} ip link add vti6_a type vti6 local ${veth6_a_addr} remote ${veth6_b_addr} key 10
1491 [ $? -ne 0 ] && err " vti6 not supported" && return 2
1492 run_cmd ${ns_a} ip link del vti6_a
1496 min=68 # vti6 can carry IPv4 packets too
1498 # Check invalid values first
1499 for v in $((min - 1)) $((max + 1)); do
1500 run_cmd ${ns_a} ip link add vti6_a mtu ${v} type vti6 local ${veth6_a_addr} remote ${veth6_b_addr} key 10
1501 # This can fail, or MTU can be adjusted to a proper value
1502 [ $? -ne 0 ] && continue
1503 mtu="$(link_get_mtu "${ns_a}" vti6_a)"
1504 if [ ${mtu} -lt ${min} -o ${mtu} -gt ${max} ]; then
1505 err " vti6 tunnel created with invalid MTU ${v}"
1508 run_cmd ${ns_a} ip link del vti6_a
1511 # Now check valid values
1512 for v in 68 1280 1300 $((65535 - 40)); do
1513 run_cmd ${ns_a} ip link add vti6_a mtu ${v} type vti6 local ${veth6_a_addr} remote ${veth6_b_addr} key 10
1514 mtu="$(link_get_mtu "${ns_a}" vti6_a)"
1515 run_cmd ${ns_a} ip link del vti6_a
1516 if [ "${mtu}" != "${v}" ]; then
1517 err " vti6 MTU ${mtu} doesn't match configured value ${v}"
1525 test_pmtu_vti6_link_change_mtu() {
1526 setup namespaces || return 2
1528 run_cmd ${ns_a} ip link add dummy0 mtu 1500 type dummy
1529 [ $? -ne 0 ] && err " dummy not supported" && return 2
1530 run_cmd ${ns_a} ip link add dummy1 mtu 3000 type dummy
1531 run_cmd ${ns_a} ip link set dummy0 up
1532 run_cmd ${ns_a} ip link set dummy1 up
1534 run_cmd ${ns_a} ip addr add ${dummy6_0_prefix}1/${dummy6_mask} dev dummy0
1535 run_cmd ${ns_a} ip addr add ${dummy6_1_prefix}1/${dummy6_mask} dev dummy1
1539 # Create vti6 interface bound to device, passing MTU, check it
1540 run_cmd ${ns_a} ip link add vti6_a mtu 1300 type vti6 remote ${dummy6_0_prefix}2 local ${dummy6_0_prefix}1
1541 mtu="$(link_get_mtu "${ns_a}" vti6_a)"
1542 if [ ${mtu} -ne 1300 ]; then
1543 err " vti6 MTU ${mtu} doesn't match configured value 1300"
1547 # Move to another device with different MTU, without passing MTU, check
1549 run_cmd ${ns_a} ip link set vti6_a type vti6 remote ${dummy6_1_prefix}2 local ${dummy6_1_prefix}1
1550 mtu="$(link_get_mtu "${ns_a}" vti6_a)"
1551 if [ ${mtu} -ne $((3000 - 40)) ]; then
1552 err " vti MTU ${mtu} is not dummy MTU 3000 minus IPv6 header length"
1556 # Move it back, passing MTU, check MTU is not overridden
1557 run_cmd ${ns_a} ip link set vti6_a mtu 1280 type vti6 remote ${dummy6_0_prefix}2 local ${dummy6_0_prefix}1
1558 mtu="$(link_get_mtu "${ns_a}" vti6_a)"
1559 if [ ${mtu} -ne 1280 ]; then
1560 err " vti6 MTU ${mtu} doesn't match configured value 1280"
1570 if ! which ${cmd} > /dev/null 2>&1; then
1571 err " missing required command: '${cmd}'"
1577 test_cleanup_vxlanX_exception() {
1582 check_command taskset || return 2
1583 cpu_list=$(grep -m 2 processor /proc/cpuinfo | cut -d ' ' -f 2)
1585 setup namespaces routing ${encap}${outer} || return 2
1586 trace "${ns_a}" ${encap}_a "${ns_b}" ${encap}_b \
1587 "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
1588 "${ns_b}" veth_B-R1 "${ns_r1}" veth_R1-B
1590 # Create route exception by exceeding link layer MTU
1591 mtu "${ns_a}" veth_A-R1 $((${ll_mtu} + 1000))
1592 mtu "${ns_r1}" veth_R1-A $((${ll_mtu} + 1000))
1593 mtu "${ns_b}" veth_B-R1 ${ll_mtu}
1594 mtu "${ns_r1}" veth_R1-B ${ll_mtu}
1596 mtu "${ns_a}" ${encap}_a $((${ll_mtu} + 1000))
1597 mtu "${ns_b}" ${encap}_b $((${ll_mtu} + 1000))
1599 # Fill exception cache for multiple CPUs (2)
1600 # we can always use inner IPv4 for that
1601 for cpu in ${cpu_list}; do
1602 run_cmd taskset --cpu-list ${cpu} ${ns_a} ping -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${tunnel4_b_addr}
1605 ${ns_a} ip link del dev veth_A-R1 &
1608 if [ "$(cat /proc/${iplink_pid}/cmdline 2>/dev/null | tr -d '\0')" = "iplinkdeldevveth_A-R1" ]; then
1609 err " can't delete veth device in a timely manner, PMTU dst likely leaked"
1614 test_cleanup_ipv6_exception() {
1615 test_cleanup_vxlanX_exception 6
1618 test_cleanup_ipv4_exception() {
1619 test_cleanup_vxlanX_exception 4
1629 if [ "$VERBOSE" = "1" ]; then
1630 printf "\n##########################################################################\n\n"
1636 if [ $ret -eq 0 ]; then
1637 printf "TEST: %-60s [ OK ]\n" "${tdesc}"
1638 elif [ $ret -eq 1 ]; then
1639 printf "TEST: %-60s [FAIL]\n" "${tdesc}"
1640 if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
1642 echo "Pausing. Hit enter to continue"
1647 elif [ $ret -eq 2 ]; then
1648 printf "TEST: %-60s [SKIP]\n" "${tdesc}"
1655 [ $ret -ne 0 ] && exitcode=1
1665 run_test "${tname}" "${tdesc} - nexthop objects"
1669 test_list_flush_ipv4_exception() {
1670 setup namespaces routing || return 2
1671 trace "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
1672 "${ns_r1}" veth_R1-B "${ns_b}" veth_B-R1 \
1673 "${ns_a}" veth_A-R2 "${ns_r2}" veth_R2-A \
1674 "${ns_r2}" veth_R2-B "${ns_b}" veth_B-R2
1676 dst_prefix1="${prefix4}.${b_r1}."
1677 dst2="${prefix4}.${b_r2}.1"
1679 # Set up initial MTU values
1680 mtu "${ns_a}" veth_A-R1 2000
1681 mtu "${ns_r1}" veth_R1-A 2000
1682 mtu "${ns_r1}" veth_R1-B 1500
1683 mtu "${ns_b}" veth_B-R1 1500
1685 mtu "${ns_a}" veth_A-R2 2000
1686 mtu "${ns_r2}" veth_R2-A 2000
1687 mtu "${ns_r2}" veth_R2-B 1500
1688 mtu "${ns_b}" veth_B-R2 1500
1692 # Add 100 addresses for veth endpoint on B reached by default A route
1693 for i in $(seq 100 199); do
1694 run_cmd ${ns_b} ip addr add "${dst_prefix1}${i}" dev veth_B-R1
1697 # Create 100 cached route exceptions for path via R1, one via R2. Note
1698 # that with IPv4 we need to actually cause a route lookup that matches
1699 # the exception caused by ICMP, in order to actually have a cached
1700 # route, so we need to ping each destination twice
1701 for i in $(seq 100 199); do
1702 run_cmd ${ns_a} ping -q -M want -i 0.1 -c 2 -s 1800 "${dst_prefix1}${i}"
1704 run_cmd ${ns_a} ping -q -M want -i 0.1 -c 2 -s 1800 "${dst2}"
1706 if [ "$(${ns_a} ip -oneline route list cache | wc -l)" -ne 101 ]; then
1707 err " can't list cached exceptions"
1711 run_cmd ${ns_a} ip route flush cache
1712 pmtu1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst_prefix}1)"
1713 pmtu2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst_prefix}2)"
1714 if [ -n "${pmtu1}" ] || [ -n "${pmtu2}" ] || \
1715 [ -n "$(${ns_a} ip route list cache)" ]; then
1716 err " can't flush cached exceptions"
1723 test_list_flush_ipv6_exception() {
1724 setup namespaces routing || return 2
1725 trace "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
1726 "${ns_r1}" veth_R1-B "${ns_b}" veth_B-R1 \
1727 "${ns_a}" veth_A-R2 "${ns_r2}" veth_R2-A \
1728 "${ns_r2}" veth_R2-B "${ns_b}" veth_B-R2
1730 dst_prefix1="${prefix6}:${b_r1}::"
1731 dst2="${prefix6}:${b_r2}::1"
1733 # Set up initial MTU values
1734 mtu "${ns_a}" veth_A-R1 2000
1735 mtu "${ns_r1}" veth_R1-A 2000
1736 mtu "${ns_r1}" veth_R1-B 1500
1737 mtu "${ns_b}" veth_B-R1 1500
1739 mtu "${ns_a}" veth_A-R2 2000
1740 mtu "${ns_r2}" veth_R2-A 2000
1741 mtu "${ns_r2}" veth_R2-B 1500
1742 mtu "${ns_b}" veth_B-R2 1500
1746 # Add 100 addresses for veth endpoint on B reached by default A route
1747 for i in $(seq 100 199); do
1748 run_cmd ${ns_b} ip addr add "${dst_prefix1}${i}" dev veth_B-R1
1751 # Create 100 cached route exceptions for path via R1, one via R2
1752 for i in $(seq 100 199); do
1753 run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst_prefix1}${i}"
1755 run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst2}"
1756 if [ "$(${ns_a} ip -oneline -6 route list cache | wc -l)" -ne 101 ]; then
1757 err " can't list cached exceptions"
1761 run_cmd ${ns_a} ip -6 route flush cache
1762 pmtu1="$(route_get_dst_pmtu_from_exception "${ns_a}" "${dst_prefix1}100")"
1763 pmtu2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
1764 if [ -n "${pmtu1}" ] || [ -n "${pmtu2}" ] || \
1765 [ -n "$(${ns_a} ip -6 route list cache)" ]; then
1766 err " can't flush cached exceptions"
1775 echo "$0 [OPTIONS] [TEST]..."
1776 echo "If no TEST argument is given, all tests will be run."
1779 echo " --trace: capture traffic to TEST_INTERFACE.pcap"
1781 echo "Available tests${tests}"
1785 ################################################################################
1790 while getopts :ptv o
1793 p) PAUSE_ON_FAIL=yes;;
1795 t) if which tcpdump > /dev/null 2>&1; then
1798 echo "=== tcpdump not available, tracing disabled"
1804 shift $(($OPTIND-1))
1810 # Check first that all requested tests are available before running any
1811 command -v > /dev/null "test_${arg}" || { echo "=== Test ${arg} not found"; usage; }
1820 ip nexthop ls >/dev/null 2>&1
1821 [ $? -eq 0 ] && HAVE_NH=yes
1826 for t in ${tests}; do
1827 [ "${name}" = "" ] && name="${t}" && continue
1828 [ "${desc}" = "" ] && desc="${t}" && continue
1830 if [ "${HAVE_NH}" = "yes" ]; then
1836 [ "${arg}" != "${arg#--*}" ] && continue
1837 [ "${arg}" = "${name}" ] && run_this=1 && break
1840 if [ $run_this -eq 1 ]; then
1841 run_test "${name}" "${desc}"
1842 # if test was skipped no need to retry with nexthop objects
1843 [ $? -eq 2 ] && rerun_nh=0
1845 if [ "${rerun_nh}" = "1" ]; then
1846 run_test_nh "${name}" "${desc}"