From 756ba94292b408cc4f23d137b2c4c52009b2b38d Mon Sep 17 00:00:00 2001 From: James O'Doherty Date: Fri, 22 May 2026 09:13:16 -0400 Subject: Scaffold wg-wrap project structure and toolchain --- internal/namespace/namespace_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 internal/namespace/namespace_test.go (limited to 'internal/namespace') diff --git a/internal/namespace/namespace_test.go b/internal/namespace/namespace_test.go new file mode 100644 index 0000000..cfa0e9b --- /dev/null +++ b/internal/namespace/namespace_test.go @@ -0,0 +1,24 @@ +//go:build linux && integration + +package namespace + +import ( + "testing" +) + +func TestNamespaceCreation(t *testing.T) { + t.Log("Integration Test: Verifying CLONE_NEWUSER and CLONE_NEWNET syscalls") + // TODO: Verify that unshare creates a new network namespace + // TODO: Verify that the process has root privileges inside the namespace +} + +func TestNamespacePinning(t *testing.T) { + t.Log("Integration Test: Verifying bind-mount of namespace to /run/user/$UID/wg-wrap/") + // TODO: Verify that the namespace survives after the process exits + // TODO: Verify that we can re-join the namespace via setns +} + +func TestRoutingSetup(t *testing.T) { + t.Log("Integration Test: Verifying TUN device creation and IP routing table setup") + // TODO: Mock 'ip' command or use netlink to verify route exists +} -- cgit v1.2.3