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