summaryrefslogtreecommitdiff
path: root/internal/wireguard/wireguard_test.go
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2025-05-06 10:31:57 +0200
committerJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2025-05-06 13:25:48 +0200
commit6b939462fb1064abd42e8cb8316700ec844172ea (patch)
treeb572daecdf0f25e3beec9883a8b7bb2522628212 /internal/wireguard/wireguard_test.go
parent347b20fc91505584bc9efbeca89590a411b95e79 (diff)
All: Remove ProxyGuard integration
This should be done in WireGuard-go or in case of a linux a small daemon
Diffstat (limited to 'internal/wireguard/wireguard_test.go')
-rw-r--r--internal/wireguard/wireguard_test.go25
1 files changed, 7 insertions, 18 deletions
diff --git a/internal/wireguard/wireguard_test.go b/internal/wireguard/wireguard_test.go
index bd68afb..5092320 100644
--- a/internal/wireguard/wireguard_test.go
+++ b/internal/wireguard/wireguard_test.go
@@ -8,7 +8,7 @@ import (
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)
-func TestConfigReplace(t *testing.T) {
+func TestConfig(t *testing.T) {
k, err := wgtypes.GeneratePrivateKey()
if err != nil {
t.Fatalf("Failed to generate key for wg config replace: %v", err)
@@ -16,7 +16,6 @@ func TestConfigReplace(t *testing.T) {
cases := []struct {
config string
- proxy string
want string
wantep string
werr string
@@ -24,10 +23,8 @@ func TestConfigReplace(t *testing.T) {
{
config: `
`,
- want: "",
- wantep: "",
- proxy: "",
- werr: "parsed ini is empty",
+ want: "",
+ werr: "parsed ini is empty",
},
{
config: `
@@ -48,9 +45,7 @@ PrivateKey = %s
[interface]
[interface2]
`, k.String()),
- wantep: "",
- proxy: "",
- werr: "",
+ werr: "",
},
{
config: `
@@ -73,23 +68,17 @@ DNS = 9.9.9.9,2620:fe::fe
[Peer]
PublicKey =
AllowedIPs = 0.0.0.0/0,::/0
-Endpoint = 127.0.0.1:1337
+ProxyEndpoint = https://vpn.example.org/example
`, k.String()),
- wantep: "https://vpn.example.org/example",
- proxy: "127.0.0.1:1337",
- werr: "",
+ werr: "",
},
}
for _, c := range cases {
- gcfg, gep, err := configReplace(c.config, k, c.proxy)
+ gcfg, err := Config(c.config, &k)
test.AssertError(t, err, c.werr)
if gcfg != c.want {
t.Fatalf("Got config: %s, not equal to config: %s", gcfg, c.want)
}
-
- if gep != c.wantep {
- t.Fatalf("Got endpoint: %s, not equal to endpoint: %s", gep, c.wantep)
- }
}
}