Documentation ¶
Index ¶
- func CheckPrivateSshConnection(t *testing.T, publicHost Host, privateHost Host, command string) string
- func CheckPrivateSshConnectionE(t *testing.T, publicHost Host, privateHost Host, command string) (string, error)
- func CheckSshCommand(t *testing.T, host Host, command string) string
- func CheckSshCommandE(t *testing.T, host Host, command string) (string, error)
- func CheckSshConnection(t *testing.T, host Host)
- func CheckSshConnectionE(t *testing.T, host Host) error
- func Close(t *testing.T, closeable Closeable, ignoreErrors ...string)
- func NoOpHostKeyCallback(hostname string, remote net.Addr, key ssh.PublicKey) error
- type Closeable
- type Host
- type JumpHostSession
- type KeyPair
- type SshConnectionOptions
- type SshSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPrivateSshConnection ¶
func CheckPrivateSshConnection(t *testing.T, publicHost Host, privateHost Host, command string) string
CheckPrivateSshConnection attempts to connect to privateHost (which is not addressable from the Internet) via a separate publicHost (which is addressable from the Internet) and then executes "command" on privateHost and returns its output. It is useful for checking that it's possible to SSH from a Bastion Host to a private instance.
func CheckPrivateSshConnectionE ¶
func CheckPrivateSshConnectionE(t *testing.T, publicHost Host, privateHost Host, command string) (string, error)
CheckPrivateSshConnection attempts to connect to privateHost (which is not addressable from the Internet) via a separate publicHost (which is addressable from the Internet) and then executes "command" on privateHost and returns its output. It is useful for checking that it's possible to SSH from a Bastion Host to a private instance.
func CheckSshCommand ¶
Check that you can connect via SSH to the given host and run the given command. Returns the stdout/stderr.
func CheckSshCommandE ¶
Check that you can connect via SSH to the given host and run the given command. Returns the stdout/stderr.
func CheckSshConnection ¶
Check that you can connect via SSH to the given host and fail the test if the connection fails.
func CheckSshConnectionE ¶
Check that you can connect via SSH to the given host and return an error if the connection fails
Types ¶
type JumpHostSession ¶
type JumpHostSession struct { JumpHostClient *ssh.Client HostVirtualConnection net.Conn HostConnection ssh.Conn }
func (*JumpHostSession) Cleanup ¶
func (jumpHost *JumpHostSession) Cleanup(t *testing.T)
type KeyPair ¶
A public and private key pair that can be used for SSH access
func GenerateRSAKeyPair ¶
Generate an RSA Keypair and return the public and private keys
type SshConnectionOptions ¶
type SshConnectionOptions struct { Username string Address string Port int AuthMethods []ssh.AuthMethod Command string JumpHost *SshConnectionOptions }
func (*SshConnectionOptions) ConnectionString ¶
func (options *SshConnectionOptions) ConnectionString() string
type SshSession ¶
type SshSession struct { Options *SshConnectionOptions Client *ssh.Client Session *ssh.Session JumpHost *JumpHostSession }
A container object for all resources created by an SSH session. The reason we need this is so that we can do a single defer in a top-level method that calls the Cleanup method to go through and ensure all of these resources are released and cleaned up.
func (*SshSession) Cleanup ¶
func (sshSession *SshSession) Cleanup(t *testing.T)