Home | History | Annotate | only in /external/linux-kselftest/tools/testing/selftests/net/forwarding
Up to higher level directory
NameDateSize
bridge_port_isolation.sh22-Oct-20202.3K
bridge_sticky_fdb.sh22-Oct-20201.1K
bridge_vlan_aware.sh22-Oct-20201.3K
bridge_vlan_unaware.sh22-Oct-20201.2K
config22-Oct-2020267
devlink_lib.sh22-Oct-20202.4K
forwarding.config.sample22-Oct-2020932
gre_multipath.sh22-Oct-20206.2K
lib.sh22-Oct-202018.5K
mirror_gre.sh22-Oct-20203.3K
mirror_gre_bound.sh22-Oct-20205.8K
mirror_gre_bridge_1d.sh22-Oct-20204.2K
mirror_gre_bridge_1d_vlan.sh22-Oct-20202.1K
mirror_gre_bridge_1q.sh22-Oct-20204K
mirror_gre_bridge_1q_lag.sh22-Oct-20207.1K
mirror_gre_changes.sh22-Oct-20205.7K
mirror_gre_flower.sh22-Oct-20202.8K
mirror_gre_lag_lacp.sh22-Oct-20207.3K
mirror_gre_lib.sh22-Oct-20202.5K
mirror_gre_neigh.sh22-Oct-20202.3K
mirror_gre_nh.sh22-Oct-20202.9K
mirror_gre_topo_lib.sh22-Oct-20203.4K
mirror_gre_vlan.sh22-Oct-20201.7K
mirror_gre_vlan_bridge_1q.sh22-Oct-20205.7K
mirror_lib.sh22-Oct-20202.7K
mirror_topo_lib.sh22-Oct-20202.7K
mirror_vlan.sh22-Oct-20202.2K
README22-Oct-20202.3K
router.sh22-Oct-20202.1K
router_bridge.sh22-Oct-20201.8K
router_bridge_vlan.sh22-Oct-20202K
router_broadcast.sh22-Oct-20204.9K
router_multipath.sh22-Oct-20208.2K
tc_actions.sh22-Oct-20204.3K
tc_chains.sh22-Oct-20204.8K
tc_common.sh22-Oct-2020468
tc_flower.sh22-Oct-20206.7K
tc_shblocks.sh22-Oct-20201.9K

README

      1 Motivation
      2 ==========
      3 
      4 One of the nice things about network namespaces is that they allow one
      5 to easily create and test complex environments.
      6 
      7 Unfortunately, these namespaces can not be used with actual switching
      8 ASICs, 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
     10 L1-separation provided by namespaces.
     11 
     12 However, a similar kind of flexibility can be achieved by using VRFs and
     13 by 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 
     26 The VRFs act as lightweight namespaces representing hosts connected to
     27 the switch.
     28 
     29 This approach for testing switch ASICs has several advantages over the
     30 traditional method that requires multiple physical machines, to name a
     31 few:
     32 
     33 1. Only the device under test (DUT) is being tested without noise from
     34 other system.
     35 
     36 2. Ability to easily provision complex topologies. Testing bridging
     37 between 4-ports LAGs or 8-way ECMP requires many physical links that are
     38 not always available. With the VRF-based approach one merely needs to
     39 loopback more ports.
     40 
     41 These tests are written with switch ASICs in mind, but they can be run
     42 on any Linux box using veth pairs to emulate physical loopbacks.
     43 
     44 Guidelines for Writing Tests
     45 ============================
     46 
     47 o Where possible, reuse an existing topology for different tests instead
     48   of recreating the same topology.
     49 o Tests that use anything but the most trivial topologies should include
     50   an ASCII art showing the topology.
     51 o Where possible, IPv6 and IPv4 addresses shall conform to RFC 3849 and
     52   RFC 5737, respectively.
     53 o Where possible, tests shall be written so that they can be reused by
     54   multiple topologies and added to lib.sh.
     55 o Checks shall be added to lib.sh for any external dependencies.
     56 o Code shall be checked using ShellCheck [1] prior to submission.
     57 
     58 1. https://www.shellcheck.net/
     59