Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.gitignore | H A D | 01-Sep-2020 | 58 | 3 | 2 | |
Makefile | H A D | 20-Sep-2024 | 2.9 KiB | 132 | 126 | |
README | H A D | 06-Oct-2024 | 3.4 KiB | 92 | 69 | |
bridge_fdb_learning_limit.sh | H A D | 20-Sep-2024 | 5.8 KiB | 302 | 216 | |
bridge_igmp.sh | H A D | 20-Sep-2024 | 14.7 KiB | 565 | 404 | |
bridge_locked_port.sh | H A D | 15-Jul-2024 | 9.2 KiB | 366 | 249 | |
bridge_mdb.sh | H A D | 15-Jul-2024 | 45.1 KiB | 1,372 | 926 | |
bridge_mdb_host.sh | H A D | 21-Feb-2023 | 1.7 KiB | 104 | 70 | |
bridge_mdb_max.sh | H A D | 24-Oct-2023 | 30 KiB | 1,348 | 1,013 | |
bridge_mdb_port_down.sh | H A D | 14-Dec-2022 | 2.2 KiB | 119 | 80 | |
bridge_mld.sh | H A D | 20-Sep-2024 | 16.2 KiB | 565 | 412 | |
bridge_port_isolation.sh | H A D | 15-Jan-2019 | 2.3 KiB | 152 | 112 | |
bridge_sticky_fdb.sh | H A D | 15-Jan-2019 | 1.1 KiB | 70 | 52 | |
bridge_vlan_aware.sh | H A D | 02-Oct-2024 | 4.2 KiB | 205 | 139 | |
bridge_vlan_mcast.sh | H A D | 21-Feb-2023 | 16.7 KiB | 547 | 442 | |
bridge_vlan_unaware.sh | H A D | 14-Dec-2022 | 1.2 KiB | 106 | 76 | |
config | H A D | 15-Jul-2024 | 1.2 KiB | 55 | 54 | |
custom_multipath_hash.sh | H A D | 06-Oct-2024 | 9.8 KiB | 373 | 245 | |
devlink_lib.sh | H A D | 20-Sep-2024 | 12.8 KiB | 599 | 448 | |
dual_vxlan_bridge.sh | H A D | 07-Nov-2023 | 11.2 KiB | 368 | 223 | |
fib_offload_lib.sh | H A D | 14-Dec-2022 | 24.6 KiB | 874 | 600 | |
forwarding.config.sample | H A D | 20-Sep-2024 | 706 | 31 | 16 | |
gre_custom_multipath_hash.sh | H A D | 06-Oct-2024 | 12.5 KiB | 465 | 295 | |
gre_inner_v4_multipath.sh | H A D | 15-Jul-2024 | 7.6 KiB | 306 | 182 | |
gre_inner_v6_multipath.sh | H A D | 15-Jul-2024 | 7.7 KiB | 307 | 183 | |
gre_multipath.sh | H A D | 15-Jul-2024 | 6.3 KiB | 258 | 157 | |
gre_multipath_nh.sh | H A D | 15-Jul-2024 | 8.1 KiB | 320 | 202 | |
gre_multipath_nh_res.sh | H A D | 15-Jul-2024 | 8.3 KiB | 324 | 206 | |
ip6_forward_instats_vrf.sh | H A D | 24-Oct-2023 | 3 KiB | 175 | 129 | |
ip6gre_custom_multipath_hash.sh | H A D | 06-Oct-2024 | 12.8 KiB | 467 | 297 | |
ip6gre_flat.sh | H A D | 31-Oct-2024 | 1.2 KiB | 80 | 56 | |
ip6gre_flat_key.sh | H A D | 31-Oct-2024 | 1.2 KiB | 80 | 56 | |
ip6gre_flat_keys.sh | H A D | 31-Oct-2024 | 1.3 KiB | 80 | 56 | |
ip6gre_hier.sh | H A D | 31-Oct-2024 | 1.3 KiB | 80 | 56 | |
ip6gre_hier_key.sh | H A D | 31-Oct-2024 | 1.3 KiB | 80 | 56 | |
ip6gre_hier_keys.sh | H A D | 31-Oct-2024 | 1.4 KiB | 80 | 56 | |
ip6gre_inner_v4_multipath.sh | H A D | 15-Jul-2024 | 7.8 KiB | 305 | 182 | |
ip6gre_inner_v6_multipath.sh | H A D | 15-Jul-2024 | 7.9 KiB | 306 | 183 | |
ip6gre_lib.sh | H A D | 31-Oct-2024 | 15.7 KiB | 519 | 283 | |
ipip_flat_gre.sh | H A D | 11-Jul-2019 | 838 | 64 | 43 | |
ipip_flat_gre_key.sh | H A D | 11-Jul-2019 | 860 | 64 | 43 | |
ipip_flat_gre_keys.sh | H A D | 11-Jul-2019 | 886 | 64 | 43 | |
ipip_hier_gre.sh | H A D | 11-Jul-2019 | 887 | 64 | 43 | |
ipip_hier_gre_key.sh | H A D | 11-Jul-2019 | 910 | 64 | 43 | |
ipip_hier_gre_keys.sh | H A D | 11-Jul-2019 | 938 | 64 | 43 | |
ipip_lib.sh | H A D | 20-Sep-2024 | 8.3 KiB | 349 | 157 | |
lib.sh | H A D | 06-Oct-2024 | 44.6 KiB | 2,296 | 1,760 | |
lib_sh_test.sh | H A D | 20-Sep-2024 | 3.6 KiB | 209 | 149 | |
local_termination.sh | H A D | 02-Oct-2024 | 14.4 KiB | 597 | 472 | |
min_max_mtu.sh | H A D | 20-Sep-2024 | 4.7 KiB | 284 | 192 | |
mirror_gre.sh | H A D | 20-Sep-2024 | 2.9 KiB | 142 | 98 | |
mirror_gre_bound.sh | H A D | 20-Sep-2024 | 5.5 KiB | 207 | 115 | |
mirror_gre_bridge_1d.sh | H A D | 20-Sep-2024 | 4.1 KiB | 119 | 58 | |
mirror_gre_bridge_1d_vlan.sh | H A D | 20-Sep-2024 | 2.4 KiB | 115 | 76 | |
mirror_gre_bridge_1q.sh | H A D | 20-Sep-2024 | 4 KiB | 115 | 57 | |
mirror_gre_bridge_1q_lag.sh | H A D | 20-Sep-2024 | 7 KiB | 276 | 177 | |
mirror_gre_changes.sh | H A D | 20-Sep-2024 | 5.2 KiB | 255 | 179 | |
mirror_gre_flower.sh | H A D | 20-Sep-2024 | 2.6 KiB | 125 | 83 | |
mirror_gre_lag_lacp.sh | H A D | 20-Sep-2024 | 7.5 KiB | 271 | 166 | |
mirror_gre_lib.sh | H A D | 20-Sep-2024 | 3.6 KiB | 173 | 136 | |
mirror_gre_neigh.sh | H A D | 20-Sep-2024 | 2.1 KiB | 99 | 66 | |
mirror_gre_nh.sh | H A D | 20-Sep-2024 | 2.5 KiB | 113 | 70 | |
mirror_gre_topo_lib.sh | H A D | 15-Jul-2024 | 3.4 KiB | 95 | 45 | |
mirror_gre_vlan.sh | H A D | 20-Sep-2024 | 1.4 KiB | 74 | 48 | |
mirror_gre_vlan_bridge_1q.sh | H A D | 20-Sep-2024 | 8.5 KiB | 330 | 211 | |
mirror_lib.sh | H A D | 20-Sep-2024 | 3.7 KiB | 181 | 145 | |
mirror_topo_lib.sh | H A D | 07-Nov-2023 | 2.7 KiB | 103 | 60 | |
mirror_vlan.sh | H A D | 20-Sep-2024 | 1.9 KiB | 113 | 76 | |
no_forwarding.sh | H A D | 17-Oct-2024 | 5.5 KiB | 265 | 190 | |
pedit_dsfield.sh | H A D | 07-Nov-2023 | 6.7 KiB | 314 | 236 | |
pedit_ip.sh | H A D | 14-Dec-2022 | 4.4 KiB | 202 | 144 | |
pedit_l4port.sh | H A D | 15-Jan-2022 | 4.5 KiB | 201 | 144 | |
q_in_vni.sh | H A D | 07-Nov-2023 | 10.7 KiB | 349 | 214 | |
q_in_vni_ipv6.sh | H A D | 31-May-2022 | 10.9 KiB | 348 | 213 | |
router.sh | H A D | 14-Dec-2022 | 7.3 KiB | 341 | 228 | |
router_bridge.sh | H A D | 15-Jul-2024 | 4 KiB | 191 | 132 | |
router_bridge_1d.sh | H A D | 15-Jul-2024 | 5.1 KiB | 186 | 126 | |
router_bridge_1d_lag.sh | H A D | 15-Jul-2024 | 9.3 KiB | 409 | 270 | |
router_bridge_lag.sh | H A D | 15-Jul-2024 | 6.8 KiB | 324 | 241 | |
router_bridge_pvid_vlan_upper.sh | H A D | 15-Jul-2024 | 3.5 KiB | 156 | 100 | |
router_bridge_vlan.sh | H A D | 15-Jul-2024 | 5.5 KiB | 225 | 152 | |
router_bridge_vlan_upper.sh | H A D | 15-Jul-2024 | 3.9 KiB | 170 | 111 | |
router_bridge_vlan_upper_pvid.sh | H A D | 15-Jul-2024 | 3.7 KiB | 172 | 114 | |
router_broadcast.sh | H A D | 23-Aug-2019 | 5 KiB | 238 | 179 | |
router_mpath_nh.sh | H A D | 06-Oct-2024 | 10.7 KiB | 465 | 315 | |
router_mpath_nh_lib.sh | H A D | 06-Oct-2024 | 3.2 KiB | 133 | 107 | |
router_mpath_nh_res.sh | H A D | 06-Oct-2024 | 12.7 KiB | 491 | 334 | |
router_mpath_seed.sh | H A D | 20-Sep-2024 | 7.4 KiB | 334 | 247 | |
router_multicast.sh | H A D | 14-Dec-2022 | 14.6 KiB | 507 | 324 | |
router_multipath.sh | H A D | 06-Oct-2024 | 7.1 KiB | 308 | 222 | |
router_nh.sh | H A D | 20-Sep-2024 | 3.3 KiB | 175 | 112 | |
router_vid_1.sh | H A D | 14-Dec-2022 | 3.5 KiB | 161 | 98 | |
sch_ets.sh | H A D | 01-Sep-2020 | 781 | 48 | 34 | |
sch_ets_core.sh | H A D | 06-Jun-2020 | 7.3 KiB | 301 | 187 | |
sch_ets_tests.sh | H A D | 20-Sep-2024 | 4.1 KiB | 227 | 175 | |
sch_red.sh | H A D | 20-Sep-2024 | 11.2 KiB | 494 | 342 | |
sch_tbf_core.sh | H A D | 20-Sep-2024 | 5 KiB | 234 | 142 | |
sch_tbf_ets.sh | H A D | 06-Jun-2020 | 118 | 7 | 3 | |
sch_tbf_etsprio.sh | H A D | 31-Aug-2023 | 1.4 KiB | 72 | 50 | |
sch_tbf_prio.sh | H A D | 06-Jun-2020 | 118 | 7 | 3 | |
sch_tbf_root.sh | H A D | 31-Aug-2023 | 489 | 38 | 26 | |
settings | H A D | 24-Oct-2023 | 10 | 2 | 1 | |
skbedit_priority.sh | H A D | 07-Nov-2023 | 3.9 KiB | 173 | 116 | |
tc_actions.sh | H A D | 06-Oct-2024 | 9.3 KiB | 363 | 272 | |
tc_chains.sh | H A D | 04-May-2021 | 4.8 KiB | 206 | 148 | |
tc_common.sh | H A D | 20-Sep-2024 | 710 | 37 | 25 | |
tc_flower.sh | H A D | 24-Oct-2023 | 21.2 KiB | 718 | 492 | |
tc_flower_cfm.sh | H A D | 07-Nov-2023 | 4.9 KiB | 207 | 152 | |
tc_flower_l2_miss.sh | H A D | 15-Jul-2024 | 9.1 KiB | 358 | 240 | |
tc_flower_port_range.sh | H A D | 15-Jul-2024 | 5.9 KiB | 229 | 174 | |
tc_flower_router.sh | H A D | 16-Sep-2019 | 3 KiB | 173 | 123 | |
tc_mpls_l2vpn.sh | H A D | 24-Feb-2021 | 5 KiB | 193 | 111 | |
tc_police.sh | H A D | 15-Jul-2024 | 11.8 KiB | 442 | 292 | |
tc_shblocks.sh | H A D | 16-Sep-2019 | 2.7 KiB | 153 | 108 | |
tc_tunnel_key.sh | H A D | 20-Sep-2024 | 3.7 KiB | 163 | 126 | |
tc_vlan_modify.sh | H A D | 20-Jul-2019 | 3.2 KiB | 165 | 116 | |
tsn_lib.sh | H A D | 14-Dec-2022 | 5.5 KiB | 250 | 190 | |
vxlan_asymmetric.sh | H A D | 14-Dec-2022 | 17.6 KiB | 578 | 354 | |
vxlan_asymmetric_ipv6.sh | H A D | 31-May-2022 | 16 KiB | 505 | 312 | |
vxlan_bridge_1d.sh | H A D | 20-Sep-2024 | 20.4 KiB | 798 | 552 | |
vxlan_bridge_1d_ipv6.sh | H A D | 15-Jul-2024 | 21.3 KiB | 805 | 569 | |
vxlan_bridge_1d_port_8472.sh | H A D | 11-Jul-2019 | 172 | 11 | 5 | |
vxlan_bridge_1d_port_8472_ipv6.sh | H A D | 31-May-2022 | 188 | 12 | 6 | |
vxlan_bridge_1q.sh | H A D | 15-Jul-2024 | 22.9 KiB | 841 | 540 | |
vxlan_bridge_1q_ipv6.sh | H A D | 15-Jul-2024 | 24.3 KiB | 838 | 547 | |
vxlan_bridge_1q_port_8472.sh | H A D | 11-Jul-2019 | 172 | 11 | 5 | |
vxlan_bridge_1q_port_8472_ipv6.sh | H A D | 31-May-2022 | 188 | 12 | 6 | |
vxlan_symmetric.sh | H A D | 23-Feb-2021 | 18.1 KiB | 562 | 346 | |
vxlan_symmetric_ipv6.sh | H A D | 31-May-2022 | 18.3 KiB | 564 | 348 |
README
1Motivation 2========== 3 4One of the nice things about network namespaces is that they allow one 5to easily create and test complex environments. 6 7Unfortunately, these namespaces can not be used with actual switching 8ASICs, as their ports can not be migrated to other network namespaces 9(dev->netns_local) and most of them probably do not support the 10L1-separation provided by namespaces. 11 12However, a similar kind of flexibility can be achieved by using VRFs and 13by looping the switch ports together. For example: 14 15 br0 16 + 17 vrf-h1 | vrf-h2 18 + +---+----+ + 19 | | | | 20 192.0.2.1/24 + + + + 192.0.2.2/24 21 swp1 swp2 swp3 swp4 22 + + + + 23 | | | | 24 +--------+ +--------+ 25 26The VRFs act as lightweight namespaces representing hosts connected to 27the switch. 28 29This approach for testing switch ASICs has several advantages over the 30traditional method that requires multiple physical machines, to name a 31few: 32 331. Only the device under test (DUT) is being tested without noise from 34other system. 35 362. Ability to easily provision complex topologies. Testing bridging 37between 4-ports LAGs or 8-way ECMP requires many physical links that are 38not always available. With the VRF-based approach one merely needs to 39loopback more ports. 40 41These tests are written with switch ASICs in mind, but they can be run 42on any Linux box using veth pairs to emulate physical loopbacks. 43 44Guidelines for Writing Tests 45============================ 46 47o Where possible, reuse an existing topology for different tests instead 48 of recreating the same topology. 49o Tests that use anything but the most trivial topologies should include 50 an ASCII art showing the topology. 51o Where possible, IPv6 and IPv4 addresses shall conform to RFC 3849 and 52 RFC 5737, respectively. 53o Where possible, tests shall be written so that they can be reused by 54 multiple topologies and added to lib.sh. 55o Checks shall be added to lib.sh for any external dependencies. 56o Code shall be checked using ShellCheck [1] prior to submission. 57 581. https://www.shellcheck.net/ 59 60Customization 61============= 62 63The forwarding selftests framework uses a number of variables that 64influence its behavior and tools it invokes, and how it invokes them, in 65various ways. A number of these variables can be overridden. The way these 66overridable variables are specified is typically one of the following two 67syntaxes: 68 69 : "${VARIABLE:=default_value}" 70 VARIABLE=${VARIABLE:=default_value} 71 72Any of these variables can be overridden. Notably net/forwarding/lib.sh and 73net/lib.sh contain a number of overridable variables. 74 75One way of overriding these variables is through the environment: 76 77 PAUSE_ON_FAIL=yes ./some_test.sh 78 79The variable NETIFS is special. Since it is an array variable, there is no 80way to pass it through the environment. Its value can instead be given as 81consecutive arguments to the selftest: 82 83 ./some_test.sh swp{1..8} 84 85A way to customize variables in a persistent fashion is to create a file 86named forwarding.config in this directory. lib.sh sources the file if 87present, so it can contain any shell code. Typically it will contain 88assignments of variables whose value should be overridden. 89 90forwarding.config.sample is available in the directory as an example of 91how forwarding.config might look. 92