|
1 | 1 | #!/bin/bash
|
2 | 2 | # SPDX-License-Identifier: GPL-2.0
|
3 | 3 |
|
| 4 | +############################################################################## |
| 5 | +# Topology description. p1 looped back to p2, p3 to p4 and so on. |
| 6 | + |
| 7 | +declare -A NETIFS=( |
| 8 | + [p1]=veth0 |
| 9 | + [p2]=veth1 |
| 10 | + [p3]=veth2 |
| 11 | + [p4]=veth3 |
| 12 | + [p5]=veth4 |
| 13 | + [p6]=veth5 |
| 14 | + [p7]=veth6 |
| 15 | + [p8]=veth7 |
| 16 | + [p9]=veth8 |
| 17 | + [p10]=veth9 |
| 18 | +) |
| 19 | + |
| 20 | +# Port that does not have a cable connected. |
| 21 | +: "${NETIF_NO_CABLE:=eth8}" |
| 22 | + |
4 | 23 | ##############################################################################
|
5 | 24 | # Defines
|
6 | 25 |
|
7 |
| -# Can be overridden by the configuration file. |
| 26 | +# Networking utilities. |
8 | 27 | : "${PING:=ping}"
|
9 |
| -: "${PING6:=ping6}" |
10 |
| -: "${MZ:=mausezahn}" |
11 |
| -: "${MZ_DELAY:=0}" |
| 28 | +: "${PING6:=ping6}" # Some distros just use ping. |
12 | 29 | : "${ARPING:=arping}"
|
| 30 | +: "${TROUTE6:=traceroute6}" |
| 31 | + |
| 32 | +# Packet generator. |
| 33 | +: "${MZ:=mausezahn}" # Some distributions use 'mz'. |
| 34 | +: "${MZ_DELAY:=0}" |
| 35 | + |
| 36 | +# Host configuration tools. |
13 | 37 | : "${TEAMD:=teamd}"
|
| 38 | +: "${MCD:=smcrouted}" |
| 39 | +: "${MC_CLI:=smcroutectl}" |
| 40 | + |
| 41 | +# Constants for netdevice bring-up: |
| 42 | +# Default time in seconds to wait for an interface to come up before giving up |
| 43 | +# and bailing out. Used during initial setup. |
| 44 | +: "${INTERFACE_TIMEOUT:=600}" |
| 45 | +# Like INTERFACE_TIMEOUT, but default for ad-hoc waiting in testing scripts. |
| 46 | +: "${WAIT_TIMEOUT:=20}" |
| 47 | +# Time to wait after interfaces participating in the test are all UP. |
14 | 48 | : "${WAIT_TIME:=5}"
|
| 49 | + |
| 50 | +# Whether to pause on, respectively, after a failure and before cleanup. |
15 | 51 | : "${PAUSE_ON_FAIL:=no}"
|
16 | 52 | : "${PAUSE_ON_CLEANUP:=no}"
|
17 |
| -: "${NETIF_TYPE:=veth}" |
| 53 | + |
| 54 | +# Whether to create virtual interfaces, and what netdevice type they should be. |
18 | 55 | : "${NETIF_CREATE:=yes}"
|
19 |
| -: "${MCD:=smcrouted}" |
20 |
| -: "${MC_CLI:=smcroutectl}" |
| 56 | +: "${NETIF_TYPE:=veth}" |
| 57 | + |
| 58 | +# Constants for ping tests: |
| 59 | +# How many packets should be sent. |
21 | 60 | : "${PING_COUNT:=10}"
|
| 61 | +# Timeout (in seconds) before ping exits regardless of how many packets have |
| 62 | +# been sent or received |
22 | 63 | : "${PING_TIMEOUT:=5}"
|
23 |
| -: "${WAIT_TIMEOUT:=20}" |
24 |
| -: "${INTERFACE_TIMEOUT:=600}" |
| 64 | + |
| 65 | +# Minimum ageing_time (in centiseconds) supported by hardware |
25 | 66 | : "${LOW_AGEING_TIME:=1000}"
|
| 67 | + |
| 68 | +# Whether to check for availability of certain tools. |
26 | 69 | : "${REQUIRE_JQ:=yes}"
|
27 | 70 | : "${REQUIRE_MZ:=yes}"
|
28 | 71 | : "${REQUIRE_MTOOLS:=no}"
|
| 72 | + |
| 73 | +# Whether to override MAC addresses on interfaces participating in the test. |
29 | 74 | : "${STABLE_MAC_ADDRS:=no}"
|
| 75 | + |
| 76 | +# Flags for tcpdump |
30 | 77 | : "${TCPDUMP_EXTRA_FLAGS:=}"
|
31 |
| -: "${TROUTE6:=traceroute6}" |
| 78 | + |
| 79 | +# Flags for TC filters. |
| 80 | +: "${TC_FLAG:=skip_hw}" |
32 | 81 |
|
33 | 82 | net_forwarding_dir=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
|
34 | 83 |
|
|
0 commit comments