Commit Graph

3 Commits

Author SHA1 Message Date
flu0r1ne
6ef2b495ab Change B101->S101 to reflect flake8 2023-10-02 21:21:53 -05:00
flu0r1ne
4264e97e17 Fix flake8 linting
- Remove unused imports
- Search for ip executables in known locations
- Fix f-string
- Ignore assert warnings
2023-10-02 20:57:51 -05:00
flu0r1ne
42f5dcc46a 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.
2023-10-02 04:08:09 -05:00