]> git.ipfire.org Git - thirdparty/mtr.git/commit
Linux-Only Interface, Marking, and IP Unit Tests
authorflu0r1ne <flu0r1ne@flu0r1ne.net>
Mon, 2 Oct 2023 08:53:16 +0000 (03:53 -0500)
committerflu0r1ne <flu0r1ne@flu0r1ne.net>
Mon, 2 Oct 2023 09:08:09 +0000 (04:08 -0500)
commit42f5dcc46a8aa537175b8ac092af254efb1360cb
tree142ab3fd0466e10b1a39cca7b9734135f71daab2
parent74d312d7e67d002e184b37c7f278597ab06bf8e7
Linux-Only Interface, Marking, and IP Unit Tests

This commit introduces three unit tests focused on interface binding,
packet marking, and IP source address spoofing/selection. Each of these
tests builds upon the original `MtrPacketTest` base class. To evaluate
these network-dependent features, the tests utilize an emulated network
environment. To enable this, a small network emulation library, `netem`,
has been developed specifically for this purpose. `Netem` allows for the
creation of arbitrary network configurations for testing and can reliably
set up and clean up virtual network environments on Linux systems. The only
dependencies are `iproute2` and `libc`, which are generally pre-installed
on most Linux hosts.

The commit adds three tests that are expected to fail:

1. Interface Binding: Evaluates the capability of `mtr-packet` to bind to
   a specific interface.
2. Packet Marking: Assesses the ability of `mtr-packet` to apply a Linux
   networking mark (fwmark).
3. Source Address Selection: Tests `mtr-packet`'s ability to spoof or bind
   to a specified source address.
test/linux/netem.py [new file with mode: 0644]
test/linux/netemtests.py [new file with mode: 0644]