/
mock_task.go
352 lines (306 loc) · 11.5 KB
/
mock_task.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
// Copyright (c) 2021 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/containerd/containerd (interfaces: Task)
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
syscall "syscall"
containerd "github.com/containerd/containerd"
types "github.com/containerd/containerd/api/types"
cio "github.com/containerd/containerd/cio"
gomock "github.com/golang/mock/gomock"
specs_go "github.com/opencontainers/runtime-spec/specs-go"
)
// MockTask is a mock of Task interface.
type MockTask struct {
ctrl *gomock.Controller
recorder *MockTaskMockRecorder
}
// MockTaskMockRecorder is the mock recorder for MockTask.
type MockTaskMockRecorder struct {
mock *MockTask
}
// NewMockTask creates a new mock instance.
func NewMockTask(ctrl *gomock.Controller) *MockTask {
mock := &MockTask{ctrl: ctrl}
mock.recorder = &MockTaskMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTask) EXPECT() *MockTaskMockRecorder {
return m.recorder
}
// Checkpoint mocks base method.
func (m *MockTask) Checkpoint(arg0 context.Context, arg1 ...containerd.CheckpointTaskOpts) (containerd.Image, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Checkpoint", varargs...)
ret0, _ := ret[0].(containerd.Image)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Checkpoint indicates an expected call of Checkpoint.
func (mr *MockTaskMockRecorder) Checkpoint(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0}, arg1...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Checkpoint", reflect.TypeOf((*MockTask)(nil).Checkpoint), varargs...)
}
// CloseIO mocks base method.
func (m *MockTask) CloseIO(arg0 context.Context, arg1 ...containerd.IOCloserOpts) error {
m.ctrl.T.Helper()
varargs := []interface{}{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "CloseIO", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// CloseIO indicates an expected call of CloseIO.
func (mr *MockTaskMockRecorder) CloseIO(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0}, arg1...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseIO", reflect.TypeOf((*MockTask)(nil).CloseIO), varargs...)
}
// Delete mocks base method.
func (m *MockTask) Delete(arg0 context.Context, arg1 ...containerd.ProcessDeleteOpts) (*containerd.ExitStatus, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Delete", varargs...)
ret0, _ := ret[0].(*containerd.ExitStatus)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Delete indicates an expected call of Delete.
func (mr *MockTaskMockRecorder) Delete(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0}, arg1...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockTask)(nil).Delete), varargs...)
}
// Exec mocks base method.
func (m *MockTask) Exec(arg0 context.Context, arg1 string, arg2 *specs_go.Process, arg3 cio.Creator) (containerd.Process, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Exec", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(containerd.Process)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Exec indicates an expected call of Exec.
func (mr *MockTaskMockRecorder) Exec(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockTask)(nil).Exec), arg0, arg1, arg2, arg3)
}
// ID mocks base method.
func (m *MockTask) ID() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ID")
ret0, _ := ret[0].(string)
return ret0
}
// ID indicates an expected call of ID.
func (mr *MockTaskMockRecorder) ID() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockTask)(nil).ID))
}
// IO mocks base method.
func (m *MockTask) IO() cio.IO {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IO")
ret0, _ := ret[0].(cio.IO)
return ret0
}
// IO indicates an expected call of IO.
func (mr *MockTaskMockRecorder) IO() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IO", reflect.TypeOf((*MockTask)(nil).IO))
}
// Kill mocks base method.
func (m *MockTask) Kill(arg0 context.Context, arg1 syscall.Signal, arg2 ...containerd.KillOpts) error {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Kill", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// Kill indicates an expected call of Kill.
func (mr *MockTaskMockRecorder) Kill(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Kill", reflect.TypeOf((*MockTask)(nil).Kill), varargs...)
}
// LoadProcess mocks base method.
func (m *MockTask) LoadProcess(arg0 context.Context, arg1 string, arg2 cio.Attach) (containerd.Process, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LoadProcess", arg0, arg1, arg2)
ret0, _ := ret[0].(containerd.Process)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LoadProcess indicates an expected call of LoadProcess.
func (mr *MockTaskMockRecorder) LoadProcess(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadProcess", reflect.TypeOf((*MockTask)(nil).LoadProcess), arg0, arg1, arg2)
}
// Metrics mocks base method.
func (m *MockTask) Metrics(arg0 context.Context) (*types.Metric, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Metrics", arg0)
ret0, _ := ret[0].(*types.Metric)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Metrics indicates an expected call of Metrics.
func (mr *MockTaskMockRecorder) Metrics(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Metrics", reflect.TypeOf((*MockTask)(nil).Metrics), arg0)
}
// Pause mocks base method.
func (m *MockTask) Pause(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Pause", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Pause indicates an expected call of Pause.
func (mr *MockTaskMockRecorder) Pause(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pause", reflect.TypeOf((*MockTask)(nil).Pause), arg0)
}
// Pid mocks base method.
func (m *MockTask) Pid() uint32 {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Pid")
ret0, _ := ret[0].(uint32)
return ret0
}
// Pid indicates an expected call of Pid.
func (mr *MockTaskMockRecorder) Pid() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pid", reflect.TypeOf((*MockTask)(nil).Pid))
}
// Pids mocks base method.
func (m *MockTask) Pids(arg0 context.Context) ([]containerd.ProcessInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Pids", arg0)
ret0, _ := ret[0].([]containerd.ProcessInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Pids indicates an expected call of Pids.
func (mr *MockTaskMockRecorder) Pids(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pids", reflect.TypeOf((*MockTask)(nil).Pids), arg0)
}
// Resize mocks base method.
func (m *MockTask) Resize(arg0 context.Context, arg1, arg2 uint32) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Resize", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// Resize indicates an expected call of Resize.
func (mr *MockTaskMockRecorder) Resize(arg0, arg1, arg2 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Resize", reflect.TypeOf((*MockTask)(nil).Resize), arg0, arg1, arg2)
}
// Resume mocks base method.
func (m *MockTask) Resume(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Resume", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Resume indicates an expected call of Resume.
func (mr *MockTaskMockRecorder) Resume(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Resume", reflect.TypeOf((*MockTask)(nil).Resume), arg0)
}
// Spec mocks base method.
func (m *MockTask) Spec(arg0 context.Context) (*specs_go.Spec, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Spec", arg0)
ret0, _ := ret[0].(*specs_go.Spec)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Spec indicates an expected call of Spec.
func (mr *MockTaskMockRecorder) Spec(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Spec", reflect.TypeOf((*MockTask)(nil).Spec), arg0)
}
// Start mocks base method.
func (m *MockTask) Start(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Start", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Start indicates an expected call of Start.
func (mr *MockTaskMockRecorder) Start(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockTask)(nil).Start), arg0)
}
// Status mocks base method.
func (m *MockTask) Status(arg0 context.Context) (containerd.Status, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Status", arg0)
ret0, _ := ret[0].(containerd.Status)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Status indicates an expected call of Status.
func (mr *MockTaskMockRecorder) Status(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockTask)(nil).Status), arg0)
}
// Update mocks base method.
func (m *MockTask) Update(arg0 context.Context, arg1 ...containerd.UpdateTaskOpts) error {
m.ctrl.T.Helper()
varargs := []interface{}{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Update", varargs...)
ret0, _ := ret[0].(error)
return ret0
}
// Update indicates an expected call of Update.
func (mr *MockTaskMockRecorder) Update(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0}, arg1...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockTask)(nil).Update), varargs...)
}
// Wait mocks base method.
func (m *MockTask) Wait(arg0 context.Context) (<-chan containerd.ExitStatus, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Wait", arg0)
ret0, _ := ret[0].(<-chan containerd.ExitStatus)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Wait indicates an expected call of Wait.
func (mr *MockTaskMockRecorder) Wait(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Wait", reflect.TypeOf((*MockTask)(nil).Wait), arg0)
}