Skip to content

Conversation

Copy link

Copilot AI commented Nov 19, 2025

Automates network interface validation and enables testing with custom IPv6 configurations. Currently tests just print addresses without validation; CI lacks IPv6 coverage.

Changes

Virtual Interface Management (tests/setup_virtual_interfaces.sh)

  • Creates/destroys dummy interfaces with multiple IPv4/IPv6 addresses (global unicast, ULA, link-local)
  • Exports system interfaces to CSV-based config format for test validation

Validation Framework (tests/InterfaceParser.hpp)

  • Parses interface config files and validates detected addresses against expected
  • Optional via NETIF_EXPECTED_INTERFACES env var—backward compatible

Docker Testing Environment

  • Dockerfile, docker-compose.yml, docker-entrypoint.sh for isolated testing
  • Privileged mode creates virtual interfaces, runs tests with validation

Test Updates (tests/GetAddressTests.cpp)

  • Added validation when expected interfaces provided
  • New test case for getInterfaceAddressesAll()

Usage

# Local testing with virtual interfaces
sudo ./tests/setup_virtual_interfaces.sh setup
./tests/setup_virtual_interfaces.sh export expected.txt
NETIF_EXPECTED_INTERFACES=expected.txt ctest

# Or use Docker
docker-compose -f tests/docker-compose.yml up netif-test

Interface Config Format

# interface_name,ipv4_addrs,ipv6_addrs
dummy0,192.168.100.1;192.168.100.2,2001:db8::1;fd00::1
lo,127.0.0.1,::1

See tests/README.md for CI integration examples and platform notes.

Original prompt

This section details on the original issue you should resolve

<issue_title>Create test environment that allows adding "fake" network adapters</issue_title>
<issue_description>Currently the CI tests just print out the IP addresses found using netif, then ifconfig is ran to output the network adapters present -- making sure they match is a manual process that should be automated by taking in a list of expected interfaces (perhaps provided by ifconfig or ipconfig in an earlier step, parsed into an easier to read "standard" file format that is easy to read and parse for the CI tests).

However, oftentimes the adapters present on CI VMs lack IPv6 addresses, and just in general the ability to add a bunch of different interfaces for testing corner cases could be useful. We can then use that same mechanism of passing the tests the interfaces we know must exist due to having created them in our "fake" network environment.

Using https://mininet.org/ could be an option to consider for Linux, or Docker compose. Not sure about Windows or macOS.

The results of this setup could directly be used to help inform an approach for GMLC-TDC/HELICS#98 eventually.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Nov 19, 2025
Copilot AI changed the title [WIP] Create test environment for fake network adapters Add virtual network interface testing framework with Docker support Nov 19, 2025
Copilot AI requested a review from nightlark November 19, 2025 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create test environment that allows adding "fake" network adapters

2 participants