mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 02:43:05 +00:00
1e61084898
* handle control protocol through websocket The necessary behaviour is already in place, but the wasm build only issued GETs, and the handler was not invoked. * get DERP-over-websocket working for wasm clients * Prepare for testing builtin websocket-over-DERP Still needs some way to assert that clients are connected through websockets, rather than the TCP hijacking version of DERP. * integration tests: properly differentiate between DERP transports * do not touch unrelated code * linter fixes * integration testing: unexport common implementation of derp server scenario * fixup! integration testing: unexport common implementation of derp server scenario * dockertestutil/logs: remove unhelpful comment * update changelog --------- Co-authored-by: Csaba Sarkadi <sarkadicsa@tutanota.de>
47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package integration
|
|
|
|
import (
|
|
"io"
|
|
"net/netip"
|
|
"net/url"
|
|
|
|
"github.com/juanfont/headscale/integration/dockertestutil"
|
|
"github.com/juanfont/headscale/integration/tsic"
|
|
"tailscale.com/ipn/ipnstate"
|
|
"tailscale.com/net/netcheck"
|
|
"tailscale.com/types/netmap"
|
|
)
|
|
|
|
// nolint
|
|
type TailscaleClient interface {
|
|
Hostname() string
|
|
Shutdown() error
|
|
Version() string
|
|
Execute(
|
|
command []string,
|
|
options ...dockertestutil.ExecuteCommandOption,
|
|
) (string, string, error)
|
|
Login(loginServer, authKey string) error
|
|
LoginWithURL(loginServer string) (*url.URL, error)
|
|
Logout() error
|
|
Up() error
|
|
Down() error
|
|
IPs() ([]netip.Addr, error)
|
|
FQDN() (string, error)
|
|
Status(...bool) (*ipnstate.Status, error)
|
|
Netmap() (*netmap.NetworkMap, error)
|
|
Netcheck() (*netcheck.Report, error)
|
|
WaitForNeedsLogin() error
|
|
WaitForRunning() error
|
|
WaitForPeers(expected int) error
|
|
Ping(hostnameOrIP string, opts ...tsic.PingOption) error
|
|
Curl(url string, opts ...tsic.CurlOption) (string, error)
|
|
ID() string
|
|
ReadFile(path string) ([]byte, error)
|
|
|
|
// FailingPeersAsString returns a formatted-ish multi-line-string of peers in the client
|
|
// and a bool indicating if the clients online count and peer count is equal.
|
|
FailingPeersAsString() (string, bool, error)
|
|
|
|
WriteLogs(stdout, stderr io.Writer) error
|
|
}
|