MCPcopy Create free account
hub / github.com/PasarGuard/node / createTestWireGuardWithUsers

Function createTestWireGuardWithUsers

backend/wireguard/integration_e2e_test.go:53–73  ·  view source on GitHub ↗
(t *testing.T, configJSON string, users []*common.User)

Source from the content-addressed store, hash-verified

51}
52
53func createTestWireGuardWithUsers(t *testing.T, configJSON string, users []*common.User) *WireGuard {
54 t.Helper()
55
56 wgConfig, err := NewConfig(configJSON)
57 if err != nil {
58 t.Fatalf("Failed to create WireGuard config: %v", err)
59 }
60
61 cfg := &config.Config{
62 LogBufferSize: 100,
63 StatsUpdateIntervalSeconds: 10,
64 StatsCleanupIntervalSeconds: 300,
65 }
66
67 wg, err := New(cfg, wgConfig, users)
68 if err != nil {
69 t.Fatalf("Failed to create WireGuard instance: %v", err)
70 }
71
72 return wg
73}
74
75func createTestWireGuard(t *testing.T, configJSON string) *WireGuard {
76 t.Helper()

Callers 2

createTestWireGuardFunction · 0.85

Calls 2

NewConfigFunction · 0.70
NewFunction · 0.70

Tested by

no test coverage detected