Add additional tests for SSH
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
21
libmachine/ssh/sshtest/fake_client.go
Normal file
21
libmachine/ssh/sshtest/fake_client.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package sshtest
|
||||
|
||||
type CmdResult struct {
|
||||
Out string
|
||||
Err error
|
||||
}
|
||||
|
||||
type FakeClient struct {
|
||||
ActivatedShell []string
|
||||
Outputs map[string]CmdResult
|
||||
}
|
||||
|
||||
func (fsc *FakeClient) Output(command string) (string, error) {
|
||||
outerr := fsc.Outputs[command]
|
||||
return outerr.Out, outerr.Err
|
||||
}
|
||||
|
||||
func (fsc *FakeClient) Shell(args ...string) error {
|
||||
fsc.ActivatedShell = args
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user