Skip to content

Support for libremesh wifi simulation#212

Open
francoriba wants to merge 5 commits intoaparcar:mainfrom
fcefyn-testbed:feat/libremesh-wifi-simulation
Open

Support for libremesh wifi simulation#212
francoriba wants to merge 5 commits intoaparcar:mainfrom
fcefyn-testbed:feat/libremesh-wifi-simulation

Conversation

@francoriba
Copy link
Copy Markdown
Contributor

Sending to upstream last VGDSpehar's contributions for libremesh done in https://github.com/VGDSpehar/openwrt-tests-libremesh/tree/libremesh-wifi-simulation

Add QEMU x86-64 target configuration for LibreMesh testing with
virtualized WiFi (vwifi/mac80211_hwsim). This enables testing
LibreMesh features in a simulated mesh network environment.

Features:
- hwsim and libremesh feature flags for test filtering
- Dual network interface (WAN + LAN) setup
- Uses QEMUNetworkStrategy for network management
Add new Makefile target 'x86-64-libremesh' for running LibreMesh tests
in QEMU x86-64 with vwifi support for mesh simulation.

Usage:
  make tests/x86-64-libremesh FIRMWARE=/path/to/libremesh.img.gz
Add upload_vwifi fixture and helper functions for testing LibreMesh
in a virtualized WiFi mesh network using vwifi and mac80211_hwsim.

New features:
- _host_ipv4_from_hostname_I(): Robust IPv4 detection for vwifi-client
- upload_vwifi fixture: Uploads vwifi-client to VM, configures
  mac80211_hwsim, connects to host's vwifi-server, and waits for
  mesh interface establishment

Prerequisites:
- vwifi-server running on the host
- vwifi-client binary in vwifi/ directory
Add test_bat_links_info test for verifying LibreMesh shared-state-async
bat_links_info functionality in a virtualized mesh network.

The test verifies that:
- shared-state-async can publish and sync bat_links_info
- All expected mesh nodes are visible in the shared state
- Links between the test node and other nodes are recorded

Requires @pytest.mark.lg_feature('libremesh') for filtering.
@francoriba francoriba changed the title Feat/libremesh wifi simulation Support for libremesh wifi simulation Jan 18, 2026
Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
@ilario
Copy link
Copy Markdown

ilario commented Mar 18, 2026

@aparcar which folder and which naming should we use for the tests that are LibreMesh-specific? Is it ok if we merge them here? In this pull request, the tests are being pushed to tests/test_libremesh_... that seems not the best way to me, as pytest will always run them, right?

@VGDSpehar is going to take care of updating this code with another pull request, I think

Comment thread tests/conftest.py


@pytest.fixture
def upload_vwifi(shell_command, target):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could make this more generic? We may want to upload more things for more tests in the future, not specifically vwifi related

logger = logging.getLogger(__name__)


def _join_stdout(stdout):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a generic function which could move to conftest?

Comment thread Makefile
--lg-env $(TESTSDIR)/targets/qemu_x86-64.yaml \
--firmware $(FIRMWARE:.gz=)

# LibreMesh x86-64 target with vwifi support for mesh simulation
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could drop this extra target and instead point it to a libremesh image with the extra "libremesh" tag?

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.

3 participants