Skip to content

munet: explicit user config errors + shorten network veth naming convention - #103

Open
liambrady wants to merge 2 commits into
LabNConsulting:mainfrom
liambrady:liambrady/net_intf_name_reduction
Open

liambrady wants to merge 2 commits into
LabNConsulting:mainfrom
liambrady:liambrady/net_intf_name_reduction

Conversation

@liambrady

Copy link
Copy Markdown
Contributor

Migrates numerous assert-based config checks to the new MunetConfigError exception type. Such exceptions contain a short user-oriented error message to guide the user to a fix. Importantly, tracebacks are suppressed wherever this exception type is caught (in order to simplify the output for the user).

Shortens the network veth naming convention such that invalid internal interface names are less likely to be generated. This allows for bridge names to be <= 15 chars instead of the previous effective limit <=12. A MunetConfigError is raised if the bridge name is configured to be >= 16 chars.

Note: fully uncapping the bridge name limitation is out of scope of this PR and requires more investigation.

Config-related errors are raised using a unique error type. Config
errors include a brief user-oriented description of what is incorrect
or unexpected. Backtraces are NOT printed when this error type is
caught.

Signed-off-by: Liam Brady <lbrady@labn.net>
Derive network-side veth end names from the bridge id (NOT the name).
This fixes the error where the topology fails to build under
sufficiently long network names.

This is because the veth ends were always 3+ chars longer than the
network name (NETNAME"-e0"). A valid 15 char network name would
result in an invalid 18 char veth name.

Signed-off-by: Liam Brady <lbrady@labn.net>
@liambrady
liambrady requested a review from choppsv1 November 18, 2026 20:52
@liambrady liambrady added the bug Something isn't working label Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.04082% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.30%. Comparing base (e7ed4d5) to head (21c41c8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
munet/native.py 45.28% 29 Missing ⚠️
munet/base.py 63.15% 7 Missing ⚠️
munet/__main__.py 0.00% 4 Missing ⚠️
munet/parser.py 50.00% 4 Missing ⚠️
munet/config.py 75.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
- Coverage   60.55%   60.30%   -0.25%     
==========================================
  Files          19       20       +1     
  Lines        5990     6044      +54     
==========================================
+ Hits         3627     3645      +18     
- Misses       2363     2399      +36     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant