summaryrefslogtreecommitdiff
path: root/client/proxy_test.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-10-23 11:31:39 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-10-29 12:08:36 +0100
commite85070a3fb601e1872d121ce3c1c9d39f8f41036 (patch)
tree96d57bf647f2cdc3408ad5c3163ca91ed571cb63 /client/proxy_test.go
parent0076386bca8b1e49673f50323cd147ac080cfc2f (diff)
All: Refactor to latest ProxyGuard
Diffstat (limited to 'client/proxy_test.go')
-rw-r--r--client/proxy_test.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/client/proxy_test.go b/client/proxy_test.go
deleted file mode 100644
index ddb0c4f..0000000
--- a/client/proxy_test.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package client
-
-import (
- "context"
- "errors"
- "testing"
-
- "codeberg.org/eduVPN/proxyguard"
-)
-
-func TestProxy(t *testing.T) {
- // test race
- p := Proxy{}
- p.NewClient(&proxyguard.Client{})
- go func() {
- // connect to localhost will fail
- // but we don't care about the error
- _ = p.Tunnel(context.Background(), "127.0.0.1")
- }()
- // race!
- _ = p.Cancel()
-
- // cancel before tunneling
- p.NewClient(&proxyguard.Client{})
- if !errors.Is(p.Cancel(), ErrNoProxyGuardCancel) {
- t.Fatalf("proxyguard cancel err not equal")
- }
- _ = p.Tunnel(context.Background(), "127.0.0.1")
- p.Delete()
-
- // tunnel without client
- gerr := p.Tunnel(context.Background(), "127.0.0.1")
- if !errors.Is(gerr, ErrNoProxyGuardClient) {
- t.Fatalf("no proxyguard client err not equal")
- }
-}