summaryrefslogtreecommitdiff
path: root/tests/e2e/config_hotswap_test.go
AgeCommit message (Collapse)Author
11 daysrefactor: decouple namespace operations and improve test coverageJames O'Doherty
- 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.
12 daysclean up debugging prints and silence successful execution outputJames O'Doherty
- Remove leftover DEBUG prints from CLI and wireguard internal packages. - Silence stdout during successful command wrapping to ensure only the wrapped command's output is visible. - Redirect all warnings and internal errors to stderr. - Implement a verbose mode via `WG_WRAP_VERBOSE=1` to enable tunnel status messages. - Update E2E tests to use verbose mode for verification of tunnel lifecycle events. - Fix errcheck linting issue in wireguard.go and apply go fmt.
2026-05-29fix: resolve deadlocks, routing errors, and test timings in test suiteJames O'Doherty
- fix(cli): resolve Flock self-deadlock in ExecuteCommand cleanup by reusing the existing lockFile handle if already held during premature exit. - fix(wireguard): configure explicit default route destination (0.0.0.0/0 for IPv4 and ::/0 for IPv6) to avoid netlink "either Dst.IP, Src.IP or Gw must be set" error. - fix(wireguard): initialize the Tunnel return parameter in StartTunnel to prevent a nil pointer dereference. - test(e2e): fix argument ordering in waitForLifecycle to pass "test-lifecycle" first, and increase sleep duration of dummy processes to 1.0s to ensure reliable process persistence under race detection.
2026-05-29perf: optimize test suite execution and reduce pollingJames O'Doherty
- Added `test-lifecycle` CLI command to verify active session state. - Replaced manual filesystem polling and `time.Sleep` in E2E tests with `waitForLifecycle` synchronization. - Optimized `TestConfigHotSwap` by reducing artificial sleep durations. - Fixed linting issue (ST1023) in `internal/cli/cli.go`. These changes reduce total test execution time to under 15 seconds and improve the determinism of lifecycle verification.
2026-05-29feat: implement robust namespace lifecycle and resilience suiteJames O'Doherty
- Replace marker-file pinning with kernel bind-mount anchors for reliable namespace persistence. - Implement atomic "last-man-out" cleanup sequence using ProfileLock, preventing namespace leaks and race conditions. - Add comprehensive resilience test suite covering: - Crash recovery from stale runtime state. - Host network change stability. - Configuration hot-swap session persistence. - Resource exhaustion and high-churn lifecycle stress. - Align documentation and test expectations with rootless session-based persistence. - Fix argument integrity and isolation leaks. - Ensure 100% pass rate for all E2E and integration tests.