Name Date Size

..25-Oct-20244 KiB

.gitignoreH A D25-Oct-202458

bridge_igmp.shH A D25-Oct-202414.7 KiB

bridge_locked_port.shH A D25-Oct-20249.2 KiB

bridge_mdb.shH A D25-Oct-202438.7 KiB

bridge_mdb_host.shH A D25-Oct-20241.7 KiB

bridge_mdb_max.shH A D25-Oct-202430 KiB

bridge_mdb_port_down.shH A D25-Oct-20242.2 KiB

bridge_mld.shH A D25-Oct-202416.2 KiB

bridge_port_isolation.shH A D25-Oct-20242.3 KiB

bridge_sticky_fdb.shH A D25-Oct-20241.1 KiB

bridge_vlan_aware.shH A D25-Oct-20242.5 KiB

bridge_vlan_mcast.shH A D25-Oct-202416.7 KiB

bridge_vlan_unaware.shH A D25-Oct-20241.2 KiB

configH A D25-Oct-20241.2 KiB

custom_multipath_hash.shH A D25-Oct-20249.8 KiB

devlink_lib.shH A D25-Oct-202412.8 KiB

dual_vxlan_bridge.shH A D25-Oct-202411.2 KiB

ethtool.shH A D25-Oct-20246.6 KiB

ethtool_extended_state.shH A D25-Oct-20242.1 KiB

ethtool_lib.shH A D25-Oct-20242.7 KiB

ethtool_mm.shH A D25-Oct-20246.3 KiB

fib_offload_lib.shH A D25-Oct-202424.6 KiB

forwarding.config.sampleH A D25-Oct-20241.4 KiB

gre_custom_multipath_hash.shH A D25-Oct-202412.5 KiB

gre_inner_v4_multipath.shH A D25-Oct-20247.5 KiB

gre_inner_v6_multipath.shH A D25-Oct-20247.7 KiB

gre_multipath.shH A D25-Oct-20246.3 KiB

gre_multipath_nh.shH A D25-Oct-20249.1 KiB

gre_multipath_nh_res.shH A D25-Oct-20249.3 KiB

hw_stats_l3.shH A D25-Oct-20247.5 KiB

hw_stats_l3_gre.shH A D25-Oct-20241.7 KiB

ip6_forward_instats_vrf.shH A D25-Oct-20243 KiB

ip6gre_custom_multipath_hash.shH A D25-Oct-202412.7 KiB

ip6gre_flat.shH A D25-Oct-2024876

ip6gre_flat_key.shH A D25-Oct-2024907

ip6gre_flat_keys.shH A D25-Oct-2024944

ip6gre_hier.shH A D25-Oct-2024937

ip6gre_hier_key.shH A D25-Oct-2024969

ip6gre_hier_keys.shH A D25-Oct-20241,003

ip6gre_inner_v4_multipath.shH A D25-Oct-20247.8 KiB

ip6gre_inner_v6_multipath.shH A D25-Oct-20247.9 KiB

ip6gre_lib.shH A D25-Oct-202413.9 KiB

ipip_flat_gre.shH A D25-Oct-2024838

ipip_flat_gre_key.shH A D25-Oct-2024860

ipip_flat_gre_keys.shH A D25-Oct-2024886

ipip_hier_gre.shH A D25-Oct-2024887

ipip_hier_gre_key.shH A D25-Oct-2024910

ipip_hier_gre_keys.shH A D25-Oct-2024938

ipip_lib.shH A D25-Oct-20248.4 KiB

lib.shH A D25-Oct-202438.3 KiB

local_termination.shH A D25-Oct-20246.1 KiB

loopback.shH A D25-Oct-20241.6 KiB

MakefileH A D25-Oct-20242.9 KiB

mirror_gre.shH A D25-Oct-20243.3 KiB

mirror_gre_bound.shH A D25-Oct-20245.8 KiB

mirror_gre_bridge_1d.shH A D25-Oct-20244.4 KiB

mirror_gre_bridge_1d_vlan.shH A D25-Oct-20242.7 KiB

mirror_gre_bridge_1q.shH A D25-Oct-20244.3 KiB

mirror_gre_bridge_1q_lag.shH A D25-Oct-20247.3 KiB

mirror_gre_changes.shH A D25-Oct-20245.7 KiB

mirror_gre_flower.shH A D25-Oct-20242.8 KiB

mirror_gre_lag_lacp.shH A D25-Oct-20247.3 KiB

mirror_gre_lib.shH A D25-Oct-20242.5 KiB

mirror_gre_neigh.shH A D25-Oct-20242.3 KiB

mirror_gre_nh.shH A D25-Oct-20242.9 KiB

