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