]>
Commit | Line | Data |
---|---|---|
048d19d4 FW |
1 | #!/bin/bash |
2 | # SPDX-License-Identifier: GPL-2.0 | |
3 | ||
4 | time_start=$(date +%s) | |
5 | ||
6 | optstring="b:d:e:l:r:h4cm:" | |
7 | ret=0 | |
8 | sin="" | |
9 | sout="" | |
10 | cin="" | |
11 | cout="" | |
12 | ksft_skip=4 | |
13 | capture=false | |
14 | timeout=30 | |
15 | ipv6=true | |
16 | ethtool_random_on=true | |
17 | tc_delay="$((RANDOM%400))" | |
18 | tc_loss=$((RANDOM%101)) | |
19 | tc_reorder="" | |
20 | testmode="" | |
21 | sndbuf=0 | |
22 | options_log=true | |
23 | ||
24 | if [ $tc_loss -eq 100 ];then | |
25 | tc_loss=1% | |
26 | elif [ $tc_loss -ge 10 ]; then | |
27 | tc_loss=0.$tc_loss% | |
28 | elif [ $tc_loss -ge 1 ]; then | |
29 | tc_loss=0.0$tc_loss% | |
30 | else | |
31 | tc_loss="" | |
32 | fi | |
33 | ||
34 | usage() { | |
35 | echo "Usage: $0 [ -a ]" | |
36 | echo -e "\t-d: tc/netem delay in milliseconds, e.g. \"-d 10\" (default random)" | |
37 | echo -e "\t-l: tc/netem loss percentage, e.g. \"-l 0.02\" (default random)" | |
38 | echo -e "\t-r: tc/netem reorder mode, e.g. \"-r 25% 50% gap 5\", use "-r 0" to disable reordering (default random)" | |
39 | echo -e "\t-e: ethtool features to disable, e.g.: \"-e tso -e gso\" (default: randomly disable any of tso/gso/gro)" | |
40 | echo -e "\t-4: IPv4 only: disable IPv6 tests (default: test both IPv4 and IPv6)" | |
41 | echo -e "\t-c: capture packets for each test using tcpdump (default: no capture)" | |
42 | echo -e "\t-b: set sndbuf value (default: use kernel default)" | |
43 | echo -e "\t-m: test mode (poll, sendfile; default: poll)" | |
44 | } | |
45 | ||
46 | while getopts "$optstring" option;do | |
47 | case "$option" in | |
48 | "h") | |
49 | usage $0 | |
50 | exit 0 | |
51 | ;; | |
52 | "d") | |
53 | if [ $OPTARG -ge 0 ];then | |
54 | tc_delay="$OPTARG" | |
55 | else | |
56 | echo "-d requires numeric argument, got \"$OPTARG\"" 1>&2 | |
57 | exit 1 | |
58 | fi | |
59 | ;; | |
60 | "e") | |
61 | ethtool_args="$ethtool_args $OPTARG off" | |
62 | ethtool_random_on=false | |
63 | ;; | |
64 | "l") | |
65 | tc_loss="$OPTARG" | |
66 | ;; | |
67 | "r") | |
68 | tc_reorder="$OPTARG" | |
69 | ;; | |
70 | "4") | |
71 | ipv6=false | |
72 | ;; | |
73 | "c") | |
74 | capture=true | |
75 | ;; | |
76 | "b") | |
77 | if [ $OPTARG -ge 0 ];then | |
78 | sndbuf="$OPTARG" | |
79 | else | |
80 | echo "-s requires numeric argument, got \"$OPTARG\"" 1>&2 | |
81 | exit 1 | |
82 | fi | |
83 | ;; | |
84 | "m") | |
85 | testmode="$OPTARG" | |
86 | ;; | |
87 | "?") | |
88 | usage $0 | |
89 | exit 1 | |
90 | ;; | |
91 | esac | |
92 | done | |
93 | ||
94 | sec=$(date +%s) | |
95 | rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) | |
96 | ns1="ns1-$rndh" | |
97 | ns2="ns2-$rndh" | |
98 | ns3="ns3-$rndh" | |
99 | ns4="ns4-$rndh" | |
100 | ||
101 | TEST_COUNT=0 | |
102 | ||
103 | cleanup() | |
104 | { | |
105 | rm -f "$cin" "$cout" | |
106 | rm -f "$sin" "$sout" | |
107 | rm -f "$capout" | |
108 | ||
109 | local netns | |
110 | for netns in "$ns1" "$ns2" "$ns3" "$ns4";do | |
111 | ip netns del $netns | |
112 | done | |
113 | } | |
114 | ||
115 | ip -Version > /dev/null 2>&1 | |
116 | if [ $? -ne 0 ];then | |
117 | echo "SKIP: Could not run test without ip tool" | |
118 | exit $ksft_skip | |
119 | fi | |
120 | ||
121 | sin=$(mktemp) | |
122 | sout=$(mktemp) | |
123 | cin=$(mktemp) | |
124 | cout=$(mktemp) | |
125 | capout=$(mktemp) | |
126 | trap cleanup EXIT | |
127 | ||
128 | for i in "$ns1" "$ns2" "$ns3" "$ns4";do | |
129 | ip netns add $i || exit $ksft_skip | |
130 | ip -net $i link set lo up | |
131 | done | |
132 | ||
133 | # "$ns1" ns2 ns3 ns4 | |
134 | # ns1eth2 ns2eth1 ns2eth3 ns3eth2 ns3eth4 ns4eth3 | |
135 | # - drop 1% -> reorder 25% | |
136 | # <- TSO off - | |
137 | ||
138 | ip link add ns1eth2 netns "$ns1" type veth peer name ns2eth1 netns "$ns2" | |
139 | ip link add ns2eth3 netns "$ns2" type veth peer name ns3eth2 netns "$ns3" | |
140 | ip link add ns3eth4 netns "$ns3" type veth peer name ns4eth3 netns "$ns4" | |
141 | ||
142 | ip -net "$ns1" addr add 10.0.1.1/24 dev ns1eth2 | |
143 | ip -net "$ns1" addr add dead:beef:1::1/64 dev ns1eth2 nodad | |
144 | ||
145 | ip -net "$ns1" link set ns1eth2 up | |
146 | ip -net "$ns1" route add default via 10.0.1.2 | |
147 | ip -net "$ns1" route add default via dead:beef:1::2 | |
148 | ||
149 | ip -net "$ns2" addr add 10.0.1.2/24 dev ns2eth1 | |
150 | ip -net "$ns2" addr add dead:beef:1::2/64 dev ns2eth1 nodad | |
151 | ip -net "$ns2" link set ns2eth1 up | |
152 | ||
153 | ip -net "$ns2" addr add 10.0.2.1/24 dev ns2eth3 | |
154 | ip -net "$ns2" addr add dead:beef:2::1/64 dev ns2eth3 nodad | |
155 | ip -net "$ns2" link set ns2eth3 up | |
156 | ip -net "$ns2" route add default via 10.0.2.2 | |
157 | ip -net "$ns2" route add default via dead:beef:2::2 | |
158 | ip netns exec "$ns2" sysctl -q net.ipv4.ip_forward=1 | |
159 | ip netns exec "$ns2" sysctl -q net.ipv6.conf.all.forwarding=1 | |
160 | ||
161 | ip -net "$ns3" addr add 10.0.2.2/24 dev ns3eth2 | |
162 | ip -net "$ns3" addr add dead:beef:2::2/64 dev ns3eth2 nodad | |
163 | ip -net "$ns3" link set ns3eth2 up | |
164 | ||
165 | ip -net "$ns3" addr add 10.0.3.2/24 dev ns3eth4 | |
166 | ip -net "$ns3" addr add dead:beef:3::2/64 dev ns3eth4 nodad | |
167 | ip -net "$ns3" link set ns3eth4 up | |
168 | ip -net "$ns3" route add default via 10.0.2.1 | |
169 | ip -net "$ns3" route add default via dead:beef:2::1 | |
170 | ip netns exec "$ns3" sysctl -q net.ipv4.ip_forward=1 | |
171 | ip netns exec "$ns3" sysctl -q net.ipv6.conf.all.forwarding=1 | |
172 | ||
173 | ip -net "$ns4" addr add 10.0.3.1/24 dev ns4eth3 | |
174 | ip -net "$ns4" addr add dead:beef:3::1/64 dev ns4eth3 nodad | |
175 | ip -net "$ns4" link set ns4eth3 up | |
176 | ip -net "$ns4" route add default via 10.0.3.2 | |
177 | ip -net "$ns4" route add default via dead:beef:3::2 | |
178 | ||
179 | set_ethtool_flags() { | |
180 | local ns="$1" | |
181 | local dev="$2" | |
182 | local flags="$3" | |
183 | ||
184 | ip netns exec $ns ethtool -K $dev $flags 2>/dev/null | |
185 | [ $? -eq 0 ] && echo "INFO: set $ns dev $dev: ethtool -K $flags" | |
186 | } | |
187 | ||
188 | set_random_ethtool_flags() { | |
189 | local flags="" | |
190 | local r=$RANDOM | |
191 | ||
192 | local pick1=$((r & 1)) | |
193 | local pick2=$((r & 2)) | |
194 | local pick3=$((r & 4)) | |
195 | ||
196 | [ $pick1 -ne 0 ] && flags="tso off" | |
197 | [ $pick2 -ne 0 ] && flags="$flags gso off" | |
198 | [ $pick3 -ne 0 ] && flags="$flags gro off" | |
199 | ||
200 | [ -z "$flags" ] && return | |
201 | ||
202 | set_ethtool_flags "$1" "$2" "$flags" | |
203 | } | |
204 | ||
205 | if $ethtool_random_on;then | |
206 | set_random_ethtool_flags "$ns3" ns3eth2 | |
207 | set_random_ethtool_flags "$ns4" ns4eth3 | |
208 | else | |
209 | set_ethtool_flags "$ns3" ns3eth2 "$ethtool_args" | |
210 | set_ethtool_flags "$ns4" ns4eth3 "$ethtool_args" | |
211 | fi | |
212 | ||
213 | print_file_err() | |
214 | { | |
215 | ls -l "$1" 1>&2 | |
216 | echo "Trailing bytes are: " | |
217 | tail -c 27 "$1" | |
218 | } | |
219 | ||
220 | check_transfer() | |
221 | { | |
222 | local in=$1 | |
223 | local out=$2 | |
224 | local what=$3 | |
225 | ||
226 | cmp "$in" "$out" > /dev/null 2>&1 | |
227 | if [ $? -ne 0 ] ;then | |
228 | echo "[ FAIL ] $what does not match (in, out):" | |
229 | print_file_err "$in" | |
230 | print_file_err "$out" | |
231 | ||
232 | return 1 | |
233 | fi | |
234 | ||
235 | return 0 | |
236 | } | |
237 | ||
238 | check_mptcp_disabled() | |
239 | { | |
240 | local disabled_ns | |
241 | disabled_ns="ns_disabled-$sech-$(mktemp -u XXXXXX)" | |
242 | ip netns add ${disabled_ns} || exit $ksft_skip | |
243 | ||
244 | # net.mptcp.enabled should be enabled by default | |
245 | if [ "$(ip netns exec ${disabled_ns} sysctl net.mptcp.enabled | awk '{ print $3 }')" -ne 1 ]; then | |
246 | echo -e "net.mptcp.enabled sysctl is not 1 by default\t\t[ FAIL ]" | |
247 | ret=1 | |
248 | return 1 | |
249 | fi | |
250 | ip netns exec ${disabled_ns} sysctl -q net.mptcp.enabled=0 | |
251 | ||
252 | local err=0 | |
253 | LANG=C ip netns exec ${disabled_ns} ./mptcp_connect -t $timeout -p 10000 -s MPTCP 127.0.0.1 < "$cin" 2>&1 | \ | |
254 | grep -q "^socket: Protocol not available$" && err=1 | |
255 | ip netns delete ${disabled_ns} | |
256 | ||
257 | if [ ${err} -eq 0 ]; then | |
258 | echo -e "New MPTCP socket cannot be blocked via sysctl\t\t[ FAIL ]" | |
259 | ret=1 | |
260 | return 1 | |
261 | fi | |
262 | ||
263 | echo -e "New MPTCP socket can be blocked via sysctl\t\t[ OK ]" | |
264 | return 0 | |
265 | } | |
266 | ||
267 | check_mptcp_ulp_setsockopt() | |
268 | { | |
269 | local t retval | |
270 | t="ns_ulp-$sech-$(mktemp -u XXXXXX)" | |
271 | ||
272 | ip netns add ${t} || exit $ksft_skip | |
273 | if ! ip netns exec ${t} ./mptcp_connect -u -p 10000 -s TCP 127.0.0.1 2>&1; then | |
274 | printf "setsockopt(..., TCP_ULP, \"mptcp\", ...) allowed\t[ FAIL ]\n" | |
275 | retval=1 | |
276 | ret=$retval | |
277 | else | |
278 | printf "setsockopt(..., TCP_ULP, \"mptcp\", ...) blocked\t[ OK ]\n" | |
279 | retval=0 | |
280 | fi | |
281 | ip netns del ${t} | |
282 | return $retval | |
283 | } | |
284 | ||
285 | # $1: IP address | |
286 | is_v6() | |
287 | { | |
288 | [ -z "${1##*:*}" ] | |
289 | } | |
290 | ||
291 | do_ping() | |
292 | { | |
293 | local listener_ns="$1" | |
294 | local connector_ns="$2" | |
295 | local connect_addr="$3" | |
296 | local ping_args="-q -c 1" | |
297 | ||
298 | if is_v6 "${connect_addr}"; then | |
299 | $ipv6 || return 0 | |
300 | ping_args="${ping_args} -6" | |
301 | fi | |
302 | ||
303 | ip netns exec ${connector_ns} ping ${ping_args} $connect_addr >/dev/null | |
304 | if [ $? -ne 0 ] ; then | |
305 | echo "$listener_ns -> $connect_addr connectivity [ FAIL ]" 1>&2 | |
306 | ret=1 | |
307 | ||
308 | return 1 | |
309 | fi | |
310 | ||
311 | return 0 | |
312 | } | |
313 | ||
314 | # $1: ns, $2: port | |
315 | wait_local_port_listen() | |
316 | { | |
317 | local listener_ns="${1}" | |
318 | local port="${2}" | |
319 | ||
320 | local port_hex i | |
321 | ||
322 | port_hex="$(printf "%04X" "${port}")" | |
323 | for i in $(seq 10); do | |
324 | ip netns exec "${listener_ns}" cat /proc/net/tcp* | \ | |
325 | awk "BEGIN {rc=1} {if (\$2 ~ /:${port_hex}\$/ && \$4 ~ /0A/) {rc=0; exit}} END {exit rc}" && | |
326 | break | |
327 | sleep 0.1 | |
328 | done | |
329 | } | |
330 | ||
331 | do_transfer() | |
332 | { | |
333 | local listener_ns="$1" | |
334 | local connector_ns="$2" | |
335 | local cl_proto="$3" | |
336 | local srv_proto="$4" | |
337 | local connect_addr="$5" | |
338 | local local_addr="$6" | |
339 | local extra_args="" | |
340 | ||
341 | local port | |
342 | port=$((10000+$TEST_COUNT)) | |
343 | TEST_COUNT=$((TEST_COUNT+1)) | |
344 | ||
345 | if [ "$sndbuf" -gt 0 ]; then | |
346 | extra_args="$extra_args -b $sndbuf" | |
347 | fi | |
348 | ||
349 | if [ -n "$testmode" ]; then | |
350 | extra_args="$extra_args -m $testmode" | |
351 | fi | |
352 | ||
353 | if [ -n "$extra_args" ] && $options_log; then | |
354 | options_log=false | |
355 | echo "INFO: extra options: $extra_args" | |
356 | fi | |
357 | ||
358 | :> "$cout" | |
359 | :> "$sout" | |
360 | :> "$capout" | |
361 | ||
362 | local addr_port | |
363 | addr_port=$(printf "%s:%d" ${connect_addr} ${port}) | |
364 | printf "%.3s %-5s -> %.3s (%-20s) %-5s\t" ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} ${srv_proto} | |
365 | ||
366 | if $capture; then | |
367 | local capuser | |
368 | if [ -z $SUDO_USER ] ; then | |
369 | capuser="" | |
370 | else | |
371 | capuser="-Z $SUDO_USER" | |
372 | fi | |
373 | ||
374 | local capfile="${listener_ns}-${connector_ns}-${cl_proto}-${srv_proto}-${connect_addr}.pcap" | |
375 | ||
376 | ip netns exec ${listener_ns} tcpdump -i any -s 65535 -B 32768 $capuser -w $capfile > "$capout" 2>&1 & | |
377 | local cappid=$! | |
378 | ||
379 | sleep 1 | |
380 | fi | |
381 | ||
382 | ip netns exec ${listener_ns} ./mptcp_connect -t $timeout -l -p $port -s ${srv_proto} $extra_args $local_addr < "$sin" > "$sout" & | |
383 | local spid=$! | |
384 | ||
385 | wait_local_port_listen "${listener_ns}" "${port}" | |
386 | ||
387 | local start | |
388 | start=$(date +%s%3N) | |
389 | ip netns exec ${connector_ns} ./mptcp_connect -t $timeout -p $port -s ${cl_proto} $extra_args $connect_addr < "$cin" > "$cout" & | |
390 | local cpid=$! | |
391 | ||
392 | wait $cpid | |
393 | local retc=$? | |
394 | wait $spid | |
395 | local rets=$? | |
396 | ||
397 | local stop | |
398 | stop=$(date +%s%3N) | |
399 | ||
400 | if $capture; then | |
401 | sleep 1 | |
402 | kill $cappid | |
403 | fi | |
404 | ||
405 | local duration | |
406 | duration=$((stop-start)) | |
407 | duration=$(printf "(duration %05sms)" $duration) | |
408 | if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then | |
409 | echo "$duration [ FAIL ] client exit code $retc, server $rets" 1>&2 | |
410 | echo "\nnetns ${listener_ns} socket stat for $port:" 1>&2 | |
411 | ip netns exec ${listener_ns} ss -nita 1>&2 -o "sport = :$port" | |
412 | echo "\nnetns ${connector_ns} socket stat for $port:" 1>&2 | |
413 | ip netns exec ${connector_ns} ss -nita 1>&2 -o "dport = :$port" | |
414 | ||
415 | cat "$capout" | |
416 | return 1 | |
417 | fi | |
418 | ||
419 | check_transfer $sin $cout "file received by client" | |
420 | retc=$? | |
421 | check_transfer $cin $sout "file received by server" | |
422 | rets=$? | |
423 | ||
424 | if [ $retc -eq 0 ] && [ $rets -eq 0 ];then | |
425 | echo "$duration [ OK ]" | |
426 | cat "$capout" | |
427 | return 0 | |
428 | fi | |
429 | ||
430 | cat "$capout" | |
431 | return 1 | |
432 | } | |
433 | ||
434 | make_file() | |
435 | { | |
436 | local name=$1 | |
437 | local who=$2 | |
438 | ||
439 | local SIZE TSIZE | |
440 | SIZE=$((RANDOM % (1024 * 8))) | |
441 | TSIZE=$((SIZE * 1024)) | |
442 | ||
443 | dd if=/dev/urandom of="$name" bs=1024 count=$SIZE 2> /dev/null | |
444 | ||
445 | SIZE=$((RANDOM % 1024)) | |
446 | SIZE=$((SIZE + 128)) | |
447 | TSIZE=$((TSIZE + SIZE)) | |
448 | dd if=/dev/urandom conv=notrunc of="$name" bs=1 count=$SIZE 2> /dev/null | |
449 | echo -e "\nMPTCP_TEST_FILE_END_MARKER" >> "$name" | |
450 | ||
451 | echo "Created $name (size $TSIZE) containing data sent by $who" | |
452 | } | |
453 | ||
454 | run_tests_lo() | |
455 | { | |
456 | local listener_ns="$1" | |
457 | local connector_ns="$2" | |
458 | local connect_addr="$3" | |
459 | local loopback="$4" | |
460 | local lret=0 | |
461 | ||
462 | # skip if test programs are running inside same netns for subsequent runs. | |
463 | if [ $loopback -eq 0 ] && [ ${listener_ns} = ${connector_ns} ]; then | |
464 | return 0 | |
465 | fi | |
466 | ||
467 | # skip if we don't want v6 | |
468 | if ! $ipv6 && is_v6 "${connect_addr}"; then | |
469 | return 0 | |
470 | fi | |
471 | ||
472 | local local_addr | |
473 | if is_v6 "${connect_addr}"; then | |
474 | local_addr="::" | |
475 | else | |
476 | local_addr="0.0.0.0" | |
477 | fi | |
478 | ||
479 | do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP ${connect_addr} ${local_addr} | |
480 | lret=$? | |
481 | if [ $lret -ne 0 ]; then | |
482 | ret=$lret | |
483 | return 1 | |
484 | fi | |
485 | ||
486 | # don't bother testing fallback tcp except for loopback case. | |
487 | if [ ${listener_ns} != ${connector_ns} ]; then | |
488 | return 0 | |
489 | fi | |
490 | ||
491 | do_transfer ${listener_ns} ${connector_ns} MPTCP TCP ${connect_addr} ${local_addr} | |
492 | lret=$? | |
493 | if [ $lret -ne 0 ]; then | |
494 | ret=$lret | |
495 | return 1 | |
496 | fi | |
497 | ||
498 | do_transfer ${listener_ns} ${connector_ns} TCP MPTCP ${connect_addr} ${local_addr} | |
499 | lret=$? | |
500 | if [ $lret -ne 0 ]; then | |
501 | ret=$lret | |
502 | return 1 | |
503 | fi | |
504 | ||
505 | return 0 | |
506 | } | |
507 | ||
508 | run_tests() | |
509 | { | |
510 | run_tests_lo $1 $2 $3 0 | |
511 | } | |
512 | ||
513 | make_file "$cin" "client" | |
514 | make_file "$sin" "server" | |
515 | ||
516 | check_mptcp_disabled | |
517 | ||
518 | check_mptcp_ulp_setsockopt | |
519 | ||
520 | echo "INFO: validating network environment with pings" | |
521 | for sender in "$ns1" "$ns2" "$ns3" "$ns4";do | |
522 | do_ping "$ns1" $sender 10.0.1.1 | |
523 | do_ping "$ns1" $sender dead:beef:1::1 | |
524 | ||
525 | do_ping "$ns2" $sender 10.0.1.2 | |
526 | do_ping "$ns2" $sender dead:beef:1::2 | |
527 | do_ping "$ns2" $sender 10.0.2.1 | |
528 | do_ping "$ns2" $sender dead:beef:2::1 | |
529 | ||
530 | do_ping "$ns3" $sender 10.0.2.2 | |
531 | do_ping "$ns3" $sender dead:beef:2::2 | |
532 | do_ping "$ns3" $sender 10.0.3.2 | |
533 | do_ping "$ns3" $sender dead:beef:3::2 | |
534 | ||
535 | do_ping "$ns4" $sender 10.0.3.1 | |
536 | do_ping "$ns4" $sender dead:beef:3::1 | |
537 | done | |
538 | ||
539 | [ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss | |
540 | echo -n "INFO: Using loss of $tc_loss " | |
541 | test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms " | |
542 | ||
543 | if [ -z "${tc_reorder}" ]; then | |
544 | reorder1=$((RANDOM%10)) | |
545 | reorder1=$((100 - reorder1)) | |
546 | reorder2=$((RANDOM%100)) | |
547 | ||
548 | if [ $tc_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then | |
549 | tc_reorder="reorder ${reorder1}% ${reorder2}%" | |
550 | echo -n "$tc_reorder " | |
551 | fi | |
552 | elif [ "$tc_reorder" = "0" ];then | |
553 | tc_reorder="" | |
554 | elif [ "$tc_delay" -gt 0 ];then | |
555 | # reordering requires some delay | |
556 | tc_reorder="reorder $tc_reorder" | |
557 | echo -n "$tc_reorder " | |
558 | fi | |
559 | ||
560 | echo "on ns3eth4" | |
561 | ||
562 | tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${tc_delay}ms $tc_reorder | |
563 | ||
564 | for sender in $ns1 $ns2 $ns3 $ns4;do | |
565 | run_tests_lo "$ns1" "$sender" 10.0.1.1 1 | |
566 | if [ $ret -ne 0 ] ;then | |
567 | echo "FAIL: Could not even run loopback test" 1>&2 | |
568 | exit $ret | |
569 | fi | |
570 | run_tests_lo "$ns1" $sender dead:beef:1::1 1 | |
571 | if [ $ret -ne 0 ] ;then | |
572 | echo "FAIL: Could not even run loopback v6 test" 2>&1 | |
573 | exit $ret | |
574 | fi | |
575 | ||
576 | run_tests "$ns2" $sender 10.0.1.2 | |
577 | run_tests "$ns2" $sender dead:beef:1::2 | |
578 | run_tests "$ns2" $sender 10.0.2.1 | |
579 | run_tests "$ns2" $sender dead:beef:2::1 | |
580 | ||
581 | run_tests "$ns3" $sender 10.0.2.2 | |
582 | run_tests "$ns3" $sender dead:beef:2::2 | |
583 | run_tests "$ns3" $sender 10.0.3.2 | |
584 | run_tests "$ns3" $sender dead:beef:3::2 | |
585 | ||
586 | run_tests "$ns4" $sender 10.0.3.1 | |
587 | run_tests "$ns4" $sender dead:beef:3::1 | |
588 | done | |
589 | ||
590 | time_end=$(date +%s) | |
591 | time_run=$((time_end-time_start)) | |
592 | ||
593 | echo "Time: ${time_run} seconds" | |
594 | ||
595 | exit $ret |