<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wg-wrap.git/tests/e2e/sharing_test.go, branch main</title>
<subtitle>wg-wrap runs commands in network namespaces configured with userspace wireguard tunnels.
</subtitle>
<id>https://git.theodohertyfamily.com/wg-wrap.git/atom?h=main</id>
<link rel='self' href='https://git.theodohertyfamily.com/wg-wrap.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/'/>
<updated>2026-06-08T02:57:34Z</updated>
<entry>
<title>feat(cli): introduce explicit run/exec subcommands to prevent typo-execution</title>
<updated>2026-06-08T02:57:34Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-06-08T02:57:34Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=f8afb7d5889f5c8b6ea256fd078fa8426d21c7be'/>
<id>urn:sha1:f8afb7d5889f5c8b6ea256fd078fa8426d21c7be</id>
<content type='text'>
Prevent the ambiguity where a mistyped subcommand was interpreted as the target
wrapped process.

- Introduce `run` and `exec` (alias) subcommands for launching wrapped processes.
- Promote internal test commands (`test-ns`, `test-args`, `test-lifecycle`) to explicit subcommands.
- Update CLI routing to return an error for unknown subcommands instead of falling back to the default execution path.
- Update `README.md` usage examples and all test suites to use the new subcommand structure.
</content>
</entry>
<entry>
<title>refactor: decouple namespace operations and improve test coverage</title>
<updated>2026-06-05T02:57:35Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-06-05T02:57:35Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=04dca5dada8c2d971ff3b54eeedc5ab6e53a29ac'/>
<id>urn:sha1:04dca5dada8c2d971ff3b54eeedc5ab6e53a29ac</id>
<content type='text'>
- Introduce `namespace.Ops` interface to decouple `Manager` from system-level namespace operations, enabling easier unit testing via mocks.
- Add unit tests for `internal/paths` to verify path resolution logic across different environment configurations.
- Implement `EnsureBinary` helper in E2E tests to gracefully skip tests when `WG_WRAP_BIN` is not set, allowing `go test ./...` to pass in non-build environments.
- Apply project-wide formatting and fix linting issues.
</content>
</entry>
<entry>
<title>Refactor rootless namespace joining to use C launcher</title>
<updated>2026-05-30T00:11:07Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-30T00:11:07Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=4ddd0d2ffc7073f2d55ffb6777e3a168af0051f0'/>
<id>urn:sha1:4ddd0d2ffc7073f2d55ffb6777e3a168af0051f0</id>
<content type='text'>
Fix an architectural shortfall where concurrent sessions failed to share
the target network and mount namespaces. Because the Go runtime is
multi-threaded, calling unix.Setns with CLONE_NEWNS from Go always returned
EINVAL, silently forcing concurrent runs to fall back to bootstrapping separate
isolated namespaces and separate WireGuard connections.

This commit resolves the issue by extending the embedded single-threaded C
launcher to handle namespace joining, and introducing a host-to-isolated path
propagation pattern:

1. Launcher setns Support: The C launcher now checks for WG_WRAP_JOIN_PID in
   the environment. If present, it joins the User, Mount, and Network
   namespaces of the active PID in single-threaded mode before executing the Go
   binary.
2. BootstrapJoin Integration: Implemented namespace.BootstrapJoin to
   transition joining sessions via the launcher.
3. Path Preservation: Export WG_WRAP_HOST_RUNTIME_BASE_DIR from the host to ensure
   the isolated instance maps the profile and PID directories to the exact
   same location.
4. Redundant Tunnel Bypass: Detect joined sessions via WG_WRAP_JOINED=1 in the CLI
   and bypass starting a duplicate WireGuard tunnel on the occupied tun0.
5. Testing: Added tests/e2e/sharing_test.go to assert namespace ID equality,
   which now passes successfully.
6. Git Tracking: Fixed .gitignore overmatch to stop ignoring cmd/wg-wrap/.
</content>
</entry>
</feed>
