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