2 # SPDX-License-Identifier: GPL-2.0+
4 # Author: Justin Iurman <justin.iurman@uliege.be>
6 # This script evaluates IOAM for IPv6 by checking local IOAM configurations and
7 # IOAM data inside packets. There are three categories of tests: LOCAL, OUTPUT,
8 # and INPUT. The former (LOCAL) checks all IOAM related configurations locally
9 # without sending packets. OUTPUT tests verify the processing of an IOAM
10 # encapsulating node, while INPUT tests verify the processing of an IOAM transit
11 # node. Both OUTPUT and INPUT tests send packets. Each test is documented inside
14 # The topology used for OUTPUT and INPUT tests is made of three nodes:
15 # - Alpha (the IOAM encapsulating node)
16 # - Beta (the IOAM transit node)
17 # - Gamma (the receiver) **
19 # An IOAM domain is configured from Alpha to Beta, but not on the reverse path.
20 # Alpha adds an IOAM option (Pre-allocated Trace) inside a Hop-by-hop.
22 # ** Gamma is required because ioam6_parser.c uses a packet socket and we need
23 # to see IOAM data inserted by the very last node (Beta), which would happen
24 # _after_ we get a copy of the packet on Beta. Note that using an
25 # IPv6 raw socket with IPV6_RECVHOPOPTS on Beta would not be enough: we also
26 # need to access the IPv6 header to check some fields (e.g., source and
27 # destination addresses), which is not possible in that case. As a
28 # consequence, we need Gamma as a receiver to run ioam6_parser.c which uses a
32 # +-----------------------+ +-----------------------+
34 # | Alpha netns | | Gamma netns |
36 # | +-------------------+ | | +-------------------+ |
37 # | | veth0 | | | | veth0 | |
38 # | | 2001:db8:1::2/64 | | | | 2001:db8:2::2/64 | |
39 # | +-------------------+ | | +-------------------+ |
41 # +-----------.-----------+ +-----------.-----------+
45 # +-----------.----------------------------------.-----------+
47 # | +-------------------+ +-------------------+ |
48 # | | veth0 | | veth1 | |
49 # | | 2001:db8:1::1/64 | ............ | 2001:db8:2::1/64 | |
50 # | +-------------------+ +-------------------+ |
54 # +----------------------------------------------------------+
58 # +==========================================================+
59 # | Alpha - IOAM configuration |
60 # +=====================+====================================+
62 # +---------------------+------------------------------------+
63 # | Node Wide ID | 11111111 |
64 # +---------------------+------------------------------------+
65 # | Ingress ID | 0xffff (default value) |
66 # +---------------------+------------------------------------+
67 # | Ingress Wide ID | 0xffffffff (default value) |
68 # +---------------------+------------------------------------+
70 # +---------------------+------------------------------------+
71 # | Egress Wide ID | 101101 |
72 # +---------------------+------------------------------------+
73 # | Namespace Data | 0xdeadbeef |
74 # +---------------------+------------------------------------+
75 # | Namespace Wide Data | 0xcafec0caf00dc0de |
76 # +---------------------+------------------------------------+
78 # +---------------------+------------------------------------+
79 # | Schema Data | something that will be 4n-aligned |
80 # +---------------------+------------------------------------+
83 # +==========================================================+
84 # | Beta - IOAM configuration |
85 # +=====================+====================================+
87 # +---------------------+------------------------------------+
88 # | Node Wide ID | 22222222 |
89 # +---------------------+------------------------------------+
90 # | Ingress ID | 201 |
91 # +---------------------+------------------------------------+
92 # | Ingress Wide ID | 201201 |
93 # +---------------------+------------------------------------+
95 # +---------------------+------------------------------------+
96 # | Egress Wide ID | 202202 |
97 # +---------------------+------------------------------------+
98 # | Namespace Data | 0xffffffff (default value) |
99 # +---------------------+------------------------------------+
100 # | Namespace Wide Data | 0xffffffffffffffff (default value) |
101 # +---------------------+------------------------------------+
102 # | Schema ID | 0xffffff (= None) |
103 # +---------------------+------------------------------------+
105 # +---------------------+------------------------------------+
109 ################################################################################
111 # WARNING: Be careful if you modify the block below - it MUST be kept #
112 # synchronized with configurations inside ioam6_parser.c and always #
113 # reflect the same. #
115 ################################################################################
120 0xffff # Ingress ID (default value)
121 0xffffffff # Ingress Wide ID (default value)
123 101101 # Egress Wide ID
124 0xdeadbeef # Namespace Data
125 0xcafec0caf00dc0de # Namespace Wide Data
127 "something that will be 4n-aligned" # Schema Data
134 201201 # Ingress Wide ID
136 202202 # Egress Wide ID
137 0xffffffff # Namespace Data (empty value)
138 0xffffffffffffffff # Namespace Wide Data (empty value)
139 0xffffff # Schema ID (empty value)
140 "" # Schema Data (empty value)
145 local_sysctl_ioam_id_wide
146 local_sysctl_ioam_intf_id
147 local_sysctl_ioam_intf_id_wide
148 local_sysctl_ioam_intf_enabled
151 local_ioam_schema_namespace
155 local_route_trace_type
156 local_route_trace_size
157 local_route_trace_type_bits
158 local_route_trace_size_values
167 output_full_supp_trace
178 input_full_supp_trace
181 ################################################################################
185 ################################################################################
187 check_kernel_compatibility
()
189 setup_ns ioam_tmp_node
&>/dev
/null
192 ip link add name veth0 netns
$ioam_tmp_node type veth \
193 peer name veth1 netns
$ioam_tmp_node &>/dev
/null
196 ip
-netns $ioam_tmp_node link
set veth0 up
&>/dev
/null
199 ip
-netns $ioam_tmp_node link
set veth1 up
&>/dev
/null
204 echo "SKIP: Setup failed."
205 cleanup_ns
$ioam_tmp_node
209 ip
-netns $ioam_tmp_node route add
2001:db8
:2::/64 \
210 encap ioam6 trace prealloc
type 0x800000 ns
0 size
4 dev veth0
&>/dev
/null
213 ip
-netns $ioam_tmp_node -6 route
2>/dev
/null |
grep -q "encap ioam6"
218 echo "SKIP: Cannot attach an IOAM trace to a route. Was your kernel" \
219 "compiled without CONFIG_IPV6_IOAM6_LWTUNNEL? Are you running an" \
220 "old kernel? Are you using an old version of iproute2?"
221 cleanup_ns
$ioam_tmp_node
225 cleanup_ns
$ioam_tmp_node
227 lsmod
2>/dev
/null |
grep -q "ip6_tunnel"
230 if [ $ip6tnl_loaded == 0 ]
234 modprobe ip6_tunnel
&>/dev
/null
235 lsmod
2>/dev
/null |
grep -q "ip6_tunnel"
238 if [ $encap_tests != 0 ]
240 ip a
2>/dev
/null |
grep -q "ip6tnl0"
243 if [ $encap_tests != 0 ]
245 echo "Note: ip6_tunnel not found neither as a module nor inside the" \
246 "kernel. Any tests that require it will be skipped."
254 cleanup_ns
$ioam_node_alpha $ioam_node_beta $ioam_node_gamma
256 if [ $ip6tnl_loaded != 0 ]
258 modprobe
-r ip6_tunnel
&>/dev
/null
264 setup_ns ioam_node_alpha ioam_node_beta ioam_node_gamma
&>/dev
/null
266 ip link add name ioam-veth-alpha netns
$ioam_node_alpha type veth \
267 peer name ioam-veth-betaL netns
$ioam_node_beta &>/dev
/null
268 ip link add name ioam-veth-betaR netns
$ioam_node_beta type veth \
269 peer name ioam-veth-gamma netns
$ioam_node_gamma &>/dev
/null
271 ip
-netns $ioam_node_alpha link
set ioam-veth-alpha name veth0
&>/dev
/null
272 ip
-netns $ioam_node_beta link
set ioam-veth-betaL name veth0
&>/dev
/null
273 ip
-netns $ioam_node_beta link
set ioam-veth-betaR name veth1
&>/dev
/null
274 ip
-netns $ioam_node_gamma link
set ioam-veth-gamma name veth0
&>/dev
/null
276 ip
-netns $ioam_node_alpha addr add
2001:db8
:1::50/64 dev veth0
&>/dev
/null
277 ip
-netns $ioam_node_alpha addr add
2001:db8
:1::2/64 dev veth0
&>/dev
/null
278 ip
-netns $ioam_node_alpha link
set veth0 up
&>/dev
/null
279 ip
-netns $ioam_node_alpha link
set lo up
&>/dev
/null
280 ip
-netns $ioam_node_alpha route add
2001:db8
:2::/64 \
281 via
2001:db8
:1::1 dev veth0
&>/dev
/null
283 ip
-netns $ioam_node_beta addr add
2001:db8
:1::1/64 dev veth0
&>/dev
/null
284 ip
-netns $ioam_node_beta addr add
2001:db8
:2::1/64 dev veth1
&>/dev
/null
285 ip
-netns $ioam_node_beta link
set veth0 up
&>/dev
/null
286 ip
-netns $ioam_node_beta link
set veth1 up
&>/dev
/null
287 ip
-netns $ioam_node_beta link
set lo up
&>/dev
/null
289 ip
-netns $ioam_node_gamma addr add
2001:db8
:2::2/64 dev veth0
&>/dev
/null
290 ip
-netns $ioam_node_gamma link
set veth0 up
&>/dev
/null
291 ip
-netns $ioam_node_gamma link
set lo up
&>/dev
/null
292 ip
-netns $ioam_node_gamma route add
2001:db8
:1::/64 \
293 via
2001:db8
:2::1 dev veth0
&>/dev
/null
295 # - Alpha: IOAM config -
296 ip netns
exec $ioam_node_alpha \
297 sysctl
-wq net.ipv6.ioam6_id
=${ALPHA[0]} &>/dev
/null
298 ip netns
exec $ioam_node_alpha \
299 sysctl
-wq net.ipv6.ioam6_id_wide
=${ALPHA[1]} &>/dev
/null
300 ip netns
exec $ioam_node_alpha \
301 sysctl
-wq net.ipv6.conf.veth0.ioam6_id
=${ALPHA[4]} &>/dev
/null
302 ip netns
exec $ioam_node_alpha \
303 sysctl
-wq net.ipv6.conf.veth0.ioam6_id_wide
=${ALPHA[5]} &>/dev
/null
304 ip
-netns $ioam_node_alpha \
305 ioam namespace add
123 data
${ALPHA[6]} wide
${ALPHA[7]} &>/dev
/null
306 ip
-netns $ioam_node_alpha \
307 ioam schema add
${ALPHA[8]} "${ALPHA[9]}" &>/dev
/null
308 ip
-netns $ioam_node_alpha \
309 ioam namespace
set 123 schema
${ALPHA[8]} &>/dev
/null
311 # - Beta: IOAM config -
312 ip netns
exec $ioam_node_beta \
313 sysctl
-wq net.ipv6.conf.all.forwarding
=1 &>/dev
/null
314 ip netns
exec $ioam_node_beta \
315 sysctl
-wq net.ipv6.ioam6_id
=${BETA[0]} &>/dev
/null
316 ip netns
exec $ioam_node_beta \
317 sysctl
-wq net.ipv6.ioam6_id_wide
=${BETA[1]} &>/dev
/null
318 ip netns
exec $ioam_node_beta \
319 sysctl
-wq net.ipv6.conf.veth0.ioam6_enabled
=1 &>/dev
/null
320 ip netns
exec $ioam_node_beta \
321 sysctl
-wq net.ipv6.conf.veth0.ioam6_id
=${BETA[2]} &>/dev
/null
322 ip netns
exec $ioam_node_beta \
323 sysctl
-wq net.ipv6.conf.veth0.ioam6_id_wide
=${BETA[3]} &>/dev
/null
324 ip netns
exec $ioam_node_beta \
325 sysctl
-wq net.ipv6.conf.veth1.ioam6_id
=${BETA[4]} &>/dev
/null
326 ip netns
exec $ioam_node_beta \
327 sysctl
-wq net.ipv6.conf.veth1.ioam6_id_wide
=${BETA[5]} &>/dev
/null
328 ip
-netns $ioam_node_beta ioam namespace add
123 &>/dev
/null
332 ip netns
exec $ioam_node_alpha ping6
-c 5 -W 1 2001:db8
:2::2 &>/dev
/null
335 echo "SKIP: Setup failed."
343 printf " - TEST: %-57s [ OK ]\n" "$1"
344 npassed
=$
((npassed
+1))
349 printf " - TEST: %-57s [SKIP]\n" "$1"
350 nskipped
=$
((nskipped
+1))
355 printf " - TEST: %-57s [FAIL]\n" "$1"
356 nfailed
=$
((nfailed
+1))
369 ip netns
exec $ioam_node_gamma \
370 .
/ioam6_parser veth0
$name $ip6_src 2001:db8
:2::2 \
371 $trace_type $trace_size $ioam_ns $type &
375 ip netns
exec $ioam_node_alpha ping6
-t 64 -c 1 -W 1 2001:db8
:2::2 &>/dev
/null
378 log_test_failed
"${desc}"
379 kill -2 $spid &>/dev
/null
382 [ $?
== 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
392 printf "%0.s-" {1.
.72}
395 printf "| %-28s LOCAL tests %-29s |"
398 printf "%0.s-" {1.
.72}
404 for test in $TESTS_LOCAL
411 for test in $TESTS_LOCAL
418 for test in $TESTS_LOCAL
425 printf "%0.s-" {1.
.72}
428 printf "| %-28s OUTPUT tests %-28s |"
431 printf "%0.s-" {1.
.72}
435 # set OUTPUT settings
436 ip netns
exec $ioam_node_beta \
437 sysctl
-wq net.ipv6.conf.veth0.ioam6_enabled
=0 &>/dev
/null
441 for test in $TESTS_OUTPUT
448 for test in $TESTS_OUTPUT
454 echo "Encap mode (with tunsrc)"
455 for test in $TESTS_OUTPUT
457 $test "encap" "tunsrc"
460 # clean OUTPUT settings
461 ip netns
exec $ioam_node_beta \
462 sysctl
-wq net.ipv6.conf.veth0.ioam6_enabled
=1 &>/dev
/null
466 printf "%0.s-" {1.
.72}
469 printf "| %-28s INPUT tests %-29s |"
472 printf "%0.s-" {1.
.72}
477 ip
-netns $ioam_node_alpha ioam namespace del
123 &>/dev
/null
481 for test in $TESTS_INPUT
488 for test in $TESTS_INPUT
493 # clean INPUT settings
494 ip
-netns $ioam_node_alpha \
495 ioam namespace add
123 data
${ALPHA[6]} wide
${ALPHA[7]} &>/dev
/null
496 ip
-netns $ioam_node_alpha \
497 ioam namespace
set 123 schema
${ALPHA[8]} &>/dev
/null
501 printf "%0.s-" {1.
.72}
504 printf "| %-30s Results %-31s |"
507 printf "%0.s-" {1.
.72}
512 echo "- Passed: ${npassed}"
513 echo "- Skipped: ${nskipped}"
514 echo "- Failed: ${nfailed}"
519 0x800000 0x400000 0x200000 0x100000 0x080000 0x040000 0x020000 0x010000
520 0x008000 0x004000 0x002000 0x001000 0x000800 0x000400 0x000200 0x000100
521 0x000080 0x000040 0x000020 0x000010 0x000008 0x000004 0x000002 0x000001
523 bit2size
=( 4 4 4 4 4 4 4 4 8 8 8 4 4 4 4 4 4 4 4 4 4 4 4 0 )
526 ################################################################################
530 ################################################################################
532 local_sysctl_ioam_id
()
534 ##############################################################################
535 # Make sure the sysctl "net.ipv6.ioam6_id" works as expected. #
536 ##############################################################################
537 local desc
="Sysctl net.ipv6.ioam6_id"
539 [ ! -z $1 ] && return
541 ip netns
exec $ioam_node_alpha \
542 sysctl net.ipv6.ioam6_id
2>/dev
/null |
grep -wq ${ALPHA[0]}
544 [ $?
== 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
547 local_sysctl_ioam_id_wide
()
549 ##############################################################################
550 # Make sure the sysctl "net.ipv6.ioam6_id_wide" works as expected. #
551 ##############################################################################
552 local desc
="Sysctl net.ipv6.ioam6_id_wide"
554 [ ! -z $1 ] && return
556 ip netns
exec $ioam_node_alpha \
557 sysctl net.ipv6.ioam6_id_wide
2>/dev
/null |
grep -wq ${ALPHA[1]}
559 [ $?
== 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
562 local_sysctl_ioam_intf_id
()
564 ##############################################################################
565 # Make sure the sysctl "net.ipv6.conf.XX.ioam6_id" works as expected. #
566 ##############################################################################
567 local desc
="Sysctl net.ipv6.conf.XX.ioam6_id"
569 [ ! -z $1 ] && return
571 ip netns
exec $ioam_node_alpha \
572 sysctl net.ipv6.conf.veth0.ioam6_id
2>/dev
/null |
grep -wq ${ALPHA[4]}
574 [ $?
== 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
577 local_sysctl_ioam_intf_id_wide
()
579 ##############################################################################
580 # Make sure the sysctl "net.ipv6.conf.XX.ioam6_id_wide" works as expected. #
581 ##############################################################################
582 local desc
="Sysctl net.ipv6.conf.XX.ioam6_id_wide"
584 [ ! -z $1 ] && return
586 ip netns
exec $ioam_node_alpha \
587 sysctl net.ipv6.conf.veth0.ioam6_id_wide
2>/dev
/null |
grep -wq ${ALPHA[5]}
589 [ $?
== 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
592 local_sysctl_ioam_intf_enabled
()
594 ##############################################################################
595 # Make sure the sysctl "net.ipv6.conf.XX.ioam6_enabled" works as expected. #
596 ##############################################################################
597 local desc
="Sysctl net.ipv6.conf.XX.ioam6_enabled"
599 [ ! -z $1 ] && return
601 ip netns
exec $ioam_node_beta \
602 sysctl net.ipv6.conf.veth0.ioam6_enabled
2>/dev
/null |
grep -wq 1
604 [ $?
== 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
607 local_ioam_namespace
()
609 ##############################################################################
610 # Make sure the creation of an IOAM Namespace works as expected. #
611 ##############################################################################
612 local desc
="Create an IOAM Namespace"
614 [ ! -z $1 ] && return
616 ip
-netns $ioam_node_alpha \
617 ioam namespace show
2>/dev
/null |
grep -wq 123
620 ip
-netns $ioam_node_alpha \
621 ioam namespace show
2>/dev
/null |
grep -wq ${ALPHA[6]}
624 ip
-netns $ioam_node_alpha \
625 ioam namespace show
2>/dev
/null |
grep -wq ${ALPHA[7]}
628 [ $ret == 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
633 ##############################################################################
634 # Make sure the creation of an IOAM Schema works as expected. #
635 ##############################################################################
636 local desc
="Create an IOAM Schema"
638 [ ! -z $1 ] && return
640 ip
-netns $ioam_node_alpha \
641 ioam schema show
2>/dev
/null |
grep -wq ${ALPHA[8]}
645 for i
in `seq 0 $((${#ALPHA[9]}-1))`
648 printf "%x " "'${chr}"
652 ip
-netns $ioam_node_alpha \
653 ioam schema show
2>/dev
/null |
grep -q "$sc_data"
656 [ $ret == 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
659 local_ioam_schema_namespace
()
661 ##############################################################################
662 # Make sure the binding of a Schema to a Namespace works as expected. #
663 ##############################################################################
664 local desc
="Bind an IOAM Schema to an IOAM Namespace"
666 [ ! -z $1 ] && return
668 ip
-netns $ioam_node_alpha \
669 ioam namespace show
2>/dev
/null |
grep -wq ${ALPHA[8]}
672 ip
-netns $ioam_node_alpha \
673 ioam schema show
2>/dev
/null |
grep -wq 123
676 [ $ret == 0 ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
681 ##############################################################################
682 # Make sure the Namespace-ID is always provided, whatever the mode. #
683 ##############################################################################
684 local desc
="Mandatory Namespace-ID"
689 [ "$1" == "encap" ] && mode
="$1 tundst 2001:db8:2::2" || mode
="$1"
691 ip
-netns $ioam_node_alpha \
692 route change
2001:db8
:2::/64 \
693 encap ioam6 mode
$mode trace prealloc
type 0x800000 size
4 \
694 via
2001:db8
:1::1 dev veth0
&>/dev
/null
697 ip
-netns $ioam_node_alpha \
698 route change
2001:db8
:2::/64 \
699 encap ioam6 mode
$mode trace prealloc
type 0x800000 ns
0 size
4 \
700 via
2001:db8
:1::1 dev veth0
&>/dev
/null
703 [[ $ret1 == 0 ||
$ret2 != 0 ]] && log_test_failed
"${desc}" \
704 || log_test_passed
"${desc}"
706 ip
-netns $ioam_node_alpha \
707 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
712 ##############################################################################
713 # Make sure the Tunnel Source is only (and possibly) used with encap mode. #
714 ##############################################################################
721 if [ "$1" == "encap" ]
723 desc
="Optional Tunnel Source"
724 mode
="$1 tundst 2001:db8:2::2"
725 mode_tunsrc
="$1 tunsrc 2001:db8:1::50 tundst 2001:db8:2::2"
727 desc
="Unneeded Tunnel Source"
729 mode_tunsrc
="$1 tunsrc 2001:db8:1::50"
732 ip
-netns $ioam_node_alpha \
733 route change
2001:db8
:2::/64 \
734 encap ioam6 mode
$mode trace prealloc
type 0x800000 ns
0 size
4 \
735 via
2001:db8
:1::1 dev veth0
&>/dev
/null
738 ip
-netns $ioam_node_alpha \
739 route change
2001:db8
:2::/64 \
740 encap ioam6 mode
$mode_tunsrc trace prealloc
type 0x800000 ns
0 size
4 \
741 via
2001:db8
:1::1 dev veth0
&>/dev
/null
744 if [ "$1" == "encap" ]
746 [[ $ret1 != 0 ||
$ret2 != 0 ]] && log_test_failed
"${desc}" \
747 || log_test_passed
"${desc}"
749 [[ $ret1 != 0 ||
$ret2 == 0 ]] && log_test_failed
"${desc}" \
750 || log_test_passed
"${desc}"
753 ip
-netns $ioam_node_alpha \
754 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
759 ##############################################################################
760 # Make sure the Tunnel Destination is only (and always) used with encap mode.#
761 ##############################################################################
766 [ "$1" == "encap" ] && desc
="Mandatory Tunnel Destination" \
767 || desc
="Unneeded Tunnel Destination"
770 local mode_tundst
="$1 tundst 2001:db8:2::2"
772 ip
-netns $ioam_node_alpha \
773 route change
2001:db8
:2::/64 \
774 encap ioam6 mode
$mode trace prealloc
type 0x800000 ns
0 size
4 \
775 via
2001:db8
:1::1 dev veth0
&>/dev
/null
778 ip
-netns $ioam_node_alpha \
779 route change
2001:db8
:2::/64 \
780 encap ioam6 mode
$mode_tundst trace prealloc
type 0x800000 ns
0 size
4 \
781 via
2001:db8
:1::1 dev veth0
&>/dev
/null
784 if [ "$1" == "encap" ]
786 [[ $ret1 == 0 ||
$ret2 != 0 ]] && log_test_failed
"${desc}" \
787 || log_test_passed
"${desc}"
789 [[ $ret1 != 0 ||
$ret2 == 0 ]] && log_test_failed
"${desc}" \
790 || log_test_passed
"${desc}"
793 ip
-netns $ioam_node_alpha \
794 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
797 local_route_trace_type
()
799 ##############################################################################
800 # Make sure the Trace Type is always provided, whatever the mode. #
801 ##############################################################################
802 local desc
="Mandatory Trace Type"
807 [ "$1" == "encap" ] && mode
="$1 tundst 2001:db8:2::2" || mode
="$1"
809 ip
-netns $ioam_node_alpha \
810 route change
2001:db8
:2::/64 \
811 encap ioam6 mode
$mode trace prealloc ns
0 size
4 \
812 via
2001:db8
:1::1 dev veth0
&>/dev
/null
815 ip
-netns $ioam_node_alpha \
816 route change
2001:db8
:2::/64 \
817 encap ioam6 mode
$mode trace prealloc
type 0x800000 ns
0 size
4 \
818 via
2001:db8
:1::1 dev veth0
&>/dev
/null
821 [[ $ret1 == 0 ||
$ret2 != 0 ]] && log_test_failed
"${desc}" \
822 || log_test_passed
"${desc}"
824 ip
-netns $ioam_node_alpha \
825 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
828 local_route_trace_size
()
830 ##############################################################################
831 # Make sure the Trace Size is always provided, whatever the mode. #
832 ##############################################################################
833 local desc
="Mandatory Trace Size"
838 [ "$1" == "encap" ] && mode
="$1 tundst 2001:db8:2::2" || mode
="$1"
840 ip
-netns $ioam_node_alpha \
841 route change
2001:db8
:2::/64 \
842 encap ioam6 mode
$mode trace prealloc
type 0x800000 ns
0 \
843 via
2001:db8
:1::1 dev veth0
&>/dev
/null
846 ip
-netns $ioam_node_alpha \
847 route change
2001:db8
:2::/64 \
848 encap ioam6 mode
$mode trace prealloc
type 0x800000 ns
0 size
4 \
849 via
2001:db8
:1::1 dev veth0
&>/dev
/null
852 [[ $ret1 == 0 ||
$ret2 != 0 ]] && log_test_failed
"${desc}" \
853 || log_test_passed
"${desc}"
855 ip
-netns $ioam_node_alpha \
856 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
859 local_route_trace_type_bits
()
861 ##############################################################################
862 # Make sure only allowed bits (0-11 and 22) are accepted. #
863 ##############################################################################
864 local desc
="Trace Type bits"
869 [ "$1" == "encap" ] && mode
="$1 tundst 2001:db8:2::2" || mode
="$1"
874 ip
-netns $ioam_node_alpha \
875 route change
2001:db8
:2::/64 \
876 encap ioam6 mode
$mode trace prealloc
type ${bit2type[$i]} ns
0 size
4 \
877 via
2001:db8
:1::1 dev veth0
&>/dev
/null
879 if [[ ($?
== 0 && (($i -ge 12 && $i -le 21) ||
$i == 23)) ||
880 ($?
!= 0 && (($i -ge 0 && $i -le 11) ||
$i == 22)) ]]
887 [ -z $err ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
889 ip
-netns $ioam_node_alpha \
890 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
893 local_route_trace_size_values
()
895 ##############################################################################
896 # Make sure only allowed sizes (multiples of four in [4,244]) are accepted. #
897 ##############################################################################
898 local desc
="Trace Size values"
903 [ "$1" == "encap" ] && mode
="$1 tundst 2001:db8:2::2" || mode
="$1"
905 # we also try the next multiple of four after the MAX to check it's refused
909 ip
-netns $ioam_node_alpha \
910 route change
2001:db8
:2::/64 \
911 encap ioam6 mode
$mode trace prealloc
type 0x800000 ns
0 size
$i \
912 via
2001:db8
:1::1 dev veth0
&>/dev
/null
914 if [[ ($?
== 0 && ($i == 0 ||
$i == 248 || $
(( $i % 4 )) != 0)) ||
915 ($?
!= 0 && $i != 0 && $i != 248 && $
(( $i % 4 )) == 0) ]]
922 [ -z $err ] && log_test_passed
"${desc}" || log_test_failed
"${desc}"
924 ip
-netns $ioam_node_alpha \
925 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
929 ################################################################################
933 ################################################################################
937 ##############################################################################
938 # Make sure an IOAM encapsulating node does NOT fill the trace when the #
939 # corresponding IOAM Namespace-ID is not configured locally. #
940 ##############################################################################
941 local desc
="Unknown IOAM Namespace-ID"
943 local tr_type
=0x800000
946 local saddr
="2001:db8:1::2"
948 if [ "$1" == "encap" ]
950 if [ $encap_tests != 0 ]
952 log_test_skipped
"${desc}"
956 if [ "$2" == "tunsrc" ]
958 saddr
="2001:db8:1::50"
959 mode
+=" tunsrc 2001:db8:1::50"
962 mode
+=" tundst 2001:db8:2::2"
963 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
966 ip
-netns $ioam_node_alpha \
967 route change
2001:db8
:2::/64 \
968 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
969 via
2001:db8
:1::1 dev veth0
&>/dev
/null
973 run_test
${FUNCNAME[0]} "${desc}" $saddr $tr_type $tr_size $ns $1
975 log_test_failed
"${desc}"
978 ip
-netns $ioam_node_alpha \
979 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
981 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
982 link
set ip6tnl0 down
&>/dev
/null
987 ##############################################################################
988 # Make sure an IOAM encapsulating node does NOT fill the trace AND sets the #
989 # Overflow flag when there is not enough room for its data. #
990 ##############################################################################
991 local desc
="Missing room for data"
993 local tr_type
=0xc00000
996 local saddr
="2001:db8:1::2"
998 if [ "$1" == "encap" ]
1000 if [ $encap_tests != 0 ]
1002 log_test_skipped
"${desc}"
1006 if [ "$2" == "tunsrc" ]
1008 saddr
="2001:db8:1::50"
1009 mode
+=" tunsrc 2001:db8:1::50"
1012 mode
+=" tundst 2001:db8:2::2"
1013 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1016 ip
-netns $ioam_node_alpha \
1017 route change
2001:db8
:2::/64 \
1018 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1019 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1023 run_test
${FUNCNAME[0]} "${desc}" $saddr $tr_type $tr_size $ns $1
1025 log_test_failed
"${desc}"
1028 ip
-netns $ioam_node_alpha \
1029 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1031 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1032 link
set ip6tnl0 down
&>/dev
/null
1035 output_no_room_oss
()
1037 ##############################################################################
1038 # Make sure an IOAM encapsulating node does NOT fill the trace AND sets the #
1039 # Overflow flag when there is not enough room for the Opaque State Snapshot. #
1040 ##############################################################################
1041 local desc
="Missing room for Opaque State Snapshot"
1043 local tr_type
=0x000002
1046 local saddr
="2001:db8:1::2"
1048 if [ "$1" == "encap" ]
1050 if [ $encap_tests != 0 ]
1052 log_test_skipped
"${desc}"
1056 if [ "$2" == "tunsrc" ]
1058 saddr
="2001:db8:1::50"
1059 mode
+=" tunsrc 2001:db8:1::50"
1062 mode
+=" tundst 2001:db8:2::2"
1063 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1066 ip
-netns $ioam_node_alpha \
1067 route change
2001:db8
:2::/64 \
1068 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1069 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1073 run_test
${FUNCNAME[0]} "${desc}" $saddr $tr_type $tr_size $ns $1
1075 log_test_failed
"${desc}"
1078 ip
-netns $ioam_node_alpha \
1079 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1081 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1082 link
set ip6tnl0 down
&>/dev
/null
1087 ##############################################################################
1088 # Make sure an IOAM encapsulating node implements all supported bits by #
1089 # checking it correctly fills the trace with its data. #
1090 ##############################################################################
1091 local desc
="Trace Type with supported bit <n> only"
1094 local saddr
="2001:db8:1::2"
1096 if [ "$1" == "encap" ]
1098 if [ "$2" == "tunsrc" ]
1100 saddr
="2001:db8:1::50"
1101 mode
+=" tunsrc 2001:db8:1::50"
1104 mode
+=" tundst 2001:db8:2::2"
1105 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1108 local tmp
=${bit2size[22]}
1109 bit2size
[22]=$
(( $tmp + ${#ALPHA[9]} + ((4 - (${#ALPHA[9]} % 4)) % 4) ))
1112 for i
in {0.
.11} {22.
.22}
1114 local descr
="${desc/<n>/$i}"
1116 if [[ "$1" == "encap" && $encap_tests != 0 ]]
1118 log_test_skipped
"${descr}"
1122 ip
-netns $ioam_node_alpha \
1123 route change
2001:db8
:2::/64 \
1124 encap ioam6 mode
$mode trace prealloc \
1125 type ${bit2type[$i]} ns
$ns size
${bit2size[$i]} \
1126 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1130 run_test
"output_bit$i" "${descr}" $saddr \
1131 ${bit2type[$i]} ${bit2size[$i]} $ns $1
1133 log_test_failed
"${descr}"
1137 ip
-netns $ioam_node_alpha \
1138 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1140 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1141 link
set ip6tnl0 down
&>/dev
/null
1148 ##############################################################################
1149 # Make sure an IOAM encapsulating node allocates supported sizes correctly. #
1150 ##############################################################################
1151 local desc
="Trace Size of <n> bytes"
1153 local tr_type
=0x800000
1155 local saddr
="2001:db8:1::2"
1157 if [ "$1" == "encap" ]
1159 if [ "$2" == "tunsrc" ]
1161 saddr
="2001:db8:1::50"
1162 mode
+=" tunsrc 2001:db8:1::50"
1165 mode
+=" tundst 2001:db8:2::2"
1166 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1170 for i
in $
(seq 4 4 244)
1172 local descr
="${desc/<n>/$i}"
1174 if [[ "$1" == "encap" && $encap_tests != 0 ]]
1176 log_test_skipped
"${descr}"
1180 ip
-netns $ioam_node_alpha \
1181 route change
2001:db8
:2::/64 \
1182 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$i \
1183 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1187 run_test
"output_size$i" "${descr}" $saddr $tr_type $i $ns $1
1189 log_test_failed
"${descr}"
1193 ip
-netns $ioam_node_alpha \
1194 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1196 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1197 link
set ip6tnl0 down
&>/dev
/null
1200 output_full_supp_trace
()
1202 ##############################################################################
1203 # Make sure an IOAM encapsulating node correctly fills a trace when all #
1204 # supported bits are set. #
1205 ##############################################################################
1206 local desc
="Full supported trace"
1208 local tr_type
=0xfff002
1211 local saddr
="2001:db8:1::2"
1213 if [ "$1" == "encap" ]
1215 if [ $encap_tests != 0 ]
1217 log_test_skipped
"${desc}"
1221 if [ "$2" == "tunsrc" ]
1223 saddr
="2001:db8:1::50"
1224 mode
+=" tunsrc 2001:db8:1::50"
1227 mode
+=" tundst 2001:db8:2::2"
1228 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1232 tr_size
=$
(( ${#ALPHA[9]} + ((4 - (${#ALPHA[9]} % 4)) % 4) ))
1233 for i
in {0.
.11} {22.
.22}
1235 tr_size
=$
((tr_size
+ bit2size
[$i]))
1238 ip
-netns $ioam_node_alpha \
1239 route change
2001:db8
:2::/64 \
1240 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1241 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1245 run_test
${FUNCNAME[0]} "${desc}" $saddr $tr_type $tr_size $ns $1
1247 log_test_failed
"${desc}"
1250 ip
-netns $ioam_node_alpha \
1251 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1253 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1254 link
set ip6tnl0 down
&>/dev
/null
1258 ################################################################################
1262 ################################################################################
1266 ##############################################################################
1267 # Make sure an IOAM node does NOT fill the trace when the corresponding IOAM #
1268 # Namespace-ID is not configured locally. #
1269 ##############################################################################
1270 local desc
="Unknown IOAM Namespace-ID"
1272 local tr_type
=0x800000
1276 if [ "$1" == "encap" ]
1278 if [ $encap_tests != 0 ]
1280 log_test_skipped
"${desc}"
1284 mode
+=" tundst 2001:db8:2::2"
1285 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1288 ip
-netns $ioam_node_alpha \
1289 route change
2001:db8
:2::/64 \
1290 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1291 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1295 run_test
${FUNCNAME[0]} "${desc}" 2001:db8
:1::2 $tr_type $tr_size $ns $1
1297 log_test_failed
"${desc}"
1300 ip
-netns $ioam_node_alpha \
1301 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1303 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1304 link
set ip6tnl0 down
&>/dev
/null
1309 ##############################################################################
1310 # Make sure an IOAM node does NOT fill the trace AND sets the Overflow flag #
1311 # when there is not enough room for its data. #
1312 ##############################################################################
1313 local desc
="Missing room for data"
1315 local tr_type
=0xc00000
1319 if [ "$1" == "encap" ]
1321 if [ $encap_tests != 0 ]
1323 log_test_skipped
"${desc}"
1327 mode
+=" tundst 2001:db8:2::2"
1328 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1331 ip
-netns $ioam_node_alpha \
1332 route change
2001:db8
:2::/64 \
1333 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1334 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1338 run_test
${FUNCNAME[0]} "${desc}" 2001:db8
:1::2 $tr_type $tr_size $ns $1
1340 log_test_failed
"${desc}"
1343 ip
-netns $ioam_node_alpha \
1344 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1346 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1347 link
set ip6tnl0 down
&>/dev
/null
1352 ##############################################################################
1353 # Make sure an IOAM node does NOT fill the trace AND sets the Overflow flag #
1354 # when there is not enough room for the Opaque State Snapshot. #
1355 ##############################################################################
1356 local desc
="Missing room for Opaque State Snapshot"
1358 local tr_type
=0x000002
1362 if [ "$1" == "encap" ]
1364 if [ $encap_tests != 0 ]
1366 log_test_skipped
"${desc}"
1370 mode
+=" tundst 2001:db8:2::2"
1371 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1374 ip
-netns $ioam_node_alpha \
1375 route change
2001:db8
:2::/64 \
1376 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1377 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1381 run_test
${FUNCNAME[0]} "${desc}" 2001:db8
:1::2 $tr_type $tr_size $ns $1
1383 log_test_failed
"${desc}"
1386 ip
-netns $ioam_node_alpha \
1387 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1389 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1390 link
set ip6tnl0 down
&>/dev
/null
1395 ##############################################################################
1396 # Make sure an IOAM node does NOT fill the trace when IOAM is not enabled on #
1397 # the corresponding (ingress) interface. #
1398 ##############################################################################
1399 local desc
="IOAM disabled on ingress interface"
1401 local tr_type
=0x800000
1405 if [ "$1" == "encap" ]
1407 if [ $encap_tests != 0 ]
1409 log_test_skipped
"${desc}"
1413 mode
+=" tundst 2001:db8:2::2"
1414 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1417 # Exception: disable IOAM on ingress interface
1418 ip netns
exec $ioam_node_beta \
1419 sysctl
-wq net.ipv6.conf.veth0.ioam6_enabled
=0 &>/dev
/null
1422 ip
-netns $ioam_node_alpha \
1423 route change
2001:db8
:2::/64 \
1424 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1425 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1430 run_test
${FUNCNAME[0]} "${desc}" 2001:db8
:1::2 $tr_type $tr_size $ns $1
1432 log_test_failed
"${desc}"
1436 ip netns
exec $ioam_node_beta \
1437 sysctl
-wq net.ipv6.conf.veth0.ioam6_enabled
=1 &>/dev
/null
1439 ip
-netns $ioam_node_alpha \
1440 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1442 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1443 link
set ip6tnl0 down
&>/dev
/null
1448 ##############################################################################
1449 # Make sure an IOAM node does NOT fill the trace when the Overflow flag is #
1451 ##############################################################################
1452 local desc
="Overflow flag is set"
1454 local tr_type
=0xc00000
1458 if [ "$1" == "encap" ]
1460 if [ $encap_tests != 0 ]
1462 log_test_skipped
"${desc}"
1466 mode
+=" tundst 2001:db8:2::2"
1467 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1471 # Here, we need the sender to set the Overflow flag. For that, we will add
1472 # back the IOAM namespace that was previously configured on the sender.
1473 ip
-netns $ioam_node_alpha ioam namespace add
123 &>/dev
/null
1476 ip
-netns $ioam_node_alpha \
1477 route change
2001:db8
:2::/64 \
1478 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1479 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1484 run_test
${FUNCNAME[0]} "${desc}" 2001:db8
:1::2 $tr_type $tr_size $ns $1
1486 log_test_failed
"${desc}"
1490 ip
-netns $ioam_node_alpha ioam namespace del
123 &>/dev
/null
1492 ip
-netns $ioam_node_alpha \
1493 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1495 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1496 link
set ip6tnl0 down
&>/dev
/null
1501 ##############################################################################
1502 # Make sure an IOAM node implements all supported bits by checking it #
1503 # correctly fills the trace with its data. #
1504 ##############################################################################
1505 local desc
="Trace Type with supported bit <n> only"
1509 if [ "$1" == "encap" ]
1511 mode
+=" tundst 2001:db8:2::2"
1512 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1515 local tmp
=${bit2size[22]}
1516 bit2size
[22]=$
(( $tmp + ${#BETA[9]} + ((4 - (${#BETA[9]} % 4)) % 4) ))
1519 for i
in {0.
.11} {22.
.22}
1521 local descr
="${desc/<n>/$i}"
1523 if [[ "$1" == "encap" && $encap_tests != 0 ]]
1525 log_test_skipped
"${descr}"
1529 ip
-netns $ioam_node_alpha \
1530 route change
2001:db8
:2::/64 \
1531 encap ioam6 mode
$mode trace prealloc \
1532 type ${bit2type[$i]} ns
$ns size
${bit2size[$i]} \
1533 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1537 run_test
"input_bit$i" "${descr}" 2001:db8
:1::2 \
1538 ${bit2type[$i]} ${bit2size[$i]} $ns $1
1540 log_test_failed
"${descr}"
1544 ip
-netns $ioam_node_alpha \
1545 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1547 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1548 link
set ip6tnl0 down
&>/dev
/null
1555 ##############################################################################
1556 # Make sure an IOAM node handles all supported sizes correctly. #
1557 ##############################################################################
1558 local desc
="Trace Size of <n> bytes"
1560 local tr_type
=0x800000
1563 if [ "$1" == "encap" ]
1565 mode
+=" tundst 2001:db8:2::2"
1566 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1570 for i
in $
(seq 4 4 244)
1572 local descr
="${desc/<n>/$i}"
1574 if [[ "$1" == "encap" && $encap_tests != 0 ]]
1576 log_test_skipped
"${descr}"
1580 ip
-netns $ioam_node_alpha \
1581 route change
2001:db8
:2::/64 \
1582 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$i \
1583 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1587 run_test
"input_size$i" "${descr}" 2001:db8
:1::2 $tr_type $i $ns $1
1589 log_test_failed
"${descr}"
1593 ip
-netns $ioam_node_alpha \
1594 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1596 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1597 link
set ip6tnl0 down
&>/dev
/null
1600 input_full_supp_trace
()
1602 ##############################################################################
1603 # Make sure an IOAM node correctly fills a trace when all supported bits are #
1605 ##############################################################################
1606 local desc
="Full supported trace"
1608 local tr_type
=0xfff002
1612 if [ "$1" == "encap" ]
1614 if [ $encap_tests != 0 ]
1616 log_test_skipped
"${desc}"
1620 mode
+=" tundst 2001:db8:2::2"
1621 ip
-netns $ioam_node_gamma link
set ip6tnl0 up
&>/dev
/null
1625 tr_size
=$
(( ${#BETA[9]} + ((4 - (${#BETA[9]} % 4)) % 4) ))
1626 for i
in {0.
.11} {22.
.22}
1628 tr_size
=$
((tr_size
+ bit2size
[$i]))
1631 ip
-netns $ioam_node_alpha \
1632 route change
2001:db8
:2::/64 \
1633 encap ioam6 mode
$mode trace prealloc
type $tr_type ns
$ns size
$tr_size \
1634 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1638 run_test
${FUNCNAME[0]} "${desc}" 2001:db8
:1::2 $tr_type $tr_size $ns $1
1640 log_test_failed
"${desc}"
1643 ip
-netns $ioam_node_alpha \
1644 route change
2001:db8
:2::/64 via
2001:db8
:1::1 dev veth0
&>/dev
/null
1646 [ "$1" == "encap" ] && ip
-netns $ioam_node_gamma \
1647 link
set ip6tnl0 down
&>/dev
/null
1651 ################################################################################
1655 ################################################################################
1661 if [ "$(id -u)" -ne 0 ]
1663 echo "SKIP: Need root privileges."
1667 if [ ! -x "$(command -v ip)" ]
1669 echo "SKIP: Could not run test without ip tool."
1673 check_kernel_compatibility
1678 if [ $nfailed != 0 ]