blob: 7fb298309eecc23903eb25c0b0ba8c967ba44e4e [file] [log] [blame]
khenaidooab1f7bd2019-11-14 14:00:27 -05001/*
2 * Copyright 2019-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 */
npujar1d86a522019-11-14 17:11:16 +053016
khenaidooab1f7bd2019-11-14 14:00:27 -050017package mocks
18
19import (
20 "context"
npujar1d86a522019-11-14 17:11:16 +053021
serkant.uluderya2ae470f2020-01-21 11:13:09 -080022 "github.com/opencord/voltha-protos/v3/go/voltha"
khenaidooab1f7bd2019-11-14 14:00:27 -050023)
24
khenaidoo442e7c72020-03-10 16:13:48 -040025// DeviceManager represents a mock of a device manager that implements the coreif/DeviceManager interface. It provides
26// default behaviors. For non-default behavior, another implementation of the coreif/DeviceManager interface must be
27// used.
khenaidooab1f7bd2019-11-14 14:00:27 -050028type DeviceManager struct {
29}
30
npujar1d86a522019-11-14 17:11:16 +053031// GetDevice -
npujar467fe752020-01-16 20:17:45 +053032func (dm *DeviceManager) GetDevice(ctx context.Context, deviceID string) (*voltha.Device, error) {
khenaidooab1f7bd2019-11-14 14:00:27 -050033 return nil, nil
34}
npujar1d86a522019-11-14 17:11:16 +053035
36// IsRootDevice -
37func (dm *DeviceManager) IsRootDevice(deviceID string) (bool, error) {
khenaidooab1f7bd2019-11-14 14:00:27 -050038 return false, nil
39}
40
npujar1d86a522019-11-14 17:11:16 +053041// NotifyInvalidTransition -
khenaidoo442e7c72020-03-10 16:13:48 -040042func (dm *DeviceManager) NotifyInvalidTransition(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050043 return nil
44}
45
npujar1d86a522019-11-14 17:11:16 +053046// CreateLogicalDevice -
khenaidoo442e7c72020-03-10 16:13:48 -040047func (dm *DeviceManager) CreateLogicalDevice(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050048 return nil
49}
50
npujar1d86a522019-11-14 17:11:16 +053051// SetupUNILogicalPorts -
khenaidoo442e7c72020-03-10 16:13:48 -040052func (dm *DeviceManager) SetupUNILogicalPorts(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050053 return nil
54}
55
npujar1d86a522019-11-14 17:11:16 +053056// DisableAllChildDevices -
khenaidoo442e7c72020-03-10 16:13:48 -040057func (dm *DeviceManager) DisableAllChildDevices(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050058 return nil
59}
60
npujar1d86a522019-11-14 17:11:16 +053061// DeleteLogicalDevice -
khenaidoo442e7c72020-03-10 16:13:48 -040062func (dm *DeviceManager) DeleteLogicalDevice(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050063 return nil
64}
65
npujar1d86a522019-11-14 17:11:16 +053066// DeleteLogicalPorts -
khenaidoo442e7c72020-03-10 16:13:48 -040067func (dm *DeviceManager) DeleteLogicalPorts(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050068 return nil
69}
70
npujar1d86a522019-11-14 17:11:16 +053071// DeleteAllChildDevices -
khenaidoo442e7c72020-03-10 16:13:48 -040072func (dm *DeviceManager) DeleteAllChildDevices(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050073 return nil
74}
75
Hardik Windlassc704def2020-02-26 18:23:19 +000076// DeleteAllUNILogicalPorts -
khenaidoo442e7c72020-03-10 16:13:48 -040077func (dm *DeviceManager) DeleteAllUNILogicalPorts(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
Hardik Windlassc704def2020-02-26 18:23:19 +000078 return nil
79}
80
Girish Gowdra408cd962020-03-11 14:31:31 -070081// DeleteAllLogicalPorts -
82func (dm *DeviceManager) DeleteAllLogicalPorts(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
83 return nil
84}
85
86// DeleteAllDeviceFlows -
87func (dm *DeviceManager) DeleteAllDeviceFlows(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
88 return nil
89}
90
npujar1d86a522019-11-14 17:11:16 +053091// RunPostDeviceDelete -
khenaidoo442e7c72020-03-10 16:13:48 -040092func (dm *DeviceManager) RunPostDeviceDelete(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050093 return nil
94}
95
khenaidoo442e7c72020-03-10 16:13:48 -040096// childDeviceLost -
97func (dm *DeviceManager) ChildDeviceLost(ctx context.Context, cDevice *voltha.Device, pDevice *voltha.Device) error {
Chaitrashree G S543df3e2020-02-24 22:36:54 -050098 return nil
99}