2022-10-21 20:17:38 +09:00
|
|
|
package integration
|
|
|
|
|
|
|
|
import (
|
2024-09-21 19:05:36 +09:00
|
|
|
"io"
|
2022-10-21 20:17:38 +09:00
|
|
|
"net/netip"
|
2022-11-04 00:56:19 +09:00
|
|
|
"net/url"
|
2022-10-21 20:17:38 +09:00
|
|
|
|
2023-04-14 06:09:09 +09:00
|
|
|
"github.com/juanfont/headscale/integration/dockertestutil"
|
2023-02-03 00:05:52 +09:00
|
|
|
"github.com/juanfont/headscale/integration/tsic"
|
2022-10-21 20:17:38 +09:00
|
|
|
"tailscale.com/ipn/ipnstate"
|
2024-02-09 15:26:41 +09:00
|
|
|
"tailscale.com/net/netcheck"
|
2024-01-19 01:30:25 +09:00
|
|
|
"tailscale.com/types/netmap"
|
2022-10-21 20:17:38 +09:00
|
|
|
)
|
|
|
|
|
2022-12-20 03:15:31 +09:00
|
|
|
// nolint
|
2022-10-21 20:17:38 +09:00
|
|
|
type TailscaleClient interface {
|
|
|
|
Hostname() string
|
2024-12-10 01:15:38 +09:00
|
|
|
Shutdown() (string, string, error)
|
2022-10-21 20:17:38 +09:00
|
|
|
Version() string
|
2023-08-29 15:33:33 +09:00
|
|
|
Execute(
|
|
|
|
command []string,
|
|
|
|
options ...dockertestutil.ExecuteCommandOption,
|
|
|
|
) (string, string, error)
|
|
|
|
Login(loginServer, authKey string) error
|
|
|
|
LoginWithURL(loginServer string) (*url.URL, error)
|
2022-12-22 07:29:52 +09:00
|
|
|
Logout() error
|
2023-12-10 02:09:24 +09:00
|
|
|
Up() error
|
|
|
|
Down() error
|
2022-10-21 20:17:38 +09:00
|
|
|
IPs() ([]netip.Addr, error)
|
2022-10-23 18:55:37 +09:00
|
|
|
FQDN() (string, error)
|
2024-02-23 18:59:24 +09:00
|
|
|
Status(...bool) (*ipnstate.Status, error)
|
2024-01-19 01:30:25 +09:00
|
|
|
Netmap() (*netmap.NetworkMap, error)
|
2024-11-22 21:23:05 +09:00
|
|
|
DebugDERPRegion(region string) (*ipnstate.DebugDERPRegionReport, error)
|
2024-02-09 15:26:41 +09:00
|
|
|
Netcheck() (*netcheck.Report, error)
|
2023-08-29 15:33:33 +09:00
|
|
|
WaitForNeedsLogin() error
|
|
|
|
WaitForRunning() error
|
2022-10-21 20:17:38 +09:00
|
|
|
WaitForPeers(expected int) error
|
2023-02-03 00:05:52 +09:00
|
|
|
Ping(hostnameOrIP string, opts ...tsic.PingOption) error
|
2023-03-20 16:52:52 +09:00
|
|
|
Curl(url string, opts ...tsic.CurlOption) (string, error)
|
2022-11-09 00:09:52 +09:00
|
|
|
ID() string
|
2024-08-19 18:41:05 +09:00
|
|
|
ReadFile(path string) ([]byte, error)
|
2024-05-24 17:15:34 +09:00
|
|
|
|
|
|
|
// 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)
|
2024-09-21 19:05:36 +09:00
|
|
|
|
|
|
|
WriteLogs(stdout, stderr io.Writer) error
|
2022-10-21 20:17:38 +09:00
|
|
|
}
|