Skip to content

Fix issues that prevent using RawNetworkInterfaceDriver's network namespace feature#1887

Open
nick-potenski wants to merge 2 commits into
labgrid-project:masterfrom
nick-potenski:fix-network-namespace
Open

Fix issues that prevent using RawNetworkInterfaceDriver's network namespace feature#1887
nick-potenski wants to merge 2 commits into
labgrid-project:masterfrom
nick-potenski:fix-network-namespace

Conversation

@nick-potenski

Copy link
Copy Markdown
Contributor

Description

Fixes several issues encountered when trying to use RawNetworkInterfaceDriver's setup_netns() method.

First, older version of iproute2 do not include the -echo option. When trying to use labgrid-raw-interface on a exporter running Ubuntu 22, this would lead to failures when trying to create the macvtap.

Second, the -m mounts option was still being passed to the nsenter call by the netns agent script even though mount namespace support was dropped by bcfed98. This would result in failure like the following when trying to setup the namespace:

nsenter: reassociate to namespace 'ns/mnt' failed: Operation not permitted

Checklist

  • PR has been tested

Removes the '-m' option from the nsenter call in the netns.py agent.
The option should have been removed by
bcfed98, but was missed.  This is
necessary to allow the network namespace support to work without admin
privileges.

Signed-off-by: Nick Potenski <nick.potenski@garmin.com>
@nick-potenski

Copy link
Copy Markdown
Contributor Author

With these changes, I am now able to setup and use a network namespace in our Labgrid system.

I didn't file bug reports for these, but I can do so for tracking if you would like.

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 46.0%. Comparing base (915b591) to head (fb5a15b).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/util/agents/netns.py 0.0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1887   +/-   ##
======================================
  Coverage    46.0%   46.0%           
======================================
  Files         180     180           
  Lines       14464   14464           
======================================
  Hits         6654    6654           
  Misses       7810    7810           
Flag Coverage Δ
3.10 46.0% <0.0%> (ø)
3.11 46.0% <0.0%> (ø)
3.12 46.0% <0.0%> (ø)
3.13 45.9% <0.0%> (ø)
3.14 45.9% <0.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@Emantor Emantor requested a review from jluebbe June 5, 2026 12:04
Comment thread helpers/labgrid-raw-interface
Emantor
Emantor previously approved these changes Jun 9, 2026

@Emantor Emantor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me aside from the nit.

Versions of iproute2 older than 6.0.0, such as those shipped with Ubuntu
22, do not support the '-echo' option.  Rewrites the
labgrid-raw-interface's handle_ns_macvtap() method to no longer rely on
echoing back the result of the 'ip link add' command to determine the
new interface name.

Signed-off-by: Nick Potenski <nick.potenski@garmin.com>
@nick-potenski

Copy link
Copy Markdown
Contributor Author

I would appreciate if these changes could be added to the 26.x branch as well.

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.

2 participants