<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wg-wrap.git/tests/e2e/e2e_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: optimize file cleanups, propagate exit codes, and fix Makefile</title>
<updated>2026-05-29T23:21:49Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-29T23:21:49Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=70096b533d42b684ab13651aaae884047e01e43d'/>
<id>urn:sha1:70096b533d42b684ab13651aaae884047e01e43d</id>
<content type='text'>
- Unlink the temporary bootstrap launcher binary immediately after opening a read-only descriptor to it, then execute via `/proc/self/fd/&lt;fd&gt;` to ensure zero-disk footprint on execution.
- Unlink temporary `/tmp/resolvconf*` files immediately after successful bind-mounting over `/etc/resolv.conf`.
- Prune parent ephemeral profile directories when unpinning a namespace, leaving zero directories behind once empty.
- Propagate the exact exit status of the wrapped command to the host process using `errors.As` and `*exec.ExitError` instead of defaulting to exit code 1.
- Added E2E automated test `TestExitCodePropagation` to verify exit status delivery.
- Added the `$(BINARY)` target to `.PHONY` in the Makefile to delegate dependency tracking to Go's compiler cache, ensuring modified Go files are rebuilt during `make test`.
</content>
</entry>
<entry>
<title>feat(dns): implement unprivileged DNS isolation, precedence order, and profile configuration</title>
<updated>2026-05-29T23:14:11Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-29T23:14:11Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=284ed362550e1fccc62ecd876dbd3f4c8fc721e2'/>
<id>urn:sha1:284ed362550e1fccc62ecd876dbd3f4c8fc721e2</id>
<content type='text'>
Completed the remaining roadmap and documentation requirements by implementing robust unprivileged DNS management, completing the profile configuration subcommand, and resolving data-plane transition socket crashes.

Detailed changes:
- **DNS Isolation**: Implemented `ConfigureResolvConf` in `internal/wireguard/wireguard.go` to override `/etc/resolv.conf` within the unprivileged network/mount namespace. Transitioned the mount namespace to private propagation (`MS_PRIVATE`) and safely bind-mounted a temporary resolv.conf file over `/etc/resolv.conf` without mutating the host's configuration.
- **DNS Precedence Order**: Integrated CLI flag `--dns-server`, parsed `.conf` interface DNS parameters, and added a safe default fallback (`1.1.1.1`) to ensure absolute host DNS leak prevention inside wrapped sessions.
- **Socket Duplication in FDBind**: Resolved a lifecycle panic in `FDBind` where `wireguard-go` called `Close` and `Open` during device state transitions, causing "use of closed network connection" errors. Implemented file descriptor duplication using `unix.Dup` during bind initialization to gracefully persist the host-socket context across interface transitions and allow clean exit synchronization.
- **Profile Configuration**: Implemented `handleProfileConfigure` in `internal/cli/cli.go` to launch the default system `$EDITOR` (falling back to `vi`) on a profile, satisfying the documentation's requirements.
- **Hermetic Testing Polish**:
  - Created `dns_helpers.go` providing a `MockDNSServer` packet probe.
  - Added E2E tests for unprivileged DNS resolution, data-plane UDP handshake transmission, and 3-way DNS precedence routing.
  - Refactored `TestNamespaceLifecycleAutomation`, `TestConfigPropagation`, and `TestMTUFragmentation` to use default profile fallbacks, fixing failing stats on missing profiles.
  - Resolved all `golangci-lint` and `go fmt` warnings to maintain a completely clean static analysis pipeline.
</content>
</entry>
<entry>
<title>feat: implement userspace wireguard data-path and unprivileged host fd-passing</title>
<updated>2026-05-29T22:29:12Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-29T22:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=ee2f5d545825752af63da36e2b9ec7a92985a875'/>
<id>urn:sha1:ee2f5d545825752af63da36e2b9ec7a92985a875</id>
<content type='text'>
- Implement complete rootless network namespace bootstrap via C launcher using unshare(CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWNET).
- Resolve unprivileged network isolation blackhole via host-socket preservation (FD passing): open client UDP sockets on the host pre-isolation, clear O_CLOEXEC, and ingest them via custom `FDBind` inside the sandbox.
- Implement isolated routing table automation over `tun0` (addresses, MTU, default routes).
- Implement persistent, multi-process namespace sharing and joining using reference-counted PID files and the setns system call.
- Write robust, self-contained E2E data plane test suites in `tests/e2e/e2e_test.go` using a mock UDP listener.
- Update project documentation (`README.md` and `AGENTS.md`) to reflect completed milestones.
- Ensure 100% test passing rate and zero lint/staticcheck warnings.
</content>
</entry>
<entry>
<title>Implement automatic namespace lifecycle cleanup with last-man-out reference counting</title>
<updated>2026-05-22T15:12:21Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-22T15:12:21Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=3b56ccecf46b83fa9b0e4b6c54be6ffda395910c'/>
<id>urn:sha1:3b56ccecf46b83fa9b0e4b6c54be6ffda395910c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Security hardening: prevent shell injection and null-byte crashes, implement 8-bit clean argument fuzzing and portable E2E binary discovery</title>
<updated>2026-05-22T14:46:02Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-22T14:46:02Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=9131b0004e7c640cc028179e1d049a4c62210d94'/>
<id>urn:sha1:9131b0004e7c640cc028179e1d049a4c62210d94</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat: implement rootless network isolation bootstrap and C launcher</title>
<updated>2026-05-22T14:05:38Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-22T14:05:38Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=764d3e67fc783c487f42d398d1b85a5a1f0d8ef0'/>
<id>urn:sha1:764d3e67fc783c487f42d398d1b85a5a1f0d8ef0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refactor CLI for testability and implement hermetic config path injection</title>
<updated>2026-05-22T13:18:55Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-22T13:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=96d75d9f1fab87365d7e6b5070eed3a5757c3484'/>
<id>urn:sha1:96d75d9f1fab87365d7e6b5070eed3a5757c3484</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Scaffold wg-wrap project structure and toolchain</title>
<updated>2026-05-22T13:13:16Z</updated>
<author>
<name>James O'Doherty</name>
<email>james@theodohertyfamily.com</email>
</author>
<published>2026-05-22T13:13:16Z</published>
<link rel='alternate' type='text/html' href='https://git.theodohertyfamily.com/wg-wrap.git/commit/?id=756ba94292b408cc4f23d137b2c4c52009b2b38d'/>
<id>urn:sha1:756ba94292b408cc4f23d137b2c4c52009b2b38d</id>
<content type='text'>
</content>
</entry>
</feed>
