Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Host ¶
type Host struct { User string Addr string AuthKey gossh.Signer HostKey gossh.PublicKey RemoteZSM string // contains filtered or unexported fields }
Host represents a remote host on which ZSM is installed.
func (*Host) ListSnapshots ¶
ListSnapshots lists all snapshots available on the remote host.
func (*Host) ReceiveSnapshot ¶
ReceiveSnapshot lets the remote host receive a snapshot with the passed name.
The snapshot data is read from r. It is written to targetFS with the name that is passed to ReceiveSnapshot.
Example:
Let a snapshot have the name zsm_test@2020-04-10T09:45:58.564585005Z and targetFS the value target_fs.
The remote host then writes the snapshot to target_fs/zsm_test@2020-04-10T09:45:58.564585005Z
type SSHTestServer ¶
type SSHTestServer struct { // AuthorizedKeys contains public SSH keys of clients allowed to connect to // the server. Changes made after calling Serve are ignored. AuthorizedKeys []ssh.PublicKey // Receives the host key of this server once it has been initialized. HostKey chan<- gossh.Signer // The server writes any command a client passed when initiating a session // into this channel. Setting Command after calling Serve has no effect. Command chan<- []string // The server writes anything read from stdin into this channel. // Setting Stdin after calling Serve has no effect. Stdin chan<- []byte // The server writes this to stdout. // Setting Stdout after calling Serve has no effect. Stdout []byte // The server writes this to stderr. // Setting Stderr after calling Serve has no effect. Stderr []byte // Any errors that occur while handling a request are written to this channel. // Setting Errors after calling Serve has no effect. Errors chan<- error // The server terminates all sessions with this exit code. Changing ExitCode // after calling Serve has no effect. ExitCode int // contains filtered or unexported fields }
SSHTestServer represents a simple SSH server for testing purposes.
type TestCase ¶
type TestCase struct { Name string // Call calls invokes a method on the remote Host. It should return any error // returned by the called host method. Additionally it may use the passed T // to perform further assertions. Call func(*testing.T, *Host) error Stdin func(*testing.T) []byte // returns stdin expected to be sent to remote host Stdout func(*testing.T) []byte // returns stdout expected to be sent by remote host Stderr func(*testing.T) []byte // returns stderr expected to be sent by remote host ZSMExitCode int // expected exit code of remote zsm ZSMCommand []string // expected arguments for remote zsm // Abort waiting on channels after this time elapsed. // Default 10ms per channel ChannelTimeout time.Duration // contains filtered or unexported fields }
TestCase defines a test case for remote zsm invocation.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
testserver
testserver provides a command to start the remote.SSHTestServer.
|
testserver provides a command to start the remote.SSHTestServer. |
Click to show internal directories.
Click to hide internal directories.