Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Multi-Port Network Namespaces #799

Merged
merged 10 commits into from
Nov 5, 2024
Merged

test: Multi-Port Network Namespaces #799

merged 10 commits into from
Nov 5, 2024

Commits on Nov 4, 2024

  1. test: pcap: Avoid creating dumpcap zombies

    Story time:
    
    In the days of yore, we generated PCAPs using tcpdump, which will
    flush any buffered packets to its output file on reception of
    SIGUSR2. Therefore we sent a USR2 before terminating the capture.
    
    At some point, we switched over to use tshark to capture packets for
    us, but the SIGUSR2 sayed in place.
    
    It turns out, tshark will just die on USR2, abandoning the dumpcap
    child it has created, which means the enclosing network namespace
    can't be properly torn down.
    
    Therefore:
    
    Remove skip sending USR2 and just send TERM directly.
    wkz committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    17403af View commit details
    Browse the repository at this point in the history
  2. test: netns: Generalize IsolatedMacVlan to support multiple interfaces

    This is needed to create namespaces with MACVLANs from different
    parent interfaces. The first consumer will be a Two-Port Mac
    Relay (TPMR), so that we can control the flow of packets between two
    nodes.
    wkz committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    f9e430e View commit details
    Browse the repository at this point in the history
  3. test: netns: Use passthru mode for MACVLANs

    This mode let's us receive all packets from the parent device, which
    is automatically set in promiscuous mode, and let's the MACVLAN
    transmit packets with any SA, which we need to implement a TPMR (or a
    bridge or anything else we might dream up)
    wkz committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    3031bba View commit details
    Browse the repository at this point in the history
  4. test: netns: Clean up lingering namespaces on test exit

    This gets rid of annoying "Address already in use" errors when running
    tests repeatedly from a test-sh.
    wkz committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    2a6e440 View commit details
    Browse the repository at this point in the history
  5. test: netns: Guard against "double free" when failing to setup netns

    When used as a context manager, __exit__ will be called even though
    __enter__ might throw an exception half way through. So there is no
    guarantee that the instance is on the cleanup list when we get to
    stop().
    wkz committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    a4a4a49 View commit details
    Browse the repository at this point in the history
  6. test: netns: Poll for MACVLAN removal completion

    Now that we're using the `passthru` mode of MACVLANs, it seems we can
    rely on the parent interface's promiscuity going down to 0 as an
    indication that the kernel has completed the removal of the interface,
    and will accept the creation of a new one.
    wkz committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    be828d4 View commit details
    Browse the repository at this point in the history
  7. test: netns: Add Two-Port MAC Relay (TPMR)

    This is a specialized namespace, containing two ports,
    which (hopefully) acts as completely transparent "bump-on-the-wire"
    bridge.
    
    Useful in scenarios where you want to test what happens when the flow
    of packets between two nodes is disrupted. E.g., for testing fail-over
    behavior in dynamic routing protocols, L2 redundancy, VRRP etc.
    wkz committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    dc92db4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    7f2f376 View commit details
    Browse the repository at this point in the history
  9. test: vlan_ping: Improve test step description and structure

    Initially done as a workaround for the MACVLAN create/remove race. But
    even though the old version of this test now works, this refactor
    provides better test step descriptions, making it easier to follow for
    anyone looking to manually verify the functionality.
    wkz committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    96d200f View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. Configuration menu
    Copy the full SHA
    56abfde View commit details
    Browse the repository at this point in the history