Documentation ¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) DeleteRemotePath(ctx context.Context, path string) error
- func (c *Client) ExpectDisconnect(ctx context.Context, f func() error) error
- func (c *Client) ExpectReboot(ctx context.Context, f func() error) error
- func (c *Client) GetSSHConnection(ctx context.Context) (string, error)
- func (c *Client) GetSystemImageMerkle(ctx context.Context) (string, error)
- func (c *Client) Name() string
- func (c *Client) Pave(ctx context.Context, build artifacts.Build) error
- func (c *Client) ReadRemotePath(ctx context.Context, path string) ([]byte, error)
- func (c *Client) Reboot(ctx context.Context) error
- func (c *Client) RebootToRecovery(ctx context.Context) error
- func (c *Client) Reconnect(ctx context.Context) error
- func (c *Client) RegisterDisconnectListener(ch chan struct{})
- func (c *Client) RegisterPackageRepository(ctx context.Context, repo *packages.Server, createRewriteRule bool) error
- func (c *Client) RemoteFileExists(ctx context.Context, path string) (bool, error)
- func (c *Client) Run(ctx context.Context, command []string, stdout io.Writer, stderr io.Writer) error
- func (c *Client) ServePackageRepository(ctx context.Context, repo *packages.Repository, name string, ...) (*packages.Server, error)
- func (c *Client) StartRpcSession(ctx context.Context, repo *packages.Repository) (*sl4f.Client, error)
- func (c *Client) ValidateStaticPackages(ctx context.Context) error
- type ConstantHostResolver
- type DeviceFinderResolver
- type DeviceResolver
- type EstimatedMonotonicTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages the connection to the device.
func NewClient ¶
func NewClient(ctx context.Context, deviceResolver DeviceResolver, privateKey ssh.Signer) (*Client, error)
NewClient creates a new Client.
func (*Client) DeleteRemotePath ¶
DeleteRemotePath deletes a file off the remote device.
func (*Client) ExpectDisconnect ¶
func (*Client) ExpectReboot ¶
ExpectReboot prepares a device for a reboot, runs a closure `f` that should reboot the device, then finally verifies whether a reboot actually took place. It does this by writing a unique value to `/tmp/ota_test_should_reboot`, then executing the closure. After we reconnect, we check if `/tmp/ota_test_should_reboot` exists. If not, exit with `nil`. Otherwise, we failed to reboot, or some competing test is also trying to reboot the device. Either way, err out.
func (*Client) GetSSHConnection ¶
func (*Client) GetSystemImageMerkle ¶
func (*Client) Pave ¶
Pave paves the device to the specified build. It assumes the device is already in recovery, since there are multiple ways to get a device into recovery.
func (*Client) ReadRemotePath ¶
ReadRemotePath read a file off the remote device.
func (*Client) Reboot ¶
Reboot asks the device to reboot. It waits until the device reconnects before returning.
func (*Client) RebootToRecovery ¶
RebootToRecovery asks the device to reboot into the recovery partition. It waits until the device disconnects before returning.
func (*Client) RegisterDisconnectListener ¶
func (c *Client) RegisterDisconnectListener(ch chan struct{})
RegisterDisconnectListener adds a waiter that gets notified when the ssh and shell is disconnected.
func (*Client) RegisterPackageRepository ¶
func (c *Client) RegisterPackageRepository(ctx context.Context, repo *packages.Server, createRewriteRule bool) error
RegisterPackageRepository adds the repository as a repository inside the device.
func (*Client) RemoteFileExists ¶
RemoteFileExists checks if a file exists on the remote device.
func (*Client) Run ¶
func (c *Client) Run(ctx context.Context, command []string, stdout io.Writer, stderr io.Writer) error
Run a command to completion on the remote device and write STDOUT and STDERR to the passed in io.Writers.
func (*Client) ServePackageRepository ¶
func (*Client) StartRpcSession ¶
type ConstantHostResolver ¶
type ConstantHostResolver struct {
// contains filtered or unexported fields
}
func NewConstantHostResolver ¶
func NewConstantHostResolver(name string, host string) ConstantHostResolver
func (ConstantHostResolver) Name ¶
func (r ConstantHostResolver) Name() string
func (ConstantHostResolver) ResolveName ¶
func (r ConstantHostResolver) ResolveName(ctx context.Context) (string, error)
type DeviceFinderResolver ¶
type DeviceFinderResolver struct {
// contains filtered or unexported fields
}
The logic here should match get-fuchsia-device-addr (//tools/devshell/lib/vars.sh).
func NewDeviceFinderResolver ¶
func (*DeviceFinderResolver) Name ¶
func (r *DeviceFinderResolver) Name() string
func (*DeviceFinderResolver) ResolveName ¶
func (r *DeviceFinderResolver) ResolveName(ctx context.Context) (string, error)
type DeviceResolver ¶
type EstimatedMonotonicTime ¶
type EstimatedMonotonicTime struct {
// contains filtered or unexported fields
}
EstimatedMonotonicTime is a structure that will return a string estimate of a device's current monotonic time.
func NewEstimatedMonotonicTime ¶
func NewEstimatedMonotonicTime(client *Client, suffix string) *EstimatedMonotonicTime
NewEstimatedMonotonicTime constructs a new EstimatedMonotonicTime.
func (*EstimatedMonotonicTime) String ¶
func (p *EstimatedMonotonicTime) String() string
String() will return a string prefixed by the device's monotonic time.