blob: a41ae2f40b355727be6be2d4216d1ef92df580b4 [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"
Maninder12b909f2020-10-23 14:23:36 +053023 "github.com/opencord/voltha-protos/v4/go/common"
24 "github.com/opencord/voltha-protos/v4/go/omci"
25 "github.com/opencord/voltha-protos/v4/go/openflow_13"
26 . "github.com/opencord/voltha-protos/v4/go/voltha"
Matteo Scandolo256266d2020-06-01 13:44:07 -070027 "google.golang.org/grpc"
28)
29
30type MockVolthaClient struct {
31 LogicalDeviceFlows openflow_13.Flows
32 LogicalPorts LogicalPorts
Matteo Scandolo256266d2020-06-01 13:44:07 -070033}
34
35func (c MockVolthaClient) GetMembership(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Membership, error) {
36 return &Membership{}, nil
37}
38
39func (c MockVolthaClient) UpdateMembership(ctx context.Context, in *Membership, opts ...grpc.CallOption) (*Empty, error) {
40 return &Empty{}, nil
41}
42
43func (c MockVolthaClient) GetVoltha(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Voltha, error) {
44 return &Voltha{}, nil
45}
46
47func (c MockVolthaClient) ListCoreInstances(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CoreInstances, error) {
48 return &CoreInstances{}, nil
49}
50
51func (c MockVolthaClient) GetCoreInstance(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*CoreInstance, error) {
52 return &CoreInstance{}, nil
53}
54
55func (c MockVolthaClient) ListAdapters(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Adapters, error) {
56 return &Adapters{}, nil
57}
58
59func (c MockVolthaClient) ListLogicalDevices(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*LogicalDevices, error) {
60 return &LogicalDevices{}, nil
61}
62
63func (c MockVolthaClient) GetLogicalDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*LogicalDevice, error) {
Kent Hagerman9b0ac0a2020-06-08 11:48:16 -040064 return &LogicalDevice{}, nil
Matteo Scandolo256266d2020-06-01 13:44:07 -070065}
66
67func (c MockVolthaClient) ListLogicalDevicePorts(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*LogicalPorts, error) {
68 return &c.LogicalPorts, nil
69}
70
71func (c MockVolthaClient) GetLogicalDevicePort(ctx context.Context, in *LogicalPortId, opts ...grpc.CallOption) (*LogicalPort, error) {
72 return &LogicalPort{}, nil
73}
74
75func (c MockVolthaClient) EnableLogicalDevicePort(ctx context.Context, in *LogicalPortId, opts ...grpc.CallOption) (*Empty, error) {
76 return &Empty{}, nil
77}
78
79func (c MockVolthaClient) DisableLogicalDevicePort(ctx context.Context, in *LogicalPortId, opts ...grpc.CallOption) (*Empty, error) {
80 return &Empty{}, nil
81}
82
83func (c MockVolthaClient) ListLogicalDeviceFlows(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.Flows, error) {
84 return &c.LogicalDeviceFlows, nil
85}
86
87func (c MockVolthaClient) UpdateLogicalDeviceFlowTable(ctx context.Context, in *openflow_13.FlowTableUpdate, opts ...grpc.CallOption) (*Empty, error) {
88 return &Empty{}, nil
89}
90
91func (c MockVolthaClient) UpdateLogicalDeviceMeterTable(ctx context.Context, in *openflow_13.MeterModUpdate, opts ...grpc.CallOption) (*Empty, error) {
92 return &Empty{}, nil
93}
94
95func (c MockVolthaClient) ListLogicalDeviceMeters(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.Meters, error) {
96 return &openflow_13.Meters{}, nil
97}
98
99func (c MockVolthaClient) ListLogicalDeviceFlowGroups(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.FlowGroups, error) {
100 return &openflow_13.FlowGroups{}, nil
101}
102
103func (c MockVolthaClient) UpdateLogicalDeviceFlowGroupTable(ctx context.Context, in *openflow_13.FlowGroupTableUpdate, opts ...grpc.CallOption) (*Empty, error) {
104 return &Empty{}, nil
105}
106
107func (c MockVolthaClient) ListDevices(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Devices, error) {
108 return &Devices{}, nil
109}
110
111func (c MockVolthaClient) ListDeviceIds(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*common.IDs, error) {
112 return &common.IDs{}, nil
113}
114
115func (c MockVolthaClient) ReconcileDevices(ctx context.Context, in *common.IDs, opts ...grpc.CallOption) (*Empty, error) {
116 return &Empty{}, nil
117}
118
119func (c MockVolthaClient) GetDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Device, error) {
120 return &Device{}, nil
121}
122
123func (c MockVolthaClient) CreateDevice(ctx context.Context, in *Device, opts ...grpc.CallOption) (*Device, error) {
124 return &Device{}, nil
125}
126
127func (c MockVolthaClient) EnableDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
128 return &Empty{}, nil
129}
130
131func (c MockVolthaClient) DisableDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
132 return &Empty{}, nil
133}
134
135func (c MockVolthaClient) RebootDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
136 return &Empty{}, nil
137}
138
139func (c MockVolthaClient) DeleteDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
140 return &Empty{}, nil
141}
142
143func (c MockVolthaClient) DownloadImage(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*common.OperationResp, error) {
144 return &common.OperationResp{}, nil
145}
146
147func (c MockVolthaClient) GetImageDownloadStatus(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*ImageDownload, error) {
148 return &ImageDownload{}, nil
149}
150
151func (c MockVolthaClient) GetImageDownload(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*ImageDownload, error) {
152 return &ImageDownload{}, nil
153}
154
155func (c MockVolthaClient) ListImageDownloads(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*ImageDownloads, error) {
156 return &ImageDownloads{}, nil
157}
158
159func (c MockVolthaClient) CancelImageDownload(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*common.OperationResp, error) {
160 return &common.OperationResp{}, nil
161}
162
163func (c MockVolthaClient) ActivateImageUpdate(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*common.OperationResp, error) {
164 return &common.OperationResp{}, nil
165}
166
167func (c MockVolthaClient) RevertImageUpdate(ctx context.Context, in *ImageDownload, opts ...grpc.CallOption) (*common.OperationResp, error) {
168 return &common.OperationResp{}, nil
169}
170
171func (c MockVolthaClient) ListDevicePorts(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Ports, error) {
172 return &Ports{}, nil
173}
174
175func (c MockVolthaClient) ListDevicePmConfigs(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*PmConfigs, error) {
176 return &PmConfigs{}, nil
177}
178
179func (c MockVolthaClient) UpdateDevicePmConfigs(ctx context.Context, in *PmConfigs, opts ...grpc.CallOption) (*Empty, error) {
180 return &Empty{}, nil
181}
182
183func (c MockVolthaClient) ListDeviceFlows(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.Flows, error) {
184 return &openflow_13.Flows{}, nil
185}
186
187func (c MockVolthaClient) ListDeviceFlowGroups(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*openflow_13.FlowGroups, error) {
188 return &openflow_13.FlowGroups{}, nil
189}
190
191func (c MockVolthaClient) ListDeviceTypes(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DeviceTypes, error) {
192 return &DeviceTypes{}, nil
193}
194
195func (c MockVolthaClient) GetDeviceType(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*DeviceType, error) {
196 return &DeviceType{}, nil
197}
198
199func (c MockVolthaClient) ListDeviceGroups(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DeviceGroups, error) {
200 return &DeviceGroups{}, nil
201}
202
203func (c MockVolthaClient) StreamPacketsOut(ctx context.Context, opts ...grpc.CallOption) (VolthaService_StreamPacketsOutClient, error) {
204 return nil, nil
205}
206
207func (c MockVolthaClient) ReceivePacketsIn(ctx context.Context, in *Empty, opts ...grpc.CallOption) (VolthaService_ReceivePacketsInClient, error) {
208 return nil, nil
209}
210
211func (c MockVolthaClient) ReceiveChangeEvents(ctx context.Context, in *Empty, opts ...grpc.CallOption) (VolthaService_ReceiveChangeEventsClient, error) {
212 return nil, nil
213}
214
215func (c MockVolthaClient) GetDeviceGroup(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*DeviceGroup, error) {
216 return &DeviceGroup{}, nil
217}
218
219func (c MockVolthaClient) CreateEventFilter(ctx context.Context, in *EventFilter, opts ...grpc.CallOption) (*EventFilter, error) {
220 return &EventFilter{}, nil
221}
222
223func (c MockVolthaClient) GetEventFilter(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*EventFilters, error) {
224 return &EventFilters{}, nil
225}
226
227func (c MockVolthaClient) UpdateEventFilter(ctx context.Context, in *EventFilter, opts ...grpc.CallOption) (*EventFilter, error) {
228 return &EventFilter{}, nil
229}
230
231func (c MockVolthaClient) DeleteEventFilter(ctx context.Context, in *EventFilter, opts ...grpc.CallOption) (*Empty, error) {
232 return &Empty{}, nil
233}
234
235func (c MockVolthaClient) ListEventFilters(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*EventFilters, error) {
236 return &EventFilters{}, nil
237}
238
239func (c MockVolthaClient) GetImages(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Images, error) {
240 return &Images{}, nil
241}
242
243func (c MockVolthaClient) SelfTest(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*SelfTestResponse, error) {
244 return &SelfTestResponse{}, nil
245}
246
247func (c MockVolthaClient) GetMibDeviceData(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*omci.MibDeviceData, error) {
248 return &omci.MibDeviceData{}, nil
249}
250
251func (c MockVolthaClient) GetAlarmDeviceData(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*omci.AlarmDeviceData, error) {
252 return &omci.AlarmDeviceData{}, nil
253}
254
255func (c MockVolthaClient) SimulateAlarm(ctx context.Context, in *SimulateAlarmRequest, opts ...grpc.CallOption) (*common.OperationResp, error) {
256 return &common.OperationResp{}, nil
257}
258
259func (c MockVolthaClient) Subscribe(ctx context.Context, in *OfAgentSubscriber, opts ...grpc.CallOption) (*OfAgentSubscriber, error) {
260 return &OfAgentSubscriber{}, nil
261}
262
263func (c MockVolthaClient) EnablePort(ctx context.Context, in *Port, opts ...grpc.CallOption) (*Empty, error) {
264 return &Empty{}, nil
265}
266
267func (c MockVolthaClient) DisablePort(ctx context.Context, in *Port, opts ...grpc.CallOption) (*Empty, error) {
268 return &Empty{}, nil
269}
270
271func (c MockVolthaClient) GetExtValue(ctx context.Context, in *common.ValueSpecifier, opts ...grpc.CallOption) (*common.ReturnValues, error) {
272 return &common.ReturnValues{}, nil
273}
274
275func (c MockVolthaClient) StartOmciTestAction(ctx context.Context, in *OmciTestRequest, opts ...grpc.CallOption) (*TestResponse, error) {
276 return &TestResponse{}, nil
277}
Maninder12b909f2020-10-23 14:23:36 +0530278
279func (c MockVolthaClient) ForceDeleteDevice(ctx context.Context, in *common.ID, opts ...grpc.CallOption) (*Empty, error) {
280 return &Empty{}, nil
281}
282
283func (c MockVolthaClient) SetExtValue(ctx context.Context, in *ValueSet, opts ...grpc.CallOption) (*Empty, error) {
284 return &Empty{}, nil
285}