blob: e83f935663d9e0687dc0639a51237f55d4a3f936 [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
Kent Hagerman45a13e42020-04-13 12:23:50 -040031// getDevice -
32func (dm *DeviceManager) GetDevice(ctx context.Context, deviceID *voltha.ID) (*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 -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050042func (dm *DeviceManager) NotifyInvalidTransition(ctx context.Context, cDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050043 return nil
44}
45
npujar1d86a522019-11-14 17:11:16 +053046// CreateLogicalDevice -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050047func (dm *DeviceManager) CreateLogicalDevice(ctx context.Context, cDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050048 return nil
49}
50
npujar1d86a522019-11-14 17:11:16 +053051// SetupUNILogicalPorts -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050052func (dm *DeviceManager) SetupUNILogicalPorts(ctx context.Context, cDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050053 return nil
54}
55
npujar1d86a522019-11-14 17:11:16 +053056// DisableAllChildDevices -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050057func (dm *DeviceManager) DisableAllChildDevices(ctx context.Context, cDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050058 return nil
59}
60
npujar1d86a522019-11-14 17:11:16 +053061// DeleteLogicalDevice -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050062func (dm *DeviceManager) DeleteLogicalDevice(ctx context.Context, cDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050063 return nil
64}
65
npujar1d86a522019-11-14 17:11:16 +053066// DeleteLogicalPorts -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050067func (dm *DeviceManager) DeleteLogicalPorts(ctx context.Context, cDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050068 return nil
69}
70
npujar1d86a522019-11-14 17:11:16 +053071// DeleteAllChildDevices -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050072func (dm *DeviceManager) DeleteAllChildDevices(ctx context.Context, cDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050073 return nil
74}
75
Girish Gowdra408cd962020-03-11 14:31:31 -070076// DeleteAllLogicalPorts -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050077func (dm *DeviceManager) DeleteAllLogicalPorts(ctx context.Context, cDevice *voltha.Device) error {
Girish Gowdra408cd962020-03-11 14:31:31 -070078 return nil
79}
80
81// DeleteAllDeviceFlows -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050082func (dm *DeviceManager) DeleteAllDeviceFlows(ctx context.Context, cDevice *voltha.Device) error {
Girish Gowdra408cd962020-03-11 14:31:31 -070083 return nil
84}
85
npujar1d86a522019-11-14 17:11:16 +053086// RunPostDeviceDelete -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050087func (dm *DeviceManager) RunPostDeviceDelete(ctx context.Context, cDevice *voltha.Device) error {
khenaidooab1f7bd2019-11-14 14:00:27 -050088 return nil
89}
90
khenaidoo442e7c72020-03-10 16:13:48 -040091// childDeviceLost -
Kent Hagermand9cc2e92019-11-04 13:28:15 -050092func (dm *DeviceManager) ChildDeviceLost(ctx context.Context, cDevice *voltha.Device) error {
Chaitrashree G S543df3e2020-02-24 22:36:54 -050093 return nil
94}