Skip to content

test: fix network namespace setup and cleanup - #50

Merged
thaJeztah merged 1 commit into
moby:mainfrom
thaJeztah:rm_ns_dep
Oct 15, 2026
Merged

thaJeztah merged 1 commit into
moby:mainfrom
thaJeztah:rm_ns_dep

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Remove the dependency on the legacy ns package, which initializes additional netlink handles and attempts to load kernel modules that are not needed by the IPVS tests. It also logs initialization errors instead of returning them to the caller.

Manage the test network namespace directly instead:

  • Restore the original namespace during teardown.
  • Balance OS thread locking and unlocking.
  • Handle namespace setup and restoration errors.

Remove the dependency on the legacy ns package, which initializes
additional netlink handles and attempts to load kernel modules that
are not needed by the IPVS tests. It also logs initialization errors
instead of returning them to the caller.

Manage the test network namespace directly instead:

- Restore the original namespace during teardown.
- Balance OS thread locking and unlocking.
- Handle namespace setup and restoration errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The namespace and OS-thread lifecycle is correctly handled across setup, teardown, and failure paths.

0 open findings

What changed in this PR

Reworks Linux test namespace management to avoid the legacy ns package and reliably restore thread state.

Changes:

  • Captures and restores the original network namespace.
  • Balances OS-thread locking across success and failure paths.
  • Reports namespace setup and restoration failures.
File Description
ipvs_linux_test.go Implements direct, error-aware test namespace lifecycle management.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@thaJeztah
thaJeztah merged commit b81d939 into moby:main Oct 15, 2026
5 checks passed
@thaJeztah
thaJeztah deleted the rm_ns_dep branch October 15, 2026 20:52
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