mirror_gre_topo_lib.shH A D25-Oct-20243.4 KiB

mirror_gre_vlan.shH A D25-Oct-20241.7 KiB

mirror_gre_vlan_bridge_1q.shH A D25-Oct-20249 KiB

mirror_lib.shH A D25-Oct-20242.9 KiB

mirror_topo_lib.shH A D25-Oct-20242.7 KiB

mirror_vlan.shH A D25-Oct-20242.3 KiB

no_forwarding.shH A D25-Oct-20245.5 KiB

pedit_dsfield.shH A D25-Oct-20246.7 KiB

pedit_ip.shH A D25-Oct-20244.4 KiB

pedit_l4port.shH A D25-Oct-20244.5 KiB

q_in_vni.shH A D25-Oct-202410.7 KiB

q_in_vni_ipv6.shH A D25-Oct-202410.9 KiB

READMEH A D25-Oct-20242.3 KiB

router.shH A D25-Oct-20247.3 KiB

router_bridge.shH A D25-Oct-20244 KiB

router_bridge_1d.shH A D25-Oct-20245.1 KiB

router_bridge_1d_lag.shH A D25-Oct-20249.3 KiB

router_bridge_lag.shH A D25-Oct-20246.8 KiB

router_bridge_pvid_vlan_upper.shH A D25-Oct-20243.5 KiB

router_bridge_vlan.shH A D25-Oct-20245.5 KiB

router_bridge_vlan_upper.shH A D25-Oct-20243.9 KiB

router_bridge_vlan_upper_pvid.shH A D25-Oct-20243.7 KiB

router_broadcast.shH A D25-Oct-20245 KiB

router_mpath_nh.shH A D25-Oct-20249.6 KiB

router_mpath_nh_res.shH A D25-Oct-202410 KiB

router_multicast.shH A D25-Oct-202414.6 KiB

router_multipath.shH A D25-Oct-20248.3 KiB

router_nh.shH A D25-Oct-20242.6 KiB

router_vid_1.shH A D25-Oct-20243.5 KiB

sch_ets.shH A D25-Oct-2024781

sch_ets_core.shH A D25-Oct-20247.3 KiB

sch_ets_tests.shH A D25-Oct-20243.9 KiB

sch_red.shH A D25-Oct-202411.1 KiB

sch_tbf_core.shH A D25-Oct-20245 KiB

sch_tbf_ets.shH A D25-Oct-2024118

sch_tbf_etsprio.shH A D25-Oct-20241.4 KiB

sch_tbf_prio.shH A D25-Oct-2024118

sch_tbf_root.shH A D25-Oct-2024489

settingsH A D25-Oct-202410

skbedit_priority.shH A D25-Oct-20243.9 KiB

tc_actions.shH A D25-Oct-20247.9 KiB

tc_chains.shH A D25-Oct-20244.8 KiB

tc_common.shH A D25-Oct-2024721

tc_flower.shH A D25-Oct-202421.2 KiB

tc_flower_cfm.shH A D25-Oct-20244.9 KiB

tc_flower_l2_miss.shH A D25-Oct-20249.1 KiB

tc_flower_port_range.shH A D25-Oct-20245.9 KiB

tc_flower_router.shH A D25-Oct-20243 KiB

tc_mpls_l2vpn.shH A D25-Oct-20245 KiB

tc_police.shH A D25-Oct-202411.8 KiB

tc_shblocks.shH A D25-Oct-20242.7 KiB

tc_tunnel_key.shH A D25-Oct-20243.8 KiB

tc_vlan_modify.shH A D25-Oct-20243.2 KiB

tsn_lib.shH A D25-Oct-20245.5 KiB

vxlan_asymmetric.shH A D25-Oct-202417.6 KiB

vxlan_asymmetric_ipv6.shH A D25-Oct-202416 KiB

vxlan_bridge_1d.shH A D25-Oct-202420.4 KiB

vxlan_bridge_1d_ipv6.shH A D25-Oct-202421.3 KiB

vxlan_bridge_1d_port_8472.shH A D25-Oct-2024172

vxlan_bridge_1d_port_8472_ipv6.shH A D25-Oct-2024188

vxlan_bridge_1q.shH A D25-Oct-202422.9 KiB

vxlan_bridge_1q_ipv6.shH A D25-Oct-202424.3 KiB

vxlan_bridge_1q_port_8472.shH A D25-Oct-2024172

vxlan_bridge_1q_port_8472_ipv6.shH A D25-Oct-2024188

vxlan_symmetric.shH A D25-Oct-202418.1 KiB

vxlan_symmetric_ipv6.shH A D25-Oct-202418.3 KiB

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(NETIF_F_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