-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_secure_shell.go
174 lines (154 loc) · 4.38 KB
/
fake_secure_shell.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// This file was generated by counterfeiter
package sshfakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/ssh"
"github.com/cloudfoundry/cli/cf/ssh/options"
)
type FakeSecureShell struct {
ConnectStub func(opts *options.SSHOptions) error
connectMutex sync.RWMutex
connectArgsForCall []struct {
opts *options.SSHOptions
}
connectReturns struct {
result1 error
}
InteractiveSessionStub func() error
interactiveSessionMutex sync.RWMutex
interactiveSessionArgsForCall []struct{}
interactiveSessionReturns struct {
result1 error
}
LocalPortForwardStub func() error
localPortForwardMutex sync.RWMutex
localPortForwardArgsForCall []struct{}
localPortForwardReturns struct {
result1 error
}
WaitStub func() error
waitMutex sync.RWMutex
waitArgsForCall []struct{}
waitReturns struct {
result1 error
}
CloseStub func() error
closeMutex sync.RWMutex
closeArgsForCall []struct{}
closeReturns struct {
result1 error
}
}
func (fake *FakeSecureShell) Connect(opts *options.SSHOptions) error {
fake.connectMutex.Lock()
fake.connectArgsForCall = append(fake.connectArgsForCall, struct {
opts *options.SSHOptions
}{opts})
fake.connectMutex.Unlock()
if fake.ConnectStub != nil {
return fake.ConnectStub(opts)
} else {
return fake.connectReturns.result1
}
}
func (fake *FakeSecureShell) ConnectCallCount() int {
fake.connectMutex.RLock()
defer fake.connectMutex.RUnlock()
return len(fake.connectArgsForCall)
}
func (fake *FakeSecureShell) ConnectArgsForCall(i int) *options.SSHOptions {
fake.connectMutex.RLock()
defer fake.connectMutex.RUnlock()
return fake.connectArgsForCall[i].opts
}
func (fake *FakeSecureShell) ConnectReturns(result1 error) {
fake.ConnectStub = nil
fake.connectReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSecureShell) InteractiveSession() error {
fake.interactiveSessionMutex.Lock()
fake.interactiveSessionArgsForCall = append(fake.interactiveSessionArgsForCall, struct{}{})
fake.interactiveSessionMutex.Unlock()
if fake.InteractiveSessionStub != nil {
return fake.InteractiveSessionStub()
} else {
return fake.interactiveSessionReturns.result1
}
}
func (fake *FakeSecureShell) InteractiveSessionCallCount() int {
fake.interactiveSessionMutex.RLock()
defer fake.interactiveSessionMutex.RUnlock()
return len(fake.interactiveSessionArgsForCall)
}
func (fake *FakeSecureShell) InteractiveSessionReturns(result1 error) {
fake.InteractiveSessionStub = nil
fake.interactiveSessionReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSecureShell) LocalPortForward() error {
fake.localPortForwardMutex.Lock()
fake.localPortForwardArgsForCall = append(fake.localPortForwardArgsForCall, struct{}{})
fake.localPortForwardMutex.Unlock()
if fake.LocalPortForwardStub != nil {
return fake.LocalPortForwardStub()
} else {
return fake.localPortForwardReturns.result1
}
}
func (fake *FakeSecureShell) LocalPortForwardCallCount() int {
fake.localPortForwardMutex.RLock()
defer fake.localPortForwardMutex.RUnlock()
return len(fake.localPortForwardArgsForCall)
}
func (fake *FakeSecureShell) LocalPortForwardReturns(result1 error) {
fake.LocalPortForwardStub = nil
fake.localPortForwardReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSecureShell) Wait() error {
fake.waitMutex.Lock()
fake.waitArgsForCall = append(fake.waitArgsForCall, struct{}{})
fake.waitMutex.Unlock()
if fake.WaitStub != nil {
return fake.WaitStub()
} else {
return fake.waitReturns.result1
}
}
func (fake *FakeSecureShell) WaitCallCount() int {
fake.waitMutex.RLock()
defer fake.waitMutex.RUnlock()
return len(fake.waitArgsForCall)
}
func (fake *FakeSecureShell) WaitReturns(result1 error) {
fake.WaitStub = nil
fake.waitReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSecureShell) Close() error {
fake.closeMutex.Lock()
fake.closeArgsForCall = append(fake.closeArgsForCall, struct{}{})
fake.closeMutex.Unlock()
if fake.CloseStub != nil {
return fake.CloseStub()
} else {
return fake.closeReturns.result1
}
}
func (fake *FakeSecureShell) CloseCallCount() int {
fake.closeMutex.RLock()
defer fake.closeMutex.RUnlock()
return len(fake.closeArgsForCall)
}
func (fake *FakeSecureShell) CloseReturns(result1 error) {
fake.CloseStub = nil
fake.closeReturns = struct {
result1 error
}{result1}
}
var _ sshCmd.SecureShell = new(FakeSecureShell)