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