blob: 7c1933ea24f90c12bf11dd53ab2343a11b133b73 [file] [log] [blame]
Matteo Scandolo256266d2020-06-01 13:44:07 -07001/*
2 * Copyright 2018-present Open Networking Foundation
3
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package mock
18
19import (
20 "context"
Kent Hagerman9b0ac0a2020-06-08 11:48:16 -040021
Matteo Scandolo256266d2020-06-01 13:44:07 -070022 . "github.com/golang/protobuf/ptypes/empty"
David K. Bainbridgee05cf0c2021-08-19 03:16:50 +000023 "github.com/opencord/voltha-protos/v5/go/common"
khenaidoofcf0b8d2021-10-19 17:57:30 -040024 "github.com/opencord/voltha-protos/v5/go/extension"
David K. Bainbridgee05cf0c2021-08-19 03:16:50 +000025 "github.com/opencord/voltha-protos/v5/go/omci"
26 "github.com/opencord/voltha-protos/v5/go/openflow_13"
27 . "github.com/opencord/voltha-protos/v5/go/voltha"
Matteo Scandolo256266d2020-06-01 13:44:07 -070028 "google.golang.org/grpc"
29)
30
31type MockVolthaClient struct {
32 LogicalDeviceFlows openflow_13.Flows
33 LogicalPorts LogicalPorts
Matteo Scandolo256266d2020-06-01 13:44:07 -070034}
35
Matteo Scandolo256266d2020-06-01 13:44:07 -070036func (c MockVolthaClient) GetVoltha(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Voltha, error) {
37 return &Voltha{}, nil
38}
39
40func (c MockVolthaClient) ListCoreInstances(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CoreInstances, error) {
41 return &CoreInstances{}, nil
42}
43
44func (c MockVolthaClient) GetCoreInstance(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*CoreInstance, error) {
45 return &CoreInstance{}, nil
46}
47
48func (c MockVolthaClient) ListAdapters(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Adapters, error) {
49 return &Adapters{}, nil
50}
51
52func (c MockVolthaClient) ListLogicalDevices(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*LogicalDevices, error) {
53 return &LogicalDevices{}, nil
54}
55
56func (c MockVolthaClient) GetLogicalDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*LogicalDevice, error) {
Kent Hagerman9b0ac0a2020-06-08 11:48:16 -040057 return &LogicalDevice{}, nil
Matteo Scandolo256266d2020-06-01 13:44:07 -070058}
59
60func (c MockVolthaClient) ListLogicalDevicePorts(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*LogicalPorts, error) {
61 return &c.LogicalPorts, nil
62}
63
64func (c MockVolthaClient) GetLogicalDevicePort(ctx context.Context, in *LogicalPortId, opts ...grpc.CallOption) (*LogicalPort, error) {
65 return &LogicalPort{}, nil
66}
67
68func (c MockVolthaClient) EnableLogicalDevicePort(ctx context.Context, in *LogicalPortId, opts ...grpc.CallOption) (*Empty, error) {
69 return &Empty{}, nil
70}
71
72func (c MockVolthaClient) DisableLogicalDevicePort(ctx context.Context, in *LogicalPortId, opts ...grpc.CallOption) (*Empty, error) {
73 return &Empty{}, nil
74}
75
76func (c MockVolthaClient) ListLogicalDeviceFlows(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.Flows, error) {
77 return &c.LogicalDeviceFlows, nil
78}
79
80func (c MockVolthaClient) UpdateLogicalDeviceFlowTable(ctx context.Context, in *openflow_13.FlowTableUpdate, opts ...grpc.CallOption) (*Empty, error) {
81 return &Empty{}, nil
82}
83
84func (c MockVolthaClient) UpdateLogicalDeviceMeterTable(ctx context.Context, in *openflow_13.MeterModUpdate, opts ...grpc.CallOption) (*Empty, error) {
85 return &Empty{}, nil
86}
87
88func (c MockVolthaClient) ListLogicalDeviceMeters(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.Meters, error) {
89 return &openflow_13.Meters{}, nil
90}
91
92func (c MockVolthaClient) ListLogicalDeviceFlowGroups(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.FlowGroups, error) {
93 return &openflow_13.FlowGroups{}, nil
94}
95
96func (c MockVolthaClient) UpdateLogicalDeviceFlowGroupTable(ctx context.Context, in *openflow_13.FlowGroupTableUpdate, opts ...grpc.CallOption) (*Empty, error) {
97 return &Empty{}, nil
98}
99
100func (c MockVolthaClient) ListDevices(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Devices, error) {
101 return &Devices{}, nil
102}
103
104func (c MockVolthaClient) ListDeviceIds(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*common.IDs, error) {
105 return &common.IDs{}, nil
106}
107
108func (c MockVolthaClient) ReconcileDevices(ctx context.Context, in *common.IDs, opts ...grpc.CallOption) (*Empty, error) {
109 return &Empty{}, nil
110}
111
112func (c MockVolthaClient) GetDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Device, error) {
113 return &Device{}, nil
114}
115
116func (c MockVolthaClient) CreateDevice(ctx context.Context, in *Device, opts ...grpc.CallOption) (*Device, error) {
117 return &Device{}, nil
118}
119
120func (c MockVolthaClient) EnableDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
121 return &Empty{}, nil
122}
123
124func (c MockVolthaClient) DisableDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
125 return &Empty{}, nil
126}
127
128func (c MockVolthaClient) RebootDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
129 return &Empty{}, nil
130}
131
132func (c MockVolthaClient) DeleteDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
133 return &Empty{}, nil
134}
135
136func (c MockVolthaClient) DownloadImage(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*common.OperationResp, error) {
137 return &common.OperationResp{}, nil
138}
139
140func (c MockVolthaClient) GetImageDownloadStatus(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*ImageDownload, error) {
141 return &ImageDownload{}, nil
142}
143
144func (c MockVolthaClient) GetImageDownload(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*ImageDownload, error) {
145 return &ImageDownload{}, nil
146}
147
148func (c MockVolthaClient) ListImageDownloads(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*ImageDownloads, error) {
149 return &ImageDownloads{}, nil
150}
151
152func (c MockVolthaClient) CancelImageDownload(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*common.OperationResp, error) {
153 return &common.OperationResp{}, nil
154}
155
156func (c MockVolthaClient) ActivateImageUpdate(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*common.OperationResp, error) {
157 return &common.OperationResp{}, nil
158}
159
160func (c MockVolthaClient) RevertImageUpdate(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*common.OperationResp, error) {
161 return &common.OperationResp{}, nil
162}
163
164func (c MockVolthaClient) ListDevicePorts(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Ports, error) {
165 return &Ports{}, nil
166}
167
168func (c MockVolthaClient) ListDevicePmConfigs(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*PmConfigs, error) {
169 return &PmConfigs{}, nil
170}
171
172func (c MockVolthaClient) UpdateDevicePmConfigs(ctx context.Context, in *PmConfigs, opts ...grpc.CallOption) (*Empty, error) {
173 return &Empty{}, nil
174}
175
176func (c MockVolthaClient) ListDeviceFlows(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.Flows, error) {
177 return &openflow_13.Flows{}, nil
178}
179
180func (c MockVolthaClient) ListDeviceFlowGroups(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.FlowGroups, error) {
181 return &openflow_13.FlowGroups{}, nil
182}
183
184func (c MockVolthaClient) ListDeviceTypes(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DeviceTypes, error) {
185 return &DeviceTypes{}, nil
186}
187
188func (c MockVolthaClient) GetDeviceType(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*DeviceType, error) {
189 return &DeviceType{}, nil
190}
191
Matteo Scandolo256266d2020-06-01 13:44:07 -0700192func (c MockVolthaClient) StreamPacketsOut(ctx context.Context, opts ...grpc.CallOption) (VolthaService_StreamPacketsOutClient, error) {
193 return nil, nil
194}
195
196func (c MockVolthaClient) ReceivePacketsIn(ctx context.Context, in *Empty, opts ...grpc.CallOption) (VolthaService_ReceivePacketsInClient, error) {
197 return nil, nil
198}
199
200func (c MockVolthaClient) ReceiveChangeEvents(ctx context.Context, in *Empty, opts ...grpc.CallOption) (VolthaService_ReceiveChangeEventsClient, error) {
201 return nil, nil
202}
203
Matteo Scandolo256266d2020-06-01 13:44:07 -0700204func (c MockVolthaClient) CreateEventFilter(ctx context.Context, in *EventFilter, opts ...grpc.CallOption) (*EventFilter, error) {
205 return &EventFilter{}, nil
206}
207
208func (c MockVolthaClient) GetEventFilter(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*EventFilters, error) {
209 return &EventFilters{}, nil
210}
211
212func (c MockVolthaClient) UpdateEventFilter(ctx context.Context, in *EventFilter, opts ...grpc.CallOption) (*EventFilter, error) {
213 return &EventFilter{}, nil
214}
215
216func (c MockVolthaClient) DeleteEventFilter(ctx context.Context, in *EventFilter, opts ...grpc.CallOption) (*Empty, error) {
217 return &Empty{}, nil
218}
219
220func (c MockVolthaClient) ListEventFilters(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*EventFilters, error) {
221 return &EventFilters{}, nil
222}
223
224func (c MockVolthaClient) GetImages(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Images, error) {
225 return &Images{}, nil
226}
227
228func (c MockVolthaClient) SelfTest(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*SelfTestResponse, error) {
229 return &SelfTestResponse{}, nil
230}
231
232func (c MockVolthaClient) GetMibDeviceData(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*omci.MibDeviceData, error) {
233 return &omci.MibDeviceData{}, nil
234}
235
236func (c MockVolthaClient) GetAlarmDeviceData(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*omci.AlarmDeviceData, error) {
237 return &omci.AlarmDeviceData{}, nil
238}
239
240func (c MockVolthaClient) SimulateAlarm(ctx context.Context, in *SimulateAlarmRequest, opts ...grpc.CallOption) (*common.OperationResp, error) {
241 return &common.OperationResp{}, nil
242}
243
Matteo Scandolo256266d2020-06-01 13:44:07 -0700244func (c MockVolthaClient) EnablePort(ctx context.Context, in *Port, opts ...grpc.CallOption) (*Empty, error) {
245 return &Empty{}, nil
246}
247
248func (c MockVolthaClient) DisablePort(ctx context.Context, in *Port, opts ...grpc.CallOption) (*Empty, error) {
249 return &Empty{}, nil
250}
251
khenaidoofcf0b8d2021-10-19 17:57:30 -0400252func (c MockVolthaClient) GetExtValue(ctx context.Context, in *extension.ValueSpecifier, opts ...grpc.CallOption) (*extension.ReturnValues, error) {
253 return &extension.ReturnValues{}, nil
Matteo Scandolo256266d2020-06-01 13:44:07 -0700254}
255
khenaidoofcf0b8d2021-10-19 17:57:30 -0400256func (c MockVolthaClient) StartOmciTestAction(ctx context.Context, in *omci.OmciTestRequest, opts ...grpc.CallOption) (*omci.TestResponse, error) {
257 return &omci.TestResponse{}, nil
Matteo Scandolo256266d2020-06-01 13:44:07 -0700258}
Maninder12b909f2020-10-23 14:23:36 +0530259
260func (c MockVolthaClient) ForceDeleteDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
261 return &Empty{}, nil
262}
263
khenaidoofcf0b8d2021-10-19 17:57:30 -0400264func (c MockVolthaClient) SetExtValue(ctx context.Context, in *extension.ValueSet, opts ...grpc.CallOption) (*Empty, error) {
Maninder12b909f2020-10-23 14:23:36 +0530265 return &Empty{}, nil
266}
Andrea Campanella18448bc2021-07-08 18:47:22 +0200267
268func (c MockVolthaClient) AbortImageUpgradeToDevice(ctx context.Context, imageRequest *DeviceImageRequest, opts ...grpc.CallOption) (*DeviceImageResponse, error) {
269 return &DeviceImageResponse{}, nil
270}
271
272func (c MockVolthaClient) ActivateImage(ctx context.Context, imageRequest *DeviceImageRequest, opts ...grpc.CallOption) (*DeviceImageResponse, error) {
273 return &DeviceImageResponse{}, nil
274}
275
276func (c MockVolthaClient) CommitImage(ctx context.Context, imageRequest *DeviceImageRequest, opts ...grpc.CallOption) (*DeviceImageResponse, error) {
277 return &DeviceImageResponse{}, nil
278}
279
280func (c MockVolthaClient) DownloadImageToDevice(ctx context.Context, imageRequest *DeviceImageDownloadRequest, opts ...grpc.CallOption) (*DeviceImageResponse, error) {
281 return &DeviceImageResponse{}, nil
282}
283
284func (c MockVolthaClient) GetImageStatus(ctx context.Context, imageRequest *DeviceImageRequest, opts ...grpc.CallOption) (*DeviceImageResponse, error) {
285 return &DeviceImageResponse{}, nil
286}
287
288func (c MockVolthaClient) GetOnuImages(ctx context.Context, id *common.ID, opts ...grpc.CallOption) (*OnuImages, error) {
289 return &OnuImages{}, nil
290}