Adding UTs part-1
Change-Id: I7fdb7751f536d1a616cf2a81b7ef16747d71f692
diff --git a/internal/pkg/application/application_test.go b/internal/pkg/application/application_test.go
new file mode 100644
index 0000000..ca2e2b9
--- /dev/null
+++ b/internal/pkg/application/application_test.go
@@ -0,0 +1,2377 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package application
+
+import (
+ "context"
+ "encoding/json"
+ "net"
+ "reflect"
+ "sync"
+ "testing"
+ "voltha-go-controller/internal/pkg/controller"
+ "voltha-go-controller/internal/pkg/intf"
+ "voltha-go-controller/internal/pkg/of"
+ "voltha-go-controller/internal/pkg/util"
+ "voltha-go-controller/internal/test/mocks"
+
+ "github.com/golang/mock/gomock"
+ "github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore"
+ "github.com/stretchr/testify/assert"
+ "go.uber.org/atomic"
+)
+
+func TestVoltApplication_RestoreNbDeviceFromDb(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ deviceID string
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltApplication_RestoreNbDeviceFromDb",
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_device_id",
+ },
+ },
+ {
+ name: "VoltApplication_RestoreNbDeviceFromDb_invalid_Value_type",
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_device_id1",
+ },
+ },
+ {
+ name: "VoltApplication_RestoreNbDeviceFromDb_unmarshal_error",
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_device_id1",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ NbDevice: sync.Map{},
+ }
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ switch tt.name {
+ case "VoltApplication_RestoreNbDeviceFromDb":
+ var port PonPortCfg
+ port = PonPortCfg{
+ PortAlarmProfileID: "test",
+ PortID: 256,
+ MaxActiveChannels: 256,
+ ActiveIGMPChannels: 7679,
+ EnableMulticastKPI: false,
+ }
+ b, err := json.Marshal(port)
+ if err != nil {
+ panic(err)
+ }
+ test := map[string]*kvstore.KVPair{}
+ test["test_device_id"] = &kvstore.KVPair{
+ Key: "test_device_id",
+ Value: b,
+ }
+ dbintf.EXPECT().GetAllNbPorts(gomock.Any(), gomock.Any()).Return(test, nil).Times(1)
+ got := va.RestoreNbDeviceFromDb(tt.args.cntx, tt.args.deviceID)
+ assert.NotNil(t, got)
+ case "VoltApplication_RestoreNbDeviceFromDb_invalid_Value_type":
+ test := map[string]*kvstore.KVPair{}
+ test["test_device_id"] = &kvstore.KVPair{
+ Key: "test_device_id",
+ Value: "invalid_value",
+ }
+ dbintf.EXPECT().GetAllNbPorts(gomock.Any(), gomock.Any()).Return(test, nil).Times(1)
+ got := va.RestoreNbDeviceFromDb(tt.args.cntx, tt.args.deviceID)
+ assert.NotNil(t, got)
+ case "VoltApplication_RestoreNbDeviceFromDb_unmarshal_error":
+ b, err := json.Marshal("error")
+ if err != nil {
+ panic(err)
+ }
+ test := map[string]*kvstore.KVPair{}
+ test["test_device_id"] = &kvstore.KVPair{
+ Key: "test_device_id",
+ Value: b,
+ }
+ dbintf.EXPECT().GetAllNbPorts(gomock.Any(), gomock.Any()).Return(test, nil).Times(1)
+ got := va.RestoreNbDeviceFromDb(tt.args.cntx, tt.args.deviceID)
+ assert.NotNil(t, got)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_UpdateDeviceConfig(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ deviceConfig *DeviceConfig
+ }
+
+ dvcConfg := &DeviceConfig{
+ SerialNumber: "SDX6320031",
+ HardwareIdentifier: "0.0.0.0",
+ IPAddress: "127.26.1.74",
+ UplinkPort: "43322",
+ NasID: "12345",
+ NniDhcpTrapVid: 123,
+ }
+
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "SDX6320031",
+ args: args{
+ cntx: context.Background(),
+ deviceConfig: dvcConfg,
+ },
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ DevicesConfig: sync.Map{},
+ }
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutDeviceConfig(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+
+ va.UpdateDeviceConfig(tt.args.cntx, tt.args.deviceConfig)
+ })
+ }
+}
+
+func TestVoltApplication_RestoreOltFlowService(t *testing.T) {
+ type fields struct {
+ OltFlowServiceConfig OltFlowService
+ }
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ fields fields
+ args args
+ }{
+ {
+ name: "OltFlowService",
+ args: args{
+ cntx: context.Background(),
+ },
+ fields: fields{
+ OltFlowServiceConfig: OltFlowService{
+ DefaultTechProfileID: 1233,
+ EnableDhcpOnNni: true,
+ EnableIgmpOnNni: false,
+ RemoveFlowsOnDisable: false,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ OltFlowServiceConfig: tt.fields.OltFlowServiceConfig,
+ }
+
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().GetOltFlowService(gomock.Any()).AnyTimes()
+
+ va.RestoreOltFlowService(tt.args.cntx)
+ })
+ }
+}
+
+func TestVoltApplication_UpdateOltFlowService(t *testing.T) {
+ type fields struct {
+ OltFlowServiceConfig OltFlowService
+ }
+ type args struct {
+ cntx context.Context
+ oltFlowService OltFlowService
+ }
+ tests := []struct {
+ name string
+ fields fields
+ args args
+ }{
+ {
+ name: "OltFlowService",
+ args: args{
+ cntx: context.Background(),
+ oltFlowService: OltFlowService{
+ DefaultTechProfileID: 1233,
+ EnableDhcpOnNni: true,
+ EnableIgmpOnNni: false,
+ RemoveFlowsOnDisable: false,
+ },
+ },
+ fields: fields{
+ OltFlowServiceConfig: OltFlowService{
+ DefaultTechProfileID: 1233,
+ EnableDhcpOnNni: true,
+ EnableIgmpOnNni: false,
+ RemoveFlowsOnDisable: false,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ OltFlowServiceConfig: tt.fields.OltFlowServiceConfig,
+ }
+
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutOltFlowService(gomock.Any(), gomock.Any()).AnyTimes()
+ va.UpdateOltFlowService(tt.args.cntx, tt.args.oltFlowService)
+ })
+ }
+}
+
+func TestVoltApplication_TriggerPendingVpvDeleteReq(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ device string
+ }
+ macAdd, _ := net.ParseMAC("ff:ff:ff:ff:ff:ff")
+ test := map[*VoltPortVnet]bool{}
+ test[&VoltPortVnet{Device: "SDX6320031", Port: "16777472", MacAddr: macAdd}] = true
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "SDX6320031",
+ args: args{
+ cntx: context.Background(),
+ device: "SDX6320031",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ VoltPortVnetsToDelete: test,
+ }
+ va.TriggerPendingVpvDeleteReq(tt.args.cntx, tt.args.device)
+ })
+ }
+}
+
+func TestVoltApplication_TriggerPendingProfileDeleteReq(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ device string
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "SDX6320031",
+ args: args{
+ cntx: context.Background(),
+ device: "SDX6320031",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ va.TriggerPendingProfileDeleteReq(tt.args.cntx, tt.args.device)
+ })
+ }
+}
+
+func TestVoltApplication_TriggerPendingServiceDeleteReq(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ device string
+ }
+ voltServ := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ Device: "SDX6320031",
+ ForceDelete: true,
+ },
+ }
+
+ servicesToDel := map[string]bool{}
+ servicesToDel["SCOM00001c75-1_SCOM00001c75-1-4096-2310-4096-65"] = true
+
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_TriggerPendingServiceDeleteReq",
+ args: args{
+ cntx: context.Background(),
+ device: "SDX6320031",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ ServicesToDelete: servicesToDel,
+ ServiceByName: sync.Map{},
+ DevicesDisc: sync.Map{},
+ }
+
+ va.ServiceByName.Store("SCOM00001c75-1_SCOM00001c75-1-4096-2310-4096-65", voltServ)
+
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ dbintf.EXPECT().DelService(gomock.Any(), gomock.Any()).AnyTimes()
+ va.TriggerPendingServiceDeleteReq(tt.args.cntx, tt.args.device)
+ })
+ }
+}
+
+func TestVoltApplication_TriggerPendingVnetDeleteReq(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ device string
+ }
+
+ vnetToDel := map[string]bool{}
+ vnetToDel["2310-4096-4096"] = true
+
+ voltVnet := &VoltVnet{
+ Version: "v3",
+ VnetConfig: VnetConfig{
+ Name: "2310-4096-4096",
+ VnetType: "Encapsulation",
+ SVlan: 2310,
+ CVlan: 4096,
+ UniVlan: 4096,
+ SVlanTpid: 33024,
+ },
+ VnetOper: VnetOper{
+ PendingDeviceToDelete: "SDX63200313",
+ },
+ }
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ }
+
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Negative_Case_TriggerPendingVnetDeleteReq",
+ args: args{
+ cntx: context.Background(),
+ device: "SDX6320031",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ VnetsToDelete: vnetToDel,
+ DevicesDisc: sync.Map{},
+ }
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ va.VnetsByName.Store("2310-4096-4096", voltVnet)
+ va.TriggerPendingVnetDeleteReq(tt.args.cntx, tt.args.device)
+ })
+ }
+}
+
+func TestVoltApplication_UpdateMacInPortMap(t *testing.T) {
+ type args struct {
+ macAddr net.HardwareAddr
+ port string
+ }
+ macAdd, _ := net.ParseMAC("ff:ff:ff:ff:ff:ff")
+ macPort := map[string]string{}
+ macPort[macAdd.String()] = "1234"
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_UpdateMacInPortMap",
+ args: args{
+ macAddr: macAdd,
+ port: "1234",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ macPortMap: macPort,
+ }
+ va.UpdateMacInPortMap(tt.args.macAddr, tt.args.port)
+ })
+ }
+}
+
+func TestVoltApplication_GetMacInPortMap(t *testing.T) {
+ type args struct {
+ macAddr net.HardwareAddr
+ }
+ macAdd, _ := net.ParseMAC("ff:ff:ff:ff:ff:ff")
+ macPort := map[string]string{}
+ macPort[macAdd.String()] = "1234"
+ tests := []struct {
+ name string
+ args args
+ want string
+ }{
+ {
+ name: "Positive_Case_GetMacInPortMap",
+ args: args{
+ macAddr: macAdd,
+ },
+ want: "1234",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ macPortMap: macPort,
+ }
+ if got := va.GetMacInPortMap(tt.args.macAddr); got != tt.want {
+ t.Errorf("VoltApplication.GetMacInPortMap() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func Test_pushFlowFailureNotif(t *testing.T) {
+ type args struct {
+ flowStatus intf.FlowStatus
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_pushFlowFailureNotif",
+ args: args{
+ flowStatus: intf.FlowStatus{
+ Device: "SDX6320031",
+ Cookie: "68786618880",
+ Status: 0,
+ Flow: &of.VoltSubFlow{
+ Cookie: 68786618880,
+ TableID: 0,
+ Priority: 100,
+ ErrorReason: "",
+ OldCookie: 0,
+ },
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ pushFlowFailureNotif(tt.args.flowStatus)
+ })
+ }
+}
+
+func TestGetPonPortIDFromUNIPort(t *testing.T) {
+ type args struct {
+ uniPortID uint32
+ }
+ tests := []struct {
+ name string
+ args args
+ want uint32
+ }{
+ {
+ name: "Positive_Case_pushFlowFailureNotif",
+ args: args{
+ uniPortID: 1049600,
+ },
+ want: 1,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ if got := GetPonPortIDFromUNIPort(tt.args.uniPortID); got != tt.want {
+ t.Errorf("GetPonPortIDFromUNIPort() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_ProcessFlowModResultIndication(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ flowStatus intf.FlowStatus
+ }
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ FlowAddEventMap: util.NewConcurrentMap(),
+ }
+ flowState := intf.FlowStatus{
+ Device: "SDX6320031",
+ Cookie: "68786618880",
+ Status: 1005,
+ FlowModType: 0,
+ Flow: &of.VoltSubFlow{
+ Cookie: 68786618880,
+ OldCookie: 0,
+ TableID: 0,
+ State: 0,
+ Priority: 100,
+ },
+ }
+ flowAddEvent := map[string]*FlowEvent{}
+ flowEvent := &FlowEvent{
+ device: "SDX6320031",
+ cookie: "68786618880",
+ eType: EventTypeControlFlowAdded,
+ }
+ flowAddEvent["68786618880"] = flowEvent
+ voltDev.FlowAddEventMap.Set("6878661888", flowEvent)
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_ProcessFlowModResultIndication",
+ args: args{
+ cntx: context.Background(),
+ flowStatus: flowState,
+ },
+ },
+ {
+ name: "Negetive_Case_ProcessFlowModResultIndication",
+ args: args{
+ cntx: context.Background(),
+ flowStatus: flowState,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_ProcessFlowModResultIndication":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ va.ProcessFlowModResultIndication(tt.args.cntx, tt.args.flowStatus)
+ case "Negetive_Case_ProcessFlowModResultIndication":
+ va.ProcessFlowModResultIndication(tt.args.cntx, tt.args.flowStatus)
+ }
+ })
+ }
+}
+func Test_getPendingPoolKey(t *testing.T) {
+ type args struct {
+ mvlan of.VlanType
+ device string
+ }
+
+ tests := []struct {
+ name string
+ args args
+ want string
+ }{
+ {
+ name: "Positive_Case_getPendingPoolKey",
+ args: args{
+ mvlan: of.VlanAny,
+ device: "SDX6320031",
+ },
+ want: "4096_SDX6320031",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ if got := getPendingPoolKey(tt.args.mvlan, tt.args.device); got != tt.want {
+ t.Errorf("getPendingPoolKey() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestNewVoltPort(t *testing.T) {
+ type args struct {
+ device string
+ name string
+ id uint32
+ }
+
+ voltPort := &VoltPort{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ Device: "SDX6320031",
+ ID: 16777472,
+ State: PortStateDown,
+ ChannelPerSubAlarmRaised: false,
+ Type: VoltPortTypeNni,
+ }
+
+ voltPort1 := &VoltPort{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ Device: "SDX6320031",
+ ID: 1049600,
+ State: PortStateDown,
+ ChannelPerSubAlarmRaised: false,
+ PonPort: GetPonPortIDFromUNIPort(1049600),
+ }
+ tests := []struct {
+ name string
+ args args
+ want *VoltPort
+ }{
+ {
+ name: "Positive_Case_TestNewVoltPort",
+ args: args{
+ id: 16777472,
+ device: "SDX6320031",
+ name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ },
+ want: voltPort,
+ },
+ {
+ name: "Positive_Case2_TestNewVoltPort",
+ args: args{
+ id: 1049600,
+ device: "SDX6320031",
+ name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ },
+ want: voltPort1,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "Positive_Case_TestNewVoltPort":
+ if got := NewVoltPort(tt.args.device, tt.args.name, tt.args.id); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("NewVoltPort() = %v, want %v", got, tt.want)
+ }
+ case "Positive_Case2_TestNewVoltPort":
+ if got := NewVoltPort(tt.args.device, tt.args.name, tt.args.id); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("NewVoltPort() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltPort_SetPortID(t *testing.T) {
+ type args struct {
+ id uint32
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_TestNewVoltPort",
+ args: args{
+ id: 16777472,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ vp := &VoltPort{
+ ID: 16777472,
+ Type: VoltPortTypeNni,
+ }
+ vp.SetPortID(tt.args.id)
+ })
+ }
+}
+
+func TestNewVoltDevice(t *testing.T) {
+ type args struct {
+ name string
+ slno string
+ southBoundID string
+ }
+
+ devConfig := &DeviceConfig{
+ SerialNumber: "SDX6320033",
+ NniDhcpTrapVid: 4,
+ }
+ voltDevice := &VoltDevice{
+ Name: "11c3175b-50f3-4220-9555-93df733ded1d",
+ SerialNum: "SDX6320033",
+ SouthBoundID: "68580342-6b3e-57cb-9ea4-06125594e330",
+ State: controller.DeviceStateDOWN,
+ NniPort: "",
+ icmpv6GroupAdded: false,
+ IgmpDsFlowAppliedForMvlan: make(map[uint16]bool),
+ ConfiguredVlanForDeviceFlows: util.NewConcurrentMap(),
+ MigratingServices: util.NewConcurrentMap(),
+ VpvsBySvlan: util.NewConcurrentMap(),
+ FlowAddEventMap: util.NewConcurrentMap(),
+ FlowDelEventMap: util.NewConcurrentMap(),
+ GlobalDhcpFlowAdded: false,
+ NniDhcpTrapVid: 4,
+ }
+
+ GetApplication().DevicesConfig.Store("SDX6320033", devConfig)
+ tests := []struct {
+ name string
+ args args
+ want *VoltDevice
+ }{
+ {
+ name: "Positive_Case_TestNewVoltDevice",
+ args: args{
+ name: "11c3175b-50f3-4220-9555-93df733ded1d",
+ slno: "SDX6320033",
+ southBoundID: "68580342-6b3e-57cb-9ea4-06125594e330",
+ },
+ want: voltDevice,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ if got := NewVoltDevice(tt.args.name, tt.args.slno, tt.args.southBoundID); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("NewVoltDevice() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_GetAssociatedVpvsForDevice(t *testing.T) {
+ type args struct {
+ device string
+ svlan of.VlanType
+ }
+
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320033",
+ NniDhcpTrapVid: 123,
+ VpvsBySvlan: util.NewConcurrentMap(),
+ }
+
+ cuncurrentMap := &util.ConcurrentMap{
+ Count: atomic.NewUint64(0),
+ }
+
+ voltDev1 := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320033",
+ NniDhcpTrapVid: 123,
+ VpvsBySvlan: cuncurrentMap,
+ }
+ tests := []struct {
+ name string
+ args args
+ want *util.ConcurrentMap
+ }{
+ {
+ name: "Positive_Case_GetAssociatedVpvsForDevice",
+ args: args{
+ device: "SDX6320033",
+ svlan: of.VlanAny,
+ },
+ want: util.NewConcurrentMap(),
+ },
+ {
+ name: "Positive_Case2_GetAssociatedVpvsForDevice",
+ args: args{
+ device: "SDX6320033",
+ svlan: of.VlanAny,
+ },
+ want: cuncurrentMap,
+ },
+ {
+ name: "Negetive_Case2_GetAssociatedVpvsForDevice",
+ args: args{
+ device: "SDX6320031",
+ svlan: of.VlanAny,
+ },
+ want: nil,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "Positive_Case_GetAssociatedVpvsForDevice":
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ VnetsBySvlan: util.NewConcurrentMap(),
+ }
+ va.DevicesDisc.Store("SDX6320033", voltDev)
+ if got := va.GetAssociatedVpvsForDevice(tt.args.device, tt.args.svlan); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("VoltApplication.GetAssociatedVpvsForDevice() = %v, want %v", got, tt.want)
+ }
+ case "Positive_Case2_GetAssociatedVpvsForDevice":
+ va1 := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ VnetsBySvlan: cuncurrentMap,
+ }
+ va1.DevicesDisc.Store("SDX6320033", voltDev1)
+ va1.VnetsBySvlan.Set(of.VlanAny, cuncurrentMap)
+ if got := va1.GetAssociatedVpvsForDevice(tt.args.device, tt.args.svlan); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("VoltApplication.GetAssociatedVpvsForDevice() = %v, want %v", got, tt.want)
+ }
+ case "Negetive_Case2_GetAssociatedVpvsForDevice":
+ va1 := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ if got := va1.GetAssociatedVpvsForDevice(tt.args.device, tt.args.svlan); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("VoltApplication.GetAssociatedVpvsForDevice() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltApplication_AssociateVpvsToDevice(t *testing.T) {
+ type args struct {
+ device string
+ vpv *VoltPortVnet
+ }
+
+ vpv := &VoltPortVnet{
+ Device: "SDX6320033",
+ SVlan: of.VlanAny,
+ }
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320033",
+ NniDhcpTrapVid: 123,
+ VpvsBySvlan: util.NewConcurrentMap(),
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_AssociateVpvsToDevice",
+ args: args{
+ device: "SDX6320033",
+ vpv: vpv,
+ },
+ },
+ {
+ name: "Negetive_Case_AssociateVpvsToDevice",
+ args: args{
+ device: "SDX6320033",
+ vpv: vpv,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "Positive_Case_AssociateVpvsToDevice":
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ VnetsBySvlan: util.NewConcurrentMap(),
+ }
+ va.DevicesDisc.Store("SDX6320033", voltDev)
+ va.AssociateVpvsToDevice(tt.args.device, tt.args.vpv)
+ case "Negetive_Case_AssociateVpvsToDevice":
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ VnetsBySvlan: util.NewConcurrentMap(),
+ }
+ va.AssociateVpvsToDevice(tt.args.device, tt.args.vpv)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_DisassociateVpvsFromDevice(t *testing.T) {
+ type args struct {
+ device string
+ vpv *VoltPortVnet
+ }
+ vpv := &VoltPortVnet{
+ Device: "SDX6320033",
+ SVlan: of.VlanAny,
+ }
+
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320033",
+ NniDhcpTrapVid: 123,
+ VpvsBySvlan: util.NewConcurrentMap(),
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_DisassociateVpvsFromDevice",
+ args: args{
+ device: "SDX6320033",
+ vpv: vpv,
+ },
+ },
+ {
+ name: "Negetive_Case_DisassociateVpvsFromDevice",
+ args: args{
+ device: "SDX6320033",
+ vpv: vpv,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "Positive_Case_DisassociateVpvsFromDevice":
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ VnetsBySvlan: util.NewConcurrentMap(),
+ }
+ va.DevicesDisc.Store("SDX6320033", voltDev)
+ va.DisassociateVpvsFromDevice(tt.args.device, tt.args.vpv)
+ case "Negetive_Case_DisassociateVpvsFromDevice":
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ VnetsBySvlan: util.NewConcurrentMap(),
+ }
+ va.DisassociateVpvsFromDevice(tt.args.device, tt.args.vpv)
+ }
+ })
+ }
+}
+
+func TestVoltDevice_GetPort(t *testing.T) {
+ type args struct {
+ port string
+ }
+ voltPort := &VoltPort{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ Device: "SDX6320031",
+ ID: 16777472,
+ State: PortStateDown,
+ ChannelPerSubAlarmRaised: false,
+ Type: VoltPortTypeNni,
+ }
+ tests := []struct {
+ name string
+ args args
+ want *VoltPort
+ }{
+ {
+ name: "Positive_Case_GetPort",
+ args: args{
+ port: "16777472",
+ },
+ want: voltPort,
+ },
+ {
+ name: "Negetive_Case_GetPort",
+ args: args{
+ port: "16777472",
+ },
+ want: nil,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ d := &VoltDevice{
+ Ports: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_GetPort":
+ d.Ports.Store("16777472", voltPort)
+ if got := d.GetPort(tt.args.port); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("VoltDevice.GetPort() = %v, want %v", got, tt.want)
+ }
+ case "Negetive_Case_GetPort":
+ if got := d.GetPort(tt.args.port); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("VoltDevice.GetPort() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltDevice_GetPortNameFromPortID(t *testing.T) {
+ type args struct {
+ portID uint32
+ }
+ voltPort := &VoltPort{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ Device: "SDX6320031",
+ ID: 16777472,
+ State: PortStateDown,
+ ChannelPerSubAlarmRaised: false,
+ Type: VoltPortTypeNni,
+ }
+ tests := []struct {
+ name string
+ args args
+ want string
+ }{
+ {
+ name: "Positive_Case_GetPort",
+ args: args{
+ portID: 16777472,
+ },
+ want: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ d := &VoltDevice{
+ Ports: sync.Map{},
+ }
+ d.Ports.Store(16777472, voltPort)
+ if got := d.GetPortNameFromPortID(tt.args.portID); got != tt.want {
+ t.Errorf("VoltDevice.GetPortNameFromPortID() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestVoltDevice_DelPort(t *testing.T) {
+ type args struct {
+ port string
+ }
+ voltPort := &VoltPort{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ Device: "SDX6320031",
+ ID: 16777472,
+ State: PortStateDown,
+ ChannelPerSubAlarmRaised: false,
+ Type: VoltPortTypeNni,
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_DelPort",
+ args: args{
+ port: "16777472",
+ },
+ },
+ {
+ name: "Negetive_Case_DelPort",
+ args: args{
+ port: "16777472",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ d := &VoltDevice{
+ Ports: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_DelPort":
+ d.Ports.Store("16777472", voltPort)
+ d.DelPort(tt.args.port)
+ case "Negetive_Case_DelPort":
+ d.DelPort(tt.args.port)
+ }
+ })
+ }
+}
+
+func TestVoltDevice_pushFlowsForUnis(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_pushFlowsForUnis",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ {
+ name: "Negetive_Case_pushFlowsForUnis",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ {
+ name: "Negetive_Case1_pushFlowsForUnis",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ d := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ Ports: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_pushFlowsForUnis":
+ voltPort := &VoltPort{
+ Name: "16777472",
+ Device: "SDX6320031",
+ ID: 16777472,
+ State: PortStateUp,
+ ChannelPerSubAlarmRaised: false,
+ Type: VoltPortTypeNni,
+ }
+ d.Ports.Store("16777472", voltPort)
+ ga := GetApplication()
+ voltPortVnets := make([]*VoltPortVnet, 0)
+ voltPortVnet := &VoltPortVnet{
+ Device: "SDX6320031",
+ Port: "16777472",
+ DeleteInProgress: true,
+ }
+ voltPortVnets = append(voltPortVnets, voltPortVnet)
+ ga.VnetsByPort.Store("16777472", voltPortVnets)
+
+ d.pushFlowsForUnis(tt.args.cntx)
+ case "Negetive_Case_pushFlowsForUnis":
+ voltPort1 := &VoltPort{
+ Name: "16777472",
+ Device: "SDX6320031",
+ ID: 16777472,
+ State: PortStateDown,
+ ChannelPerSubAlarmRaised: false,
+ Type: VoltPortTypeNni,
+ }
+ d.Ports.Store("16777472", voltPort1)
+ d.pushFlowsForUnis(tt.args.cntx)
+ case "Negetive_Case1_pushFlowsForUnis":
+ voltPort2 := &VoltPort{
+ Name: "16777472",
+ Device: "SDX6320031",
+ ID: 16777472,
+ State: PortStateUp,
+ ChannelPerSubAlarmRaised: false,
+ Type: VoltPortTypeNni,
+ }
+ d.Ports.Store("1677747", voltPort2)
+ d.pushFlowsForUnis(tt.args.cntx)
+ }
+ })
+ }
+}
+
+func TestNewNbDevice(t *testing.T) {
+ tests := []struct {
+ name string
+ want *NbDevice
+ }{
+ {
+ name: "Positive_Case_pushFlowsForUnis",
+ want: &NbDevice{},
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ if got := NewNbDevice(); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("NewNbDevice() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestNbDevice_WriteToDb(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ portID uint32
+ ponPort *PonPortCfg
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_pushFlowsForUnis",
+ args: args{
+ cntx: context.Background(),
+ portID: controller.NNIPortID,
+ ponPort: &PonPortCfg{
+ PortID: controller.NNIPortID,
+ EnableMulticastKPI: false,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ nbd := &NbDevice{
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ }
+ switch tt.name {
+ case "Positive_Case_pushFlowsForUnis":
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ nbd.WriteToDb(tt.args.cntx, tt.args.portID, tt.args.ponPort)
+ }
+ })
+ }
+}
+
+func TestNbDevice_AddPortToNbDevice(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ portID uint32
+ allowedChannels uint32
+ enableMulticastKPI bool
+ portAlarmProfileID string
+ }
+ ponPort := &PonPortCfg{
+ PortID: controller.NNIPortID,
+ MaxActiveChannels: 123,
+ EnableMulticastKPI: false,
+ PortAlarmProfileID: "16777",
+ }
+ tests := []struct {
+ name string
+ args args
+ want *PonPortCfg
+ }{
+ {
+ name: "Positive_Case_AddPortToNbDevice",
+ args: args{
+ cntx: context.Background(),
+ portID: controller.NNIPortID,
+ allowedChannels: 123,
+ enableMulticastKPI: false,
+ portAlarmProfileID: "16777",
+ },
+ want: ponPort,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ nbd := &NbDevice{
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ PonPorts: sync.Map{},
+ }
+ nbd.PonPorts.Store(controller.NNIPortID, ponPort)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if got := nbd.AddPortToNbDevice(tt.args.cntx, tt.args.portID, tt.args.allowedChannels, tt.args.enableMulticastKPI, tt.args.portAlarmProfileID); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("NbDevice.AddPortToNbDevice() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_AddDeviceConfig(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ serialNum string
+ hardwareIdentifier string
+ nasID string
+ ipAddress string
+ uplinkPort string
+ nniDhcpTrapID int
+ }
+ dvcConfg := &DeviceConfig{
+ SerialNumber: "SDX6320031",
+ HardwareIdentifier: "0.0.0.0",
+ IPAddress: "127.26.1.74",
+ UplinkPort: "16777216",
+ NasID: "12345",
+ NniDhcpTrapVid: 123,
+ }
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ name: "Positive_Case_AddDeviceConfig",
+ args: args{
+ cntx: context.Background(),
+ serialNum: "SDX6320031",
+ hardwareIdentifier: "0.0.0.0.",
+ nasID: "12345",
+ ipAddress: "127.26.1.74",
+ uplinkPort: "16777216",
+ nniDhcpTrapID: 123,
+ },
+ wantErr: false,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesConfig: sync.Map{},
+ }
+ va.DevicesConfig.Store("SDX6320031", dvcConfg)
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutDeviceConfig(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ if err := va.AddDeviceConfig(tt.args.cntx, tt.args.serialNum, tt.args.hardwareIdentifier, tt.args.nasID, tt.args.ipAddress, tt.args.uplinkPort, tt.args.nniDhcpTrapID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.AddDeviceConfig() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_GetDeviceConfig(t *testing.T) {
+ type args struct {
+ serNum string
+ }
+ dvcConfg := &DeviceConfig{
+ SerialNumber: "SDX6320031",
+ HardwareIdentifier: "0.0.0.0",
+ IPAddress: "127.26.1.74",
+ UplinkPort: "16777216",
+ NasID: "12345",
+ NniDhcpTrapVid: 123,
+ }
+ tests := []struct {
+ name string
+ args args
+ want *DeviceConfig
+ }{
+ {
+ name: "Positive_Case_GetDeviceConfig",
+ args: args{
+ serNum: "SDX6320031",
+ },
+ want: dvcConfg,
+ },
+ {
+ name: "Negetive_Case_GetDeviceConfig",
+ args: args{
+ serNum: "SDX6320031",
+ },
+ want: nil,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesConfig: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_GetDeviceConfig":
+ va.DevicesConfig.Store("SDX6320031", dvcConfg)
+ if got := va.GetDeviceConfig(tt.args.serNum); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("VoltApplication.GetDeviceConfig() = %v, want %v", got, tt.want)
+ }
+ case "Negetive_Case_GetDeviceConfig":
+ if got := va.GetDeviceConfig(tt.args.serNum); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("VoltApplication.GetDeviceConfig() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
+
+func TestNbDevice_UpdatePortToNbDevice(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ portID uint32
+ allowedChannels uint32
+ enableMulticastKPI bool
+ portAlarmProfileID string
+ }
+ ponPort := &PonPortCfg{
+ PortID: controller.NNIPortID,
+ MaxActiveChannels: 123,
+ EnableMulticastKPI: false,
+ PortAlarmProfileID: "16777",
+ }
+ tests := []struct {
+ name string
+ args args
+ want *PonPortCfg
+ }{
+ {
+ name: "Positive_Case_UpdatePortToNbDevice",
+ args: args{
+ cntx: context.Background(),
+ portID: controller.NNIPortID,
+ allowedChannels: 123,
+ enableMulticastKPI: false,
+ portAlarmProfileID: "16777",
+ },
+ want: ponPort,
+ },
+ {
+ name: "Negetive_Case_UpdatePortToNbDevice",
+ args: args{
+ cntx: context.Background(),
+ portID: 0,
+ allowedChannels: 123,
+ enableMulticastKPI: false,
+ portAlarmProfileID: "16777",
+ },
+ want: nil,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ nbd := &NbDevice{
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ PonPorts: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_UpdatePortToNbDevice":
+ nbd.PonPorts.Store(controller.NNIPortID, ponPort)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if got := nbd.UpdatePortToNbDevice(tt.args.cntx, tt.args.portID, tt.args.allowedChannels, tt.args.enableMulticastKPI, tt.args.portAlarmProfileID); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("NbDevice.UpdatePortToNbDevice() = %v, want %v", got, tt.want)
+ }
+ case "Negetive_Case_UpdatePortToNbDevice":
+ if got := nbd.UpdatePortToNbDevice(tt.args.cntx, tt.args.portID, tt.args.allowedChannels, tt.args.enableMulticastKPI, tt.args.portAlarmProfileID); !reflect.DeepEqual(got, tt.want) {
+ t.Errorf("NbDevice.UpdatePortToNbDevice() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
+
+func TestNbDevice_DeletePortFromNbDevice(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ portID uint32
+ }
+ ponPort := &PonPortCfg{
+ PortID: controller.NNIPortID,
+ MaxActiveChannels: 123,
+ EnableMulticastKPI: false,
+ PortAlarmProfileID: "16777",
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_DeletePortFromNbDevice",
+ args: args{
+ portID: controller.NNIPortID,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ nbd := &NbDevice{
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ PonPorts: sync.Map{},
+ }
+ nbd.PonPorts.Store(controller.NNIPortID, ponPort)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().DelNbDevicePort(nil, "49686e2d-618f-4e8e-bca0-442ab850a63a", controller.NNIPortID).AnyTimes()
+ nbd.DeletePortFromNbDevice(tt.args.cntx, tt.args.portID)
+ })
+ }
+}
+
+func TestVoltDevice_RegisterFlowAddEvent(t *testing.T) {
+ type args struct {
+ cookie string
+ event *FlowEvent
+ }
+ flowEvent := &FlowEvent{
+ device: "SDX6320031",
+ cookie: "68786618880",
+ eType: EventTypeControlFlowAdded,
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_RegisterFlowAddEvent",
+ args: args{
+ cookie: "68786618880",
+ event: flowEvent,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ d := &VoltDevice{
+ FlowAddEventMap: util.NewConcurrentMap(),
+ }
+ d.RegisterFlowAddEvent(tt.args.cookie, tt.args.event)
+ })
+ }
+}
+
+func TestVoltDevice_RegisterFlowDelEvent(t *testing.T) {
+ type args struct {
+ cookie string
+ event *FlowEvent
+ }
+ flowEvent := &FlowEvent{
+ device: "SDX6320031",
+ cookie: "68786618880",
+ eType: EventTypeControlFlowRemoved,
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_RegisterFlowDelEvent",
+ args: args{
+ cookie: "68786618880",
+ event: flowEvent,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ d := &VoltDevice{
+ FlowDelEventMap: util.NewConcurrentMap(),
+ }
+ d.RegisterFlowDelEvent(tt.args.cookie, tt.args.event)
+ })
+ }
+}
+
+func TestVoltDevice_UnRegisterFlowEvent(t *testing.T) {
+ type args struct {
+ cookie string
+ flowModType of.Command
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_RegisterFlowDelEvent",
+ args: args{
+ cookie: "68786618880",
+ flowModType: of.CommandDel,
+ },
+ },
+ {
+ name: "Negetive_Case_RegisterFlowDelEvent",
+ args: args{
+ cookie: "68786618880",
+ flowModType: opt82,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "Positive_Case_RegisterFlowDelEvent":
+ d := &VoltDevice{
+ FlowDelEventMap: util.NewConcurrentMap(),
+ }
+ d.UnRegisterFlowEvent(tt.args.cookie, tt.args.flowModType)
+ case "Negetive_Case_RegisterFlowDelEvent":
+ d := &VoltDevice{
+ FlowDelEventMap: util.NewConcurrentMap(),
+ }
+ d.UnRegisterFlowEvent(tt.args.cookie, tt.args.flowModType)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_InitStaticConfig(t *testing.T) {
+ tests := []struct {
+ name string
+ }{
+ {
+ name: "Positive_Case_InitStaticConfig",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{}
+ va.InitStaticConfig()
+ })
+ }
+}
+
+func TestVoltApplication_SetVendorID(t *testing.T) {
+ type args struct {
+ vendorID string
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_SetVendorID",
+ args: args{
+ vendorID: "DT",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{}
+ va.SetVendorID(tt.args.vendorID)
+ })
+ }
+}
+
+func TestVoltApplication_GetVendorID(t *testing.T) {
+ tests := []struct {
+ name string
+ want string
+ }{
+ {
+ name: "Positive_Case_GetVendorID",
+ want: "DT",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ vendorID: "DT",
+ }
+ if got := va.GetVendorID(); got != tt.want {
+ t.Errorf("VoltApplication.GetVendorID() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_SetRebootFlag(t *testing.T) {
+ type args struct {
+ flag bool
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_SetRebootFlag",
+ args: args{
+ flag: true,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{}
+ va.SetRebootFlag(tt.args.flag)
+ })
+ }
+}
+
+func TestVoltApplication_GetUpgradeFlag(t *testing.T) {
+ tests := []struct {
+ name string
+ want bool
+ }{
+ {
+ name: "Positive_Case_GetUpgradeFlag",
+ want: true,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{}
+ isUpgradeComplete = true
+ if got := va.GetUpgradeFlag(); got != tt.want {
+ t.Errorf("VoltApplication.GetUpgradeFlag() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_SetUpgradeFlag(t *testing.T) {
+ type args struct {
+ flag bool
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_GetUpgradeFlag",
+ args: args{
+ flag: true,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{}
+ va.SetUpgradeFlag(tt.args.flag)
+ })
+ }
+}
+
+func TestVoltApplication_AddDevice(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ device string
+ slno string
+ southBoundID string
+ }
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a123",
+ }
+ nbd := &NbDevice{
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a123",
+ PonPorts: sync.Map{},
+ }
+ ponPortCnf := &PonPortCfg{
+ PortID: controller.NNIPortID,
+ MaxActiveChannels: 123,
+ EnableMulticastKPI: false,
+ PortAlarmProfileID: "16777",
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_AddDevice",
+ args: args{
+ cntx: context.Background(),
+ device: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ slno: "SDX6320031",
+ southBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a123",
+ },
+ },
+ {
+ name: "Negetive_Case_AddDevice",
+ args: args{
+ cntx: context.Background(),
+ device: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ slno: "SDX6320031",
+ southBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a123",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ NbDevice: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_AddDevice":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ va.NbDevice.Store("49686e2d-618f-4e8e-bca0-442ab850a63a123", nbd)
+ nbd.PonPorts.Store(controller.NNIPortID, ponPortCnf)
+ va.AddDevice(tt.args.cntx, tt.args.device, tt.args.slno, tt.args.southBoundID)
+ case "Negetive_Case_AddDevice":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ nbd.PonPorts.Store(controller.NNIPortID, ponPortCnf)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().GetAllNbPorts(context.Background(), "49686e2d-618f-4e8e-bca0-442ab850a63a123").AnyTimes()
+ va.AddDevice(tt.args.cntx, tt.args.device, tt.args.slno, tt.args.southBoundID)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_DelDevice(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ device string
+ }
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a123",
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_AddDevice",
+ args: args{
+ cntx: context.Background(),
+ device: "SDX6320031",
+ },
+ },
+ {
+ name: "Delete_Case_AddDevice",
+ args: args{
+ cntx: context.Background(),
+ device: "SDX6320031",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_AddDevice":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().DelAllRoutesForDevice(context.Background(), "SDX6320031").AnyTimes()
+ dbintf.EXPECT().GetAllMigrateServicesReq(context.Background(), "SDX6320031").AnyTimes()
+ dbintf.EXPECT().DelAllGroup(context.Background(), "SDX6320031").AnyTimes()
+ dbintf.EXPECT().DelAllMeter(context.Background(), "SDX6320031").AnyTimes()
+ dbintf.EXPECT().DelAllPorts(context.Background(), "SDX6320031").AnyTimes()
+ va.DelDevice(tt.args.cntx, tt.args.device)
+ case "Delete_Case_AddDevice":
+ va.DelDevice(tt.args.cntx, tt.args.device)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_PortAddInd(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ device string
+ id uint32
+ portName string
+ }
+ voltDev := &VoltDevice{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a123",
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_PortAddInd",
+ args: args{
+ cntx: context.Background(),
+ device: "SDX6320031",
+ id: controller.NNIPortID,
+ portName: "16777216",
+ },
+ },
+ {
+ name: "Negetive_Case_PortAddInd",
+ args: args{
+ cntx: context.Background(),
+ device: "SDX6320031",
+ id: controller.NNIPortID,
+ portName: "16777216",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_PortAddInd":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ va.PortAddInd(tt.args.cntx, tt.args.device, tt.args.id, tt.args.portName)
+ case "Negetive_Case_PortAddInd":
+ va.PortAddInd(tt.args.cntx, tt.args.device, tt.args.id, tt.args.portName)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_PortUpdateInd(t *testing.T) {
+ type args struct {
+ device string
+ portName string
+ id uint32
+ }
+ voltDev := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a123",
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_PortUpdateInd",
+ args: args{
+ device: "SDX6320031",
+ id: controller.NNIPortID,
+ portName: "16777216",
+ },
+ },
+ {
+ name: "Negetive_Case_PortUpdateInd",
+ args: args{
+ device: "SDX6320031",
+ id: controller.NNIPortID,
+ portName: "16777216",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_PortAddInd":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ d := &VoltDevice{
+ Ports: sync.Map{},
+ }
+ voltPort := &VoltPort{
+ Name: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ Device: "SDX6320031",
+ ID: 16777472,
+ State: PortStateDown,
+ ChannelPerSubAlarmRaised: false,
+ Type: VoltPortTypeNni,
+ }
+ d.Ports.Store(16777472, voltPort)
+ va.PortUpdateInd(tt.args.device, tt.args.portName, tt.args.id)
+ case "Negetive_Case_PortUpdateInd":
+ va.PortUpdateInd(tt.args.device, tt.args.portName, tt.args.id)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_AddNbPonPort(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ oltSbID string
+ portID uint32
+ maxAllowedChannels uint32
+ enableMulticastKPI bool
+ portAlarmProfileID string
+ }
+ voltDev := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ }
+ nbd := &NbDevice{
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ name: "Positive_Case_AddNbPonPort",
+ args: args{
+ cntx: context.Background(),
+ oltSbID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ portID: 16777472,
+ maxAllowedChannels: 0,
+ enableMulticastKPI: false,
+ portAlarmProfileID: "16777",
+ },
+ },
+ {
+ name: "Negetive_Case_AddNbPonPort",
+ args: args{
+ cntx: context.Background(),
+ oltSbID: "0",
+ portID: 16777472,
+ maxAllowedChannels: 0,
+ enableMulticastKPI: false,
+ portAlarmProfileID: "16777",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ NbDevice: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_AddNbPonPort":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ va.NbDevice.Store("49686e2d-618f-4e8e-bca0-442ab850a63a", nbd)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if err := va.AddNbPonPort(tt.args.cntx, tt.args.oltSbID, tt.args.portID, tt.args.maxAllowedChannels, tt.args.enableMulticastKPI, tt.args.portAlarmProfileID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.AddNbPonPort() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case "Negetive_Case_AddNbPonPort":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if err := va.AddNbPonPort(tt.args.cntx, tt.args.oltSbID, tt.args.portID, tt.args.maxAllowedChannels, tt.args.enableMulticastKPI, tt.args.portAlarmProfileID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.AddNbPonPort() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltApplication_UpdateNbPonPort(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ oltSbID string
+ portID uint32
+ maxAllowedChannels uint32
+ enableMulticastKPI bool
+ portAlarmProfileID string
+ }
+ voltDev := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ ActiveChannelsPerPon: sync.Map{},
+ }
+ nbd := &NbDevice{
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ PonPorts: sync.Map{},
+ }
+ ponPortCnf := &PonPortCfg{
+ PortID: controller.NNIPortID,
+ MaxActiveChannels: 123,
+ EnableMulticastKPI: false,
+ PortAlarmProfileID: "16777",
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ name: "Positive_Case_UpdateNbPonPort",
+ args: args{
+ cntx: context.Background(),
+ oltSbID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ portID: controller.NNIPortID,
+ maxAllowedChannels: 0,
+ enableMulticastKPI: false,
+ portAlarmProfileID: "16777",
+ },
+ wantErr: false,
+ },
+ {
+ name: "Negetive_Case_Port_doesn't_exists",
+ args: args{
+ cntx: context.Background(),
+ oltSbID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ portID: 16777472,
+ maxAllowedChannels: 0,
+ enableMulticastKPI: false,
+ portAlarmProfileID: "16777",
+ },
+ wantErr: true,
+ },
+ {
+ name: "Negetive_Case_Device-doesn't-exists",
+ args: args{
+ cntx: context.Background(),
+ oltSbID: "0",
+ portID: 16777472,
+ maxAllowedChannels: 0,
+ enableMulticastKPI: false,
+ portAlarmProfileID: "16777",
+ },
+ wantErr: true,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ NbDevice: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_UpdateNbPonPort":
+ va.NbDevice.Store("49686e2d-618f-4e8e-bca0-442ab850a63a", nbd)
+ nbd.PonPorts.Store(controller.NNIPortID, ponPortCnf)
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ voltDev.ActiveChannelsPerPon.Store(controller.NNIPortID, ponPortCnf)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if err := va.UpdateNbPonPort(tt.args.cntx, tt.args.oltSbID, tt.args.portID, tt.args.maxAllowedChannels, tt.args.enableMulticastKPI, tt.args.portAlarmProfileID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.UpdateNbPonPort() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case "Negetive_Case_Port_doesn't_exists":
+ va.NbDevice.Store("49686e2d-618f-4e8e-bca0-442ab850a63a", nbd)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if err := va.UpdateNbPonPort(tt.args.cntx, tt.args.oltSbID, tt.args.portID, tt.args.maxAllowedChannels, tt.args.enableMulticastKPI, tt.args.portAlarmProfileID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.UpdateNbPonPort() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case "Negetive_Case_Device-doesn't-exists":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if err := va.UpdateNbPonPort(tt.args.cntx, tt.args.oltSbID, tt.args.portID, tt.args.maxAllowedChannels, tt.args.enableMulticastKPI, tt.args.portAlarmProfileID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.UpdateNbPonPort() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltApplication_DeleteNbPonPort(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ oltSbID string
+ portID uint32
+ }
+ voltDev := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ ActiveChannelsPerPon: sync.Map{},
+ }
+ nbd := &NbDevice{
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ }
+ ponPortCnf := &PonPortCfg{
+ PortID: controller.NNIPortID,
+ MaxActiveChannels: 123,
+ EnableMulticastKPI: false,
+ PortAlarmProfileID: "16777",
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ name: "Positive_Case_DeleteNbPonPort",
+ args: args{
+ cntx: context.Background(),
+ oltSbID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ portID: controller.NNIPortID,
+ },
+ wantErr: false,
+ },
+ {
+ name: "Negetive_Case_DeleteNbPonPort",
+ args: args{
+ cntx: context.Background(),
+ oltSbID: "0",
+ portID: controller.NNIPortID,
+ },
+ wantErr: false,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ NbDevice: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_DeleteNbPonPort":
+ va.NbDevice.Store("49686e2d-618f-4e8e-bca0-442ab850a63a", nbd)
+ nbd.PonPorts.Store(controller.NNIPortID, ponPortCnf)
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ voltDev.ActiveChannelsPerPon.Store(controller.NNIPortID, ponPortCnf)
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().DelNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if err := va.DeleteNbPonPort(tt.args.cntx, tt.args.oltSbID, tt.args.portID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.DeleteNbPonPort() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case "Negetive_Case_DeleteNbPonPort":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().DelNbDevicePort(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
+ if err := va.DeleteNbPonPort(tt.args.cntx, tt.args.oltSbID, tt.args.portID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.DeleteNbPonPort() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltApplication_DeviceUpInd(t *testing.T) {
+ type args struct {
+ device string
+ }
+ voltDev := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_DeviceUpInd",
+ args: args{
+ device: "SDX6320031",
+ },
+ },
+ {
+ name: "Negetive_Case_DeviceUpInd",
+ args: args{
+ device: "o",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_DeviceUpInd":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ va.DeviceUpInd(tt.args.device)
+ case "Negetive_Case_DeviceUpInd":
+ va.DeviceUpInd(tt.args.device)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_DeviceDownInd(t *testing.T) {
+ type args struct {
+ device string
+ }
+ voltDev := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_DeviceDownInd",
+ args: args{
+ device: "SDX6320031",
+ },
+ },
+ {
+ name: "Negetive_Case_DeviceDownInd",
+ args: args{
+ device: "o",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ switch tt.name {
+ case "Positive_Case_DeviceDownInd":
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ va.DeviceDownInd(tt.args.device)
+ case "Negetive_Case_DeviceDownInd":
+ va.DeviceDownInd(tt.args.device)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_DeviceRebootInd(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ device string
+ serialNum string
+ southBoundID string
+ }
+ voltDev := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ NniPort: "16777216",
+ SouthBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ State: controller.DeviceStateREBOOTED,
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "Positive_Case_DeviceRebootInd",
+ args: args{
+ device: "SDX6320031",
+ serialNum: "SDX6320031",
+ southBoundID: "49686e2d-618f-4e8e-bca0-442ab850a63a",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ va.DevicesDisc.Store("SDX6320031", voltDev)
+ va.DeviceRebootInd(tt.args.cntx, tt.args.device, tt.args.serialNum, tt.args.southBoundID)
+ })
+ }
+}
diff --git a/internal/pkg/application/flowevent_test.go b/internal/pkg/application/flowevent_test.go
new file mode 100644
index 0000000..400176a
--- /dev/null
+++ b/internal/pkg/application/flowevent_test.go
@@ -0,0 +1,290 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package application
+
+import (
+ "context"
+ "testing"
+ "voltha-go-controller/internal/pkg/intf"
+ "voltha-go-controller/internal/pkg/of"
+ "voltha-go-controller/internal/pkg/util"
+ "voltha-go-controller/internal/test/mocks"
+
+ "github.com/golang/mock/gomock"
+)
+
+var voltPortVnet = &VoltPortVnet{
+ Device: "test_device",
+}
+var voltService = &VoltService{
+ Version: "test_version",
+}
+
+func TestExecuteFlowEvent(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ vd *VoltDevice
+ cookie string
+ flowStatus intf.FlowStatus
+ }
+ tests := []struct {
+ name string
+ args args
+ want bool
+ }{
+ {
+ name: "ExecuteFlowEvent_add",
+ args: args{
+ cntx: context.Background(),
+ vd: &VoltDevice{
+ SouthBoundID: "test_device_id",
+ FlowAddEventMap: util.NewConcurrentMap(),
+ },
+ cookie: "test_cookie",
+ flowStatus: intf.FlowStatus{
+ Device: "test_device",
+ FlowModType: of.CommandAdd,
+ },
+ },
+ },
+ {
+ name: "ExecuteFlowEvent_del",
+ args: args{
+ cntx: context.Background(),
+ vd: &VoltDevice{
+ SouthBoundID: "test_device_id",
+ FlowDelEventMap: util.NewConcurrentMap(),
+ },
+ cookie: "test_cookie",
+ flowStatus: intf.FlowStatus{
+ Device: "test_device",
+ FlowModType: of.CommandDel,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "ExecuteFlowEvent_add":
+ if got := ExecuteFlowEvent(tt.args.cntx, tt.args.vd, tt.args.cookie, tt.args.flowStatus); got != tt.want {
+ t.Errorf("ExecuteFlowEvent() = %v, want %v", got, tt.want)
+ }
+ case "ExecuteFlowEvent_del":
+ if got := ExecuteFlowEvent(tt.args.cntx, tt.args.vd, tt.args.cookie, tt.args.flowStatus); got != tt.want {
+ t.Errorf("ExecuteFlowEvent() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
+
+func TestInitEventFuncMapper(t *testing.T) {
+ tests := []struct {
+ name string
+ }{
+ {
+ name: "InitEventFuncMapper",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ InitEventFuncMapper()
+ })
+ }
+}
+
+func TestProcessUsIgmpFlowAddEvent(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ event *FlowEvent
+ flowStatus intf.FlowStatus
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "ProcessUsIgmpFlowAddEvent",
+ args: args{
+ cntx: context.Background(),
+ event: &FlowEvent{
+ device: "test_device",
+ eType: EventTypeControlFlowAdded,
+ eventData: voltPortVnet,
+ },
+ flowStatus: intf.FlowStatus{
+ Device: "test_device",
+ Status: uint32(0),
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ ProcessUsIgmpFlowAddEvent(tt.args.cntx, tt.args.event, tt.args.flowStatus)
+ })
+ }
+}
+
+func TestProcessServiceFlowAddEvent(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ event *FlowEvent
+ flowStatus intf.FlowStatus
+ }
+
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "ProcessServiceFlowAddEvent",
+ args: args{
+ cntx: context.Background(),
+ event: &FlowEvent{
+ device: "test_device",
+ eventData: voltService,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ ProcessServiceFlowAddEvent(tt.args.cntx, tt.args.event, tt.args.flowStatus)
+ })
+ }
+}
+
+func TestProcessControlFlowAddEvent(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ event *FlowEvent
+ flowStatus intf.FlowStatus
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "ProcessControlFlowAddEvent",
+ args: args{
+ cntx: context.Background(),
+ event: &FlowEvent{
+ eventData: voltPortVnet,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ ProcessControlFlowAddEvent(tt.args.cntx, tt.args.event, tt.args.flowStatus)
+ })
+ }
+}
+
+func TestProcessServiceFlowDelEvent(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ event *FlowEvent
+ flowStatus intf.FlowStatus
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "ProcessServiceFlowDelEvent",
+ args: args{
+ cntx: context.Background(),
+ event: &FlowEvent{
+ eventData: voltService,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).Times(1)
+ ProcessServiceFlowDelEvent(tt.args.cntx, tt.args.event, tt.args.flowStatus)
+ })
+ }
+}
+
+func TestProcessControlFlowDelEvent(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ event *FlowEvent
+ flowStatus intf.FlowStatus
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "ProcessControlFlowDelEvent",
+ args: args{
+ cntx: context.Background(),
+ event: &FlowEvent{
+ eventData: voltPortVnet,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutVpv(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).Times(1)
+ ProcessControlFlowDelEvent(tt.args.cntx, tt.args.event, tt.args.flowStatus)
+ })
+ }
+}
+
+func TestProcessMcastFlowDelEvent(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ event *FlowEvent
+ flowStatus intf.FlowStatus
+ }
+ mvlanProfile := &MvlanProfile{
+ Version: "test_version",
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "ProcessMcastFlowDelEvent",
+ args: args{
+ cntx: context.Background(),
+ event: &FlowEvent{
+ eventData: mvlanProfile,
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutMvlan(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).Times(1)
+ ProcessMcastFlowDelEvent(tt.args.cntx, tt.args.event, tt.args.flowStatus)
+ })
+ }
+}
diff --git a/internal/pkg/application/igmp_test.go b/internal/pkg/application/igmp_test.go
new file mode 100644
index 0000000..9e1e940
--- /dev/null
+++ b/internal/pkg/application/igmp_test.go
@@ -0,0 +1,36 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package application
+
+import (
+ "testing"
+)
+
+func TestVoltApplication_InitIgmpSrcMac(t *testing.T) {
+ tests := []struct {
+ name string
+ }{
+ {
+ name: "test",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{}
+ va.InitIgmpSrcMac()
+ })
+ }
+}
diff --git a/internal/pkg/application/service_test.go b/internal/pkg/application/service_test.go
new file mode 100644
index 0000000..b9c458b
--- /dev/null
+++ b/internal/pkg/application/service_test.go
@@ -0,0 +1,1552 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package application
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "sync"
+ "testing"
+ "voltha-go-controller/internal/pkg/controller"
+ cntlr "voltha-go-controller/internal/pkg/controller"
+ "voltha-go-controller/internal/pkg/of"
+ "voltha-go-controller/internal/pkg/util"
+ "voltha-go-controller/internal/test/mocks"
+
+ "github.com/golang/mock/gomock"
+ "github.com/google/gopacket/layers"
+ "github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore"
+ "github.com/stretchr/testify/assert"
+ "go.uber.org/atomic"
+)
+
+var test_device = "test_device"
+var voltPort = &VoltPort{
+ Name: "test_name",
+ Device: test_device,
+}
+var voltDevice = &VoltDevice{
+ Name: "test_name",
+ State: controller.DeviceStateUP,
+ FlowAddEventMap: util.NewConcurrentMap(),
+ FlowDelEventMap: util.NewConcurrentMap(),
+ SerialNum: "test_serial_number",
+}
+
+var voltMeter = &VoltMeter{
+ Name: "test_volt_meter",
+ Version: "test_version",
+}
+
+var voltVnet = &VoltVnet{
+ Version: "test_version",
+ VnetConfig: VnetConfig{
+ Name: "test_name",
+ },
+}
+
+var voltPortVnet1 = []*VoltPortVnet{
+ {
+ Device: "4096-4096-4096",
+ SVlan: of.VlanAny,
+ CVlan: of.VlanAny,
+ UniVlan: of.VlanAny,
+ IgmpEnabled: true,
+ servicesCount: &atomic.Uint64{},
+ },
+}
+
+var voltDevice1 = &VoltDevice{
+ State: cntlr.DeviceStateDOWN,
+}
+
+var GetDeviceFromPort_error = "GetDeviceFromPort_error"
+
+func TestVoltApplication_RestoreSvcsFromDb(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltApplication_RestoreSvcsFromDb",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ {
+ name: "invalid_value_type",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ {
+ name: "unmarshal_error",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ voltService := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ Device: "SDX6320031",
+ ForceDelete: true,
+ DeleteInProgress: true,
+ },
+ VoltServiceCfg: VoltServiceCfg{
+ Name: "test_service_name",
+ },
+ }
+ serviceToDelete := map[string]bool{}
+ serviceToDelete[voltService.VoltServiceCfg.Name] = true
+ va := &VoltApplication{
+ ServicesToDelete: serviceToDelete,
+ }
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ switch tt.name {
+ case "VoltApplication_RestoreSvcsFromDb":
+
+ b, err := json.Marshal(voltService)
+ if err != nil {
+ panic(err)
+ }
+ kvPair := map[string]*kvstore.KVPair{}
+ kvPair["key"] = &kvstore.KVPair{
+ Key: "test_key",
+ Value: b,
+ Version: 1,
+ }
+ dbintf.EXPECT().GetServices(tt.args.cntx).Return(kvPair, nil).Times(1)
+ va.RestoreSvcsFromDb(tt.args.cntx)
+ case "invalid_value_type":
+ kvPair := map[string]*kvstore.KVPair{}
+ kvPair["key"] = &kvstore.KVPair{
+ Key: "test_key",
+ Value: "invalid_value",
+ Version: 1,
+ }
+ dbintf.EXPECT().GetServices(tt.args.cntx).Return(kvPair, nil).Times(1)
+ va.RestoreSvcsFromDb(tt.args.cntx)
+ case "unmarshal_error":
+ b, err := json.Marshal("test")
+ if err != nil {
+ panic(err)
+ }
+ kvPair := map[string]*kvstore.KVPair{}
+ kvPair["key"] = &kvstore.KVPair{
+ Key: "test_key",
+ Value: b,
+ Version: 1,
+ }
+ dbintf.EXPECT().GetServices(tt.args.cntx).Return(kvPair, nil).Times(1)
+ va.RestoreSvcsFromDb(tt.args.cntx)
+ }
+ })
+ }
+}
+
+func TestVoltService_FlowRemoveFailure(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ cookie string
+ errorCode uint32
+ errReason string
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltService_FlowRemoveFailure",
+ args: args{
+ cntx: context.Background(),
+ cookie: "test_cookie",
+ errorCode: 200,
+ errReason: "test_reason",
+ },
+ },
+ {
+ name: "cookie_not_found",
+ args: args{
+ cntx: context.Background(),
+ cookie: "test_cookie",
+ errorCode: 200,
+ errReason: "test_reason",
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "VoltService_FlowRemoveFailure":
+ associatedFlows := map[string]bool{}
+ associatedFlows["test_cookie"] = true
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ AssociatedFlows: associatedFlows,
+ },
+ }
+ vs.FlowRemoveFailure(tt.args.cntx, tt.args.cookie, tt.args.errorCode, tt.args.errReason)
+ case "cookie_not_found":
+ associatedFlows := map[string]bool{}
+ associatedFlows["cookie"] = true
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ AssociatedFlows: associatedFlows,
+ },
+ }
+ vs.FlowRemoveFailure(tt.args.cntx, tt.args.cookie, tt.args.errorCode, tt.args.errReason)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_GetServiceNameFromCookie(t *testing.T) {
+ type args struct {
+ cookie uint64
+ portName string
+ pbit uint8
+ device string
+ tableMetadata uint64
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltApplication_GetServiceNameFromCookie",
+ args: args{
+ cookie: uint64(1),
+ portName: "test_port_name",
+ device: "SDX6320031",
+ pbit: 2,
+ tableMetadata: uint64(2),
+ },
+ },
+ }
+ voltDev := &VoltDevice{
+ Name: "SDX6320031",
+ SerialNum: "SDX6320031",
+ NniDhcpTrapVid: 123,
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ ga := GetApplication()
+ ga.DevicesDisc.Store("SDX6320031", voltDev)
+ voltPortVnets := make([]*VoltPortVnet, 0)
+ voltPortVnet := &VoltPortVnet{
+ Device: test_device,
+ VlanControl: ONUCVlanOLTSVlan,
+ }
+ voltPortVnets = append(voltPortVnets, voltPortVnet)
+ ga.VnetsByPort.Store("test_port_name", voltPortVnets)
+ got := ga.GetServiceNameFromCookie(tt.args.cookie, tt.args.portName, tt.args.pbit, tt.args.device, tt.args.tableMetadata)
+ assert.Nil(t, got)
+ })
+ }
+}
+
+func TestVoltService_SvcUpInd(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltService_SvcUpInd",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ PendingFlows: make(map[string]bool),
+ },
+ VoltServiceCfg: VoltServiceCfg{
+ SVlanTpid: layers.EthernetTypeDot1Q,
+ MacAddr: layers.EthernetBroadcast,
+ },
+ }
+ vs.Port = test_device
+ vs.Device = "device"
+ ga := GetApplication()
+ _ = cntlr.NewController(context.Background(), mocks.NewMockApp(gomock.NewController(t)))
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ ga.PortsDisc.Store(test_device, voltPort)
+ ga.DevicesDisc.Store(test_device, voltDevice)
+ vs.SvcUpInd(tt.args.cntx)
+ })
+ }
+}
+
+func TestVoltService_SvcDownInd(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltService_SvcDownInd",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ UsHSIAFlowsApplied: true,
+ DsHSIAFlowsApplied: true,
+ },
+ VoltServiceCfg: VoltServiceCfg{
+ SVlanTpid: layers.EthernetTypeQinQ,
+ MacAddr: layers.EthernetBroadcast,
+ },
+ }
+ vs.Port = test_device
+ vs.Device = "device"
+ ga := GetApplication()
+ _ = cntlr.NewController(context.Background(), mocks.NewMockApp(gomock.NewController(t)))
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ ga.PortsDisc.Store(test_device, voltPort)
+ ga.DevicesDisc.Store(test_device, voltDevice)
+ vs.SvcDownInd(tt.args.cntx)
+ })
+ }
+}
+
+func TestVoltApplication_AddService(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ cfg VoltServiceCfg
+ oper *VoltServiceOper
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltApplication_AddService",
+ args: args{
+ cntx: context.Background(),
+ cfg: VoltServiceCfg{
+ Name: "test_name",
+ Port: "test_port",
+ DsMeterProfile: "4096-4096-4096",
+ UsMeterProfile: "4096-4096-4096",
+ SVlan: of.VlanAny,
+ CVlan: of.VlanAny,
+ UniVlan: of.VlanAny,
+ MacLearning: Learn,
+ IsActivated: true,
+ },
+ oper: &VoltServiceOper{
+ Device: "4096-4096-4096",
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ MeterMgr: MeterMgr{
+ Meters: sync.Map{},
+ },
+ VnetsByPort: sync.Map{},
+ VnetsByTag: sync.Map{},
+ }
+ va.MeterMgr.Meters.Store("4096-4096-4096", voltMeter)
+ va.VnetsByTag.Store("4096-4096-4096", voltVnet)
+ voltPortVnet1[0].SVlan = of.VlanAny
+ voltPortVnet1[0].CVlan = of.VlanAny
+ voltPortVnet1[0].UniVlan = of.VlanAny
+ voltPortVnet1[0].servicesCount = atomic.NewUint64(uint64(56))
+ voltPortVnet1[0].MacAddr = layers.EthernetBroadcast
+ voltPortVnet1[0].Port = "test_port"
+ va.VnetsByPort.Store("test_port", voltPortVnet1)
+ ga := GetApplication()
+ voltPort1 := &VoltPort{
+ Name: "test_name",
+ Device: test_device,
+ }
+ deviceConfig := &DeviceConfig{
+ SerialNumber: "test_serial_number",
+ }
+ ga.PortsDisc.Store("test_port", voltPort1)
+ ga.DevicesDisc.Store(test_device, voltDevice)
+ ga.DevicesConfig.Store("test_serial_number", deviceConfig)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ dbintf.EXPECT().PutVpv(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).Times(1)
+ err := va.AddService(tt.args.cntx, tt.args.cfg, tt.args.oper)
+ assert.Nil(t, err)
+ })
+ }
+}
+
+func TestVoltApplication_DelService(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ name string
+ forceDelete bool
+ newSvc *VoltServiceCfg
+ serviceMigration bool
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltApplication_DelService",
+ args: args{
+ cntx: context.Background(),
+ name: "test_name",
+ forceDelete: true,
+ newSvc: &VoltServiceCfg{
+ Name: "vs_cfg_name",
+ Port: "test_port",
+ },
+ serviceMigration: true,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ ServiceByName: sync.Map{},
+ VnetsByPort: sync.Map{},
+ }
+ voltService := &VoltService{
+ Version: "test_version",
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "4096-4096-4096",
+ SVlan: of.VlanAny,
+ CVlan: of.VlanAny,
+ UniVlan: of.VlanAny,
+ },
+ }
+ va.ServiceByName.Store(tt.args.name, voltService)
+ va.VnetsByPort.Store("4096-4096-4096", voltPortVnet1)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().DelService(gomock.Any(), gomock.Any()).AnyTimes()
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ va.DelService(tt.args.cntx, tt.args.name, tt.args.forceDelete, tt.args.newSvc, tt.args.serviceMigration)
+ })
+ }
+}
+
+func TestVoltService_FlowInstallSuccess(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ cookie string
+ bwAvailInfo of.BwAvailDetails
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "VoltService_FlowInstallSuccess",
+ args: args{
+ cntx: context.Background(),
+ cookie: "test_cookie",
+ bwAvailInfo: of.BwAvailDetails{
+ PrevBw: "test_prev_BW",
+ PresentBw: "test_present_BW",
+ },
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ pendingFlows := map[string]bool{}
+ pendingFlows["test_cookie"] = true
+ associatedFlows := map[string]bool{}
+ associatedFlows["test_cookie"] = true
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ PendingFlows: pendingFlows,
+ AssociatedFlows: associatedFlows,
+ DsHSIAFlowsApplied: true,
+ },
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "test_port",
+ },
+ }
+ ga := GetApplication()
+ ga.PortsDisc.Store("test_port", voltPort)
+ ga.DevicesDisc.Store(test_device, voltDevice)
+ vs.FlowInstallSuccess(tt.args.cntx, tt.args.cookie, tt.args.bwAvailInfo)
+ })
+ }
+}
+
+func TestVoltService_AddMeterToDevice(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ name: "VoltService_AddMeterToDevice",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ {
+ name: GetDeviceFromPort_error,
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ {
+ name: "DeviceState_down",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "VoltService_AddMeterToDevice":
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ DeleteInProgress: true,
+ },
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "test_port",
+ },
+ }
+ ga := GetApplication()
+ ga.PortsDisc.Store("test_port", voltPort)
+ ga.DevicesDisc.Store(test_device, voltDevice)
+ err := vs.AddMeterToDevice(tt.args.cntx)
+ assert.Nil(t, err)
+ case GetDeviceFromPort_error:
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ DeleteInProgress: true,
+ },
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "",
+ },
+ }
+ err := vs.AddMeterToDevice(tt.args.cntx)
+ assert.NotNil(t, err)
+ case "DeviceState_down":
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ DeleteInProgress: true,
+ },
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "test_port",
+ },
+ }
+ ga := GetApplication()
+ ga.PortsDisc.Store("test_port", voltPort)
+ ga.DevicesDisc.Store(test_device, voltDevice1)
+ err := vs.AddMeterToDevice(tt.args.cntx)
+ assert.Nil(t, err)
+ }
+ })
+ }
+}
+
+func TestVoltService_AddUsHsiaFlows(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ name: "DeleteInProgress_true",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ {
+ name: "GetDeviceFromPort_error",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ {
+ name: "DeviceState_down",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "DeleteInProgress_true":
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ DeleteInProgress: true,
+ },
+ }
+ err := vs.AddUsHsiaFlows(tt.args.cntx)
+ assert.Nil(t, err)
+ case "GetDeviceFromPort_error":
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ DeleteInProgress: false,
+ },
+ }
+ err := vs.AddUsHsiaFlows(tt.args.cntx)
+ assert.NotNil(t, err)
+ case "DeviceState_down":
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ DeleteInProgress: false,
+ },
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "test_port",
+ },
+ }
+ ga := GetApplication()
+ ga.PortsDisc.Store("test_port", voltPort)
+ ga.DevicesDisc.Store(test_device, voltDevice1)
+ err := vs.AddUsHsiaFlows(tt.args.cntx)
+ assert.Nil(t, err)
+ }
+ })
+ }
+}
+
+func TestVoltService_AddHsiaFlows(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "AddUsHsiaFlows_error",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ vs := &VoltService{
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "test_port",
+ VlanControl: 5,
+ },
+ }
+ ga := GetApplication()
+ ga.PortsDisc.Store("test_port", voltPort)
+ ga.DevicesDisc.Store(test_device, voltDevice)
+ vs.AddHsiaFlows(tt.args.cntx)
+ })
+ }
+}
+
+func TestVoltService_ForceWriteToDb(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ }{
+ {
+ name: "PutService_error",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "PutService_error":
+ vs := &VoltService{}
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(errors.New("error")).AnyTimes()
+ vs.ForceWriteToDb(tt.args.cntx)
+ }
+ })
+ }
+}
+
+func TestVoltService_isDataRateAttrPresent(t *testing.T) {
+ tests := []struct {
+ name string
+ want bool
+ }{
+ {
+ name: "VoltService_isDataRateAttrPresent",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ vs := &VoltService{}
+ if got := vs.isDataRateAttrPresent(); got != tt.want {
+ t.Errorf("VoltService.isDataRateAttrPresent() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestVoltService_GetServicePbit(t *testing.T) {
+ tests := []struct {
+ name string
+ want int
+ }{
+ {
+ name: "VoltService_GetServicePbit",
+ want: -1,
+ },
+ {
+ name: "!IsPbitExist",
+ want: 8,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "VoltService_GetServicePbit":
+ vs := &VoltService{
+ VoltServiceCfg: VoltServiceCfg{
+ Pbits: []of.PbitType{of.PbitMatchAll},
+ },
+ }
+ if got := vs.GetServicePbit(); got != tt.want {
+ t.Errorf("VoltService.GetServicePbit() = %v, want %v", got, tt.want)
+ }
+ case "!IsPbitExist":
+ vs := &VoltService{}
+ if got := vs.GetServicePbit(); got != tt.want {
+ t.Errorf("VoltService.GetServicePbit() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltApplication_DeactivateService(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ deviceID string
+ portNo string
+ sVlan of.VlanType
+ cVlan of.VlanType
+ tpID uint16
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ name: "VoltApplication_DeactivateService",
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_device_id",
+ portNo: "test_port",
+ sVlan: of.VlanNone,
+ cVlan: of.VlanAny,
+ tpID: AnyVlan,
+ },
+ },
+ {
+ name: "VoltPortVnet_nil",
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_device_id",
+ portNo: "test_port",
+ sVlan: of.VlanNone,
+ cVlan: of.VlanAny,
+ tpID: AnyVlan,
+ },
+ },
+ {
+ name: "sVlan != of.VlanNone",
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_device_id",
+ portNo: "test_port",
+ sVlan: of.VlanAny,
+ cVlan: of.VlanAny,
+ tpID: AnyVlan,
+ },
+ },
+ {
+ name: GetDeviceFromPort_error,
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_device_id",
+ portNo: "test_port",
+ sVlan: of.VlanNone,
+ cVlan: of.VlanAny,
+ tpID: AnyVlan,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ ServiceByName: sync.Map{},
+ VnetsByPort: sync.Map{},
+ DevicesDisc: sync.Map{},
+ PortsDisc: sync.Map{},
+ }
+ voltServiceTest := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ Device: test_device,
+ },
+ Version: "test_version",
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "test_port",
+ Name: "test_name",
+ IsActivated: true,
+ CVlan: of.VlanAny,
+ SVlan: of.VlanAny,
+ UniVlan: of.VlanAny,
+ },
+ }
+ switch tt.name {
+ case "VoltApplication_DeactivateService":
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ va.PortsDisc.Store("test_port", voltPort)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ va.DevicesDisc.Store(test_device, voltDevice)
+ voltDevice.Ports.Store("test_port", voltPort)
+ va.VnetsByPort.Store("test_port", voltPortVnet1)
+ voltPortVnet1[0].servicesCount.Store(uint64(1))
+ dbintf.EXPECT().PutVpv(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ if err := va.DeactivateService(tt.args.cntx, tt.args.deviceID, tt.args.portNo, tt.args.sVlan, tt.args.cVlan, tt.args.tpID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.DeactivateService() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case "VoltPortVnet_nil":
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ va.PortsDisc.Store("test_port", voltPort)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ va.DevicesDisc.Store(test_device, voltDevice)
+ voltDevice.Ports.Store("test_port", voltPort)
+ if err := va.DeactivateService(tt.args.cntx, tt.args.deviceID, tt.args.portNo, tt.args.sVlan, tt.args.cVlan, tt.args.tpID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.DeactivateService() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case "sVlan != of.VlanNone":
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ if err := va.DeactivateService(tt.args.cntx, tt.args.deviceID, tt.args.portNo, tt.args.sVlan, tt.args.cVlan, tt.args.tpID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.DeactivateService() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case GetDeviceFromPort_error:
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ if err := va.DeactivateService(tt.args.cntx, tt.args.deviceID, tt.args.portNo, tt.args.sVlan, tt.args.cVlan, tt.args.tpID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.DeactivateService() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltApplication_ActivateService(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ deviceID string
+ portNo string
+ sVlan of.VlanType
+ cVlan of.VlanType
+ tpID uint16
+ }
+ tests := []struct {
+ name string
+ args args
+ wantErr bool
+ }{
+ {
+ name: "VoltApplication_ActivateService",
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_name",
+ portNo: "test_port",
+ sVlan: of.VlanNone,
+ cVlan: of.VlanAny,
+ tpID: AnyVlan,
+ },
+ },
+ {
+ name: "VoltPortVnet_nil",
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_name",
+ portNo: "test_port",
+ sVlan: of.VlanNone,
+ cVlan: of.VlanAny,
+ tpID: AnyVlan,
+ },
+ },
+ {
+ name: GetDeviceFromPort_error,
+ args: args{
+ cntx: context.Background(),
+ deviceID: "test_name",
+ portNo: "test_port",
+ sVlan: of.VlanNone,
+ cVlan: of.VlanAny,
+ tpID: AnyVlan,
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ DevicesDisc: sync.Map{},
+ }
+ var voltPortTest = &VoltPort{
+ Name: "test_name",
+ State: PortStateUp,
+ }
+ voltServiceTest := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ Device: test_device,
+ },
+ Version: "test_version",
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "test_port",
+ Name: "test_name",
+ IsActivated: false,
+ CVlan: of.VlanAny,
+ SVlan: of.VlanAny,
+ UniVlan: of.VlanAny,
+ },
+ }
+ switch tt.name {
+ case "VoltApplication_ActivateService":
+ voltPortTest.Device = test_device
+ va.PortsDisc.Store("test_port", voltPortTest)
+ va.DevicesDisc.Store(test_device, voltDevice)
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ va.VnetsByPort.Store("test_port", voltPortVnet1)
+ voltDevice.Ports.Store("test_port", voltPortTest)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ if err := va.ActivateService(tt.args.cntx, tt.args.deviceID, tt.args.portNo, tt.args.sVlan, tt.args.cVlan, tt.args.tpID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.ActivateService() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case "VoltPortVnet_nil":
+ voltPortTest.Device = test_device
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ va.PortsDisc.Store("test_port", voltPortTest)
+ dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+ db = dbintf
+ dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+ va.DevicesDisc.Store(test_device, voltDevice)
+ voltDevice.Ports.Store("test_port", voltPortTest)
+ if err := va.ActivateService(tt.args.cntx, tt.args.deviceID, tt.args.portNo, tt.args.sVlan, tt.args.cVlan, tt.args.tpID); (err != nil) != tt.wantErr {
+ t.Errorf("VoltApplication.ActivateService() error = %v, wantErr %v", err, tt.wantErr)
+ }
+ case GetDeviceFromPort_error:
+ err := va.ActivateService(tt.args.cntx, tt.args.deviceID, tt.args.portNo, tt.args.sVlan, tt.args.cVlan, tt.args.tpID)
+ assert.NotNil(t, err)
+ }
+ })
+ }
+}
+
+func TestVoltApplication_GetProgrammedSubscribers(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ deviceID string
+ portNo string
+ }
+ tests := []struct {
+ name string
+ args args
+ want []*VoltService
+ wantErr bool
+ }{
+ {
+ name: "VoltApplication_GetProgrammedSubscribers",
+ args: args{
+ cntx: context.Background(),
+ deviceID: test_device,
+ portNo: "test_port",
+ },
+ },
+ {
+ name: "portNo_nil",
+ args: args{
+ cntx: context.Background(),
+ deviceID: test_device,
+ },
+ },
+ {
+ name: "deviceID_nil",
+ args: args{
+ cntx: context.Background(),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ vendorID: "test_vendor",
+ }
+ voltServiceTest := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ Device: test_device,
+ },
+ Version: "test_version",
+ VoltServiceCfg: VoltServiceCfg{
+ Port: "test_port",
+ Name: "test_name",
+ IsActivated: false,
+ CVlan: of.VlanAny,
+ SVlan: of.VlanAny,
+ UniVlan: of.VlanAny,
+ },
+ }
+ switch tt.name {
+ case "VoltApplication_GetProgrammedSubscribers":
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ got, err := va.GetProgrammedSubscribers(tt.args.cntx, tt.args.deviceID, tt.args.portNo)
+ assert.NotNil(t, got)
+ assert.Nil(t, err)
+ case "portNo_nil":
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ got, err := va.GetProgrammedSubscribers(tt.args.cntx, tt.args.deviceID, tt.args.portNo)
+ assert.NotNil(t, got)
+ assert.Nil(t, err)
+ case "deviceID_nil":
+ va.ServiceByName.Store("test_name", voltServiceTest)
+ got, err := va.GetProgrammedSubscribers(tt.args.cntx, tt.args.deviceID, tt.args.portNo)
+ assert.NotNil(t, got)
+ assert.Nil(t, err)
+ }
+ })
+ }
+}
+
+func TestVoltService_JSONMarshal(t *testing.T) {
+ tests := []struct {
+ name string
+ }{
+ {
+ name: "VoltService_JSONMarshal",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ Device: test_device,
+ },
+ Version: "test_version",
+ VoltServiceCfg: VoltServiceCfg{
+ Name: "test_name",
+ },
+ }
+ got, err := vs.JSONMarshal()
+ assert.NotNil(t, got)
+ assert.Nil(t, err)
+ })
+ }
+}
+
+func TestVoltService_triggerServiceInProgressInd(t *testing.T) {
+ tests := []struct {
+ name string
+ }{
+ {
+ name: "VoltService_triggerServiceInProgressInd",
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ vs := &VoltService{
+ Version: "test_version",
+ }
+ vs.triggerServiceInProgressInd()
+ })
+ }
+}
+
+func TestVoltService_TriggerAssociatedFlowDelete(t *testing.T) {
+ type args struct {
+ cntx context.Context
+ }
+ tests := []struct {
+ name string
+ args args
+ want bool
+ }{
+ {
+ name: "VoltService_TriggerAssociatedFlowDelete",
+ args: args{
+ cntx: context.Background(),
+ },
+ want: true,
+ },
+ {
+ name: "cookieList_nil",
+ args: args{
+ cntx: context.Background(),
+ },
+ want: false,
+ },
+ }
+ associatedFlows := map[string]bool{}
+ associatedFlows["5765317"] = true
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ switch tt.name {
+ case "VoltService_TriggerAssociatedFlowDelete":
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ UsHSIAFlowsApplied: true,
+ DsHSIAFlowsApplied: true,
+ AssociatedFlows: associatedFlows,
+ Device: test_device,
+ },
+ }
+ ga := GetApplication()
+ ga.DevicesDisc.Store(test_device, voltDevice)
+ if got := vs.TriggerAssociatedFlowDelete(tt.args.cntx); got != tt.want {
+ t.Errorf("VoltService.TriggerAssociatedFlowDelete() = %v, want %v", got, tt.want)
+ }
+ case "cookieList_nil":
+ vs := &VoltService{
+ VoltServiceOper: VoltServiceOper{
+ UsHSIAFlowsApplied: true,
+ DsHSIAFlowsApplied: true,
+ Device: test_device,
+ },
+ }
+ ga := GetApplication()
+ ga.DevicesDisc.Store(test_device, voltDevice)
+ if got := vs.TriggerAssociatedFlowDelete(tt.args.cntx); got != tt.want {
+ t.Errorf("VoltService.TriggerAssociatedFlowDelete() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
+
+func TestVoltApplication_DeepEqualServicecfg(t *testing.T) {
+ type args struct {
+ evs *VoltServiceCfg
+ nvs *VoltServiceCfg
+ }
+ a := map[int]int{}
+ a[0] = 0
+ tests := []struct {
+ name string
+ args args
+ want bool
+ }{
+ {
+ name: "VoltApplication_DeepEqualServicecfg",
+ args: args{
+ evs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: true,
+ },
+ {
+ name: "nvs.Name != evs.Name",
+ args: args{
+ evs: &VoltServiceCfg{
+ Name: "test_name",
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.UniVlan != evs.UniVlan",
+ args: args{
+ evs: &VoltServiceCfg{
+ UniVlan: of.VlanAny,
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.CVlan != evs.CVlan",
+ args: args{
+ evs: &VoltServiceCfg{
+ CVlan: of.VlanAny,
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.SVlan != evs.SVlan",
+ args: args{
+ evs: &VoltServiceCfg{
+ SVlan: of.VlanAny,
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.SVlanTpid != 0",
+ args: args{
+ evs: &VoltServiceCfg{
+ SVlanTpid: layers.EthernetTypeARP,
+ },
+ nvs: &VoltServiceCfg{
+ SVlanTpid: layers.EthernetTypeCiscoDiscovery,
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.Pbits != evs.Pbits",
+ args: args{
+ evs: &VoltServiceCfg{
+ Pbits: []of.PbitType{
+ PbitMatchAll,
+ },
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.DsRemarkPbitsMap != evs.DsRemarkPbitsMap",
+ args: args{
+ evs: &VoltServiceCfg{
+ DsRemarkPbitsMap: a,
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.TechProfileID != evs.TechProfileID",
+ args: args{
+ evs: &VoltServiceCfg{
+ TechProfileID: uint16(1),
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.CircuitID != evs.CircuitID",
+ args: args{
+ evs: &VoltServiceCfg{
+ CircuitID: "test_circuit_id",
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.RemoteID != evs.RemoteID",
+ args: args{
+ evs: &VoltServiceCfg{
+ RemoteID: []byte{1},
+ },
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.Port != evs.Port",
+ args: args{
+ evs: &VoltServiceCfg{},
+ nvs: &VoltServiceCfg{
+ Port: "test_port",
+ },
+ },
+ want: false,
+ },
+ {
+ name: "nvs.PonPort != evs.PonPort",
+ args: args{
+ evs: &VoltServiceCfg{},
+ nvs: &VoltServiceCfg{
+ PonPort: uint32(1),
+ },
+ },
+ want: false,
+ },
+ {
+ name: "evs.MacLearning == MacLearningNone",
+ args: args{
+ evs: &VoltServiceCfg{
+ MacAddr: layers.EthernetBroadcast,
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.IgmpEnabled != evs.IgmpEnabled",
+ args: args{
+ evs: &VoltServiceCfg{
+ IgmpEnabled: true,
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.McastService != evs.McastService",
+ args: args{
+ evs: &VoltServiceCfg{
+ McastService: true,
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.ONTEtherTypeClassification != evs.ONTEtherTypeClassification",
+ args: args{
+ evs: &VoltServiceCfg{
+ ONTEtherTypeClassification: 1,
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.UsMeterProfile != evs.UsMeterProfile",
+ args: args{
+ evs: &VoltServiceCfg{
+ UsMeterProfile: "UsMeterProfile",
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.DsMeterProfile != evs.DsMeterProfile",
+ args: args{
+ evs: &VoltServiceCfg{
+ DsMeterProfile: "DsMeterProfile",
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.AggDsMeterProfile != evs.AggDsMeterProfile",
+ args: args{
+ evs: &VoltServiceCfg{
+ AggDsMeterProfile: "AggDsMeterProfile",
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.VnetID != evs.VnetID",
+ args: args{
+ evs: &VoltServiceCfg{
+ VnetID: "VnetID",
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.MvlanProfileName != evs.MvlanProfileName",
+ args: args{
+ evs: &VoltServiceCfg{
+ MvlanProfileName: "MvlanProfileName",
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.RemoteIDType != evs.RemoteIDType",
+ args: args{
+ evs: &VoltServiceCfg{
+ RemoteIDType: "RemoteIDType",
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.SchedID != evs.SchedID",
+ args: args{
+ evs: &VoltServiceCfg{
+ SchedID: 1,
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.AllowTransparent != evs.AllowTransparent",
+ args: args{
+ evs: &VoltServiceCfg{
+ AllowTransparent: true,
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.EnableMulticastKPI != evs.EnableMulticastKPI",
+ args: args{
+ evs: &VoltServiceCfg{
+ EnableMulticastKPI: true,
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.DataRateAttr != evs.DataRateAttr",
+ args: args{
+ evs: &VoltServiceCfg{
+ DataRateAttr: "DataRateAttr",
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.MinDataRateUs != evs.MinDataRateUs",
+ args: args{
+ evs: &VoltServiceCfg{
+ MinDataRateUs: uint32(1),
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.MinDataRateDs != evs.MinDataRateDs",
+ args: args{
+ evs: &VoltServiceCfg{
+ MinDataRateDs: uint32(1),
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.MaxDataRateUs != evs.MaxDataRateUs",
+ args: args{
+ evs: &VoltServiceCfg{
+ MaxDataRateUs: uint32(1),
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ {
+ name: "nvs.MaxDataRateDs != evs.MaxDataRateDs",
+ args: args{
+ evs: &VoltServiceCfg{
+ MaxDataRateDs: uint32(1),
+ },
+ nvs: &VoltServiceCfg{},
+ },
+ want: false,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ va := &VoltApplication{
+ vendorID: "test_vendor_id",
+ }
+ switch tt.name {
+ case "VoltApplication_DeepEqualServicecfg", "nvs.Name != evs.Name", "nvs.UniVlan != evs.UniVlan",
+ "nvs.CVlan != evs.CVlan", "nvs.SVlan != evs.SVlan", "nvs.SVlanTpid != 0", "nvs.Pbits != evs.Pbits",
+ "nvs.DsRemarkPbitsMap != evs.DsRemarkPbitsMap", "nvs.TechProfileID != evs.TechProfileID",
+ "nvs.CircuitID != evs.CircuitID", "nvs.RemoteID != evs.RemoteID", "nvs.Port != evs.Port",
+ "evs.MacLearning == MacLearningNone", "nvs.PonPort != evs.PonPort", "nvs.IgmpEnabled != evs.IgmpEnabled",
+ "nvs.McastService != evs.McastService", "nvs.ONTEtherTypeClassification != evs.ONTEtherTypeClassification",
+ "nvs.UsMeterProfile != evs.UsMeterProfile",
+ "nvs.DsMeterProfile != evs.DsMeterProfile", "nvs.AggDsMeterProfile != evs.AggDsMeterProfile",
+ "nvs.VnetID != evs.VnetID", "nvs.MvlanProfileName != evs.MvlanProfileName",
+ "nvs.RemoteIDType != evs.RemoteIDType", "nvs.SchedID != evs.SchedID",
+ "nvs.AllowTransparent != evs.AllowTransparent",
+ "nvs.EnableMulticastKPI != evs.EnableMulticastKPI", "nvs.DataRateAttr != evs.DataRateAttr",
+ "nvs.MinDataRateUs != evs.MinDataRateUs", "nvs.MinDataRateDs != evs.MinDataRateDs",
+ "nvs.MaxDataRateUs != evs.MaxDataRateUs", "nvs.MaxDataRateDs != evs.MaxDataRateDs":
+ if got := va.DeepEqualServicecfg(tt.args.evs, tt.args.nvs); got != tt.want {
+ t.Errorf("VoltApplication.DeepEqualServicecfg() = %v, want %v", got, tt.want)
+ }
+ }
+ })
+ }
+}
diff --git a/internal/pkg/controller/addflows_test.go b/internal/pkg/controller/addflows_test.go
new file mode 100644
index 0000000..d1e86ec
--- /dev/null
+++ b/internal/pkg/controller/addflows_test.go
@@ -0,0 +1,49 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package controller
+
+import (
+ "testing"
+ "voltha-go-controller/internal/pkg/of"
+)
+
+func Test_isFlowOperSuccess(t *testing.T) {
+ type args struct {
+ statusCode uint32
+ oper of.Command
+ }
+ tests := []struct {
+ name string
+ args args
+ want bool
+ }{
+ {
+ name: "test",
+ args: args{
+ statusCode: uint32(1004),
+ oper: of.CommandAdd,
+ },
+ want: true,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ if got := isFlowOperSuccess(tt.args.statusCode, tt.args.oper); got != tt.want {
+ t.Errorf("isFlowOperSuccess() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
diff --git a/internal/pkg/of/flows_test.go b/internal/pkg/of/flows_test.go
new file mode 100644
index 0000000..28a6d46
--- /dev/null
+++ b/internal/pkg/of/flows_test.go
@@ -0,0 +1,86 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package of
+
+import (
+ "net"
+ "testing"
+)
+
+func TestMatch_SetTableMetadata(t *testing.T) {
+ type fields struct {
+ SrcMacAddr net.HardwareAddr
+ SrcMacMask net.HardwareAddr
+ DstMacAddr net.HardwareAddr
+ DstMacMask net.HardwareAddr
+ SrcIpv4Addr net.IP
+ DstIpv4Addr net.IP
+ TableMetadata uint64
+ InPort uint32
+ MatchVlan VlanType
+ Pbits PbitType
+ L3Protocol EtherType
+ SrcPort uint16
+ DstPort uint16
+ L4Protocol IPProtocol
+ DstIpv4Match bool
+ SrcIpv4Match bool
+ SrcMacMatch bool
+ DstMacMatch bool
+ MatchPbits bool
+ }
+ type args struct {
+ metadata uint64
+ }
+ tests := []struct {
+ name string
+ fields fields
+ args args
+ }{
+ {
+ name: "test",
+ args: args{
+ metadata: uint64(537416),
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ m := &Match{
+ SrcMacAddr: tt.fields.SrcMacAddr,
+ SrcMacMask: tt.fields.SrcMacMask,
+ DstMacAddr: tt.fields.DstMacAddr,
+ DstMacMask: tt.fields.DstMacMask,
+ SrcIpv4Addr: tt.fields.SrcIpv4Addr,
+ DstIpv4Addr: tt.fields.DstIpv4Addr,
+ TableMetadata: tt.fields.TableMetadata,
+ InPort: tt.fields.InPort,
+ MatchVlan: tt.fields.MatchVlan,
+ Pbits: tt.fields.Pbits,
+ L3Protocol: tt.fields.L3Protocol,
+ SrcPort: tt.fields.SrcPort,
+ DstPort: tt.fields.DstPort,
+ L4Protocol: tt.fields.L4Protocol,
+ DstIpv4Match: tt.fields.DstIpv4Match,
+ SrcIpv4Match: tt.fields.SrcIpv4Match,
+ SrcMacMatch: tt.fields.SrcMacMatch,
+ DstMacMatch: tt.fields.DstMacMatch,
+ MatchPbits: tt.fields.MatchPbits,
+ }
+ m.SetTableMetadata(tt.args.metadata)
+ })
+ }
+}
diff --git a/internal/pkg/tasks/tasks_test.go b/internal/pkg/tasks/tasks_test.go
new file mode 100644
index 0000000..f451c71
--- /dev/null
+++ b/internal/pkg/tasks/tasks_test.go
@@ -0,0 +1,16 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package tasks
diff --git a/internal/pkg/util/concurrentmap.go b/internal/pkg/util/concurrentmap.go
index 380e3aa..fce8f49 100644
--- a/internal/pkg/util/concurrentmap.go
+++ b/internal/pkg/util/concurrentmap.go
@@ -23,7 +23,7 @@
// ConcurrentMap implements a wrapper on top of SyncMap so that the count is also maintained
type ConcurrentMap struct {
- count *atomic.Uint64
+ Count *atomic.Uint64
syncMap sync.Map
MapLock sync.RWMutex
}
@@ -31,7 +31,7 @@
// NewConcurrentMap - Initializes new ConcurentMap Object
func NewConcurrentMap() *ConcurrentMap {
var cm ConcurrentMap
- cm.count = atomic.NewUint64(0)
+ cm.Count = atomic.NewUint64(0)
return &cm
}
@@ -43,13 +43,13 @@
// Set - Store the value in sync map against the key provided
func (cm *ConcurrentMap) Set(key, value interface{}) {
- if cm.count == nil {
- cm.count = atomic.NewUint64(0)
+ if cm.Count == nil {
+ cm.Count = atomic.NewUint64(0)
}
_, exists := cm.syncMap.Load(key)
cm.syncMap.Store(key, value)
if !exists {
- cm.count.Inc()
+ cm.Count.Inc()
}
}
@@ -57,7 +57,7 @@
func (cm *ConcurrentMap) Remove(key interface{}) bool {
if _, ok := cm.syncMap.Load(key); ok {
cm.syncMap.Delete(key)
- cm.count.Dec()
+ cm.Count.Dec()
return true
}
return false
@@ -79,8 +79,8 @@
// Length - return the no of entries present in the map
func (cm *ConcurrentMap) Length() uint64 {
- if cm.count == nil {
+ if cm.Count == nil {
return 0
}
- return cm.count.Load()
+ return cm.Count.Load()
}
diff --git a/internal/pkg/vpagent/changeEvent_test.go b/internal/pkg/vpagent/changeEvent_test.go
new file mode 100644
index 0000000..35b195e
--- /dev/null
+++ b/internal/pkg/vpagent/changeEvent_test.go
@@ -0,0 +1,16 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+package vpagent
diff --git a/internal/test/mocks/mock_appif.go b/internal/test/mocks/mock_appif.go
new file mode 100644
index 0000000..42bd490
--- /dev/null
+++ b/internal/test/mocks/mock_appif.go
@@ -0,0 +1,255 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+// Code generated by MockGen. DO NOT EDIT.
+// Source: /home/vinod/go/src/gerrit.opencord.org/voltha-go-controller/internal/pkg/intf/appif.go
+
+// Package mock_intf is a generated GoMock package.
+package mocks
+
+import (
+ context "context"
+ reflect "reflect"
+ intf "voltha-go-controller/internal/pkg/intf"
+
+ gomock "github.com/golang/mock/gomock"
+)
+
+// MockApp is a mock of App interface.
+type MockApp struct {
+ ctrl *gomock.Controller
+ recorder *MockAppMockRecorder
+}
+
+// MockAppMockRecorder is the mock recorder for MockApp.
+type MockAppMockRecorder struct {
+ mock *MockApp
+}
+
+// NewMockApp creates a new mock instance.
+func NewMockApp(ctrl *gomock.Controller) *MockApp {
+ mock := &MockApp{ctrl: ctrl}
+ mock.recorder = &MockAppMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockApp) EXPECT() *MockAppMockRecorder {
+ return m.recorder
+}
+
+// AddDevice mocks base method.
+func (m *MockApp) AddDevice(arg0 context.Context, arg1, arg2, arg3 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "AddDevice", arg0, arg1, arg2, arg3)
+}
+
+// AddDevice indicates an expected call of AddDevice.
+func (mr *MockAppMockRecorder) AddDevice(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddDevice", reflect.TypeOf((*MockApp)(nil).AddDevice), arg0, arg1, arg2, arg3)
+}
+
+// DelDevice mocks base method.
+func (m *MockApp) DelDevice(arg0 context.Context, arg1 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DelDevice", arg0, arg1)
+}
+
+// DelDevice indicates an expected call of DelDevice.
+func (mr *MockAppMockRecorder) DelDevice(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelDevice", reflect.TypeOf((*MockApp)(nil).DelDevice), arg0, arg1)
+}
+
+// DeviceDisableInd mocks base method.
+func (m *MockApp) DeviceDisableInd(arg0 context.Context, arg1 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DeviceDisableInd", arg0, arg1)
+}
+
+// DeviceDisableInd indicates an expected call of DeviceDisableInd.
+func (mr *MockAppMockRecorder) DeviceDisableInd(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeviceDisableInd", reflect.TypeOf((*MockApp)(nil).DeviceDisableInd), arg0, arg1)
+}
+
+// DeviceDownInd mocks base method.
+func (m *MockApp) DeviceDownInd(arg0 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DeviceDownInd", arg0)
+}
+
+// DeviceDownInd indicates an expected call of DeviceDownInd.
+func (mr *MockAppMockRecorder) DeviceDownInd(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeviceDownInd", reflect.TypeOf((*MockApp)(nil).DeviceDownInd), arg0)
+}
+
+// DeviceRebootInd mocks base method.
+func (m *MockApp) DeviceRebootInd(arg0 context.Context, arg1, arg2, arg3 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DeviceRebootInd", arg0, arg1, arg2, arg3)
+}
+
+// DeviceRebootInd indicates an expected call of DeviceRebootInd.
+func (mr *MockAppMockRecorder) DeviceRebootInd(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeviceRebootInd", reflect.TypeOf((*MockApp)(nil).DeviceRebootInd), arg0, arg1, arg2, arg3)
+}
+
+// DeviceUpInd mocks base method.
+func (m *MockApp) DeviceUpInd(arg0 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DeviceUpInd", arg0)
+}
+
+// DeviceUpInd indicates an expected call of DeviceUpInd.
+func (mr *MockAppMockRecorder) DeviceUpInd(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeviceUpInd", reflect.TypeOf((*MockApp)(nil).DeviceUpInd), arg0)
+}
+
+// PacketInInd mocks base method.
+func (m *MockApp) PacketInInd(arg0 context.Context, arg1, arg2 string, arg3 []byte) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PacketInInd", arg0, arg1, arg2, arg3)
+}
+
+// PacketInInd indicates an expected call of PacketInInd.
+func (mr *MockAppMockRecorder) PacketInInd(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PacketInInd", reflect.TypeOf((*MockApp)(nil).PacketInInd), arg0, arg1, arg2, arg3)
+}
+
+// PortAddInd mocks base method.
+func (m *MockApp) PortAddInd(arg0 context.Context, arg1 string, arg2 uint32, arg3 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PortAddInd", arg0, arg1, arg2, arg3)
+}
+
+// PortAddInd indicates an expected call of PortAddInd.
+func (mr *MockAppMockRecorder) PortAddInd(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PortAddInd", reflect.TypeOf((*MockApp)(nil).PortAddInd), arg0, arg1, arg2, arg3)
+}
+
+// PortDelInd mocks base method.
+func (m *MockApp) PortDelInd(arg0 context.Context, arg1, arg2 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PortDelInd", arg0, arg1, arg2)
+}
+
+// PortDelInd indicates an expected call of PortDelInd.
+func (mr *MockAppMockRecorder) PortDelInd(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PortDelInd", reflect.TypeOf((*MockApp)(nil).PortDelInd), arg0, arg1, arg2)
+}
+
+// PortDownInd mocks base method.
+func (m *MockApp) PortDownInd(arg0 context.Context, arg1, arg2 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PortDownInd", arg0, arg1, arg2)
+}
+
+// PortDownInd indicates an expected call of PortDownInd.
+func (mr *MockAppMockRecorder) PortDownInd(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PortDownInd", reflect.TypeOf((*MockApp)(nil).PortDownInd), arg0, arg1, arg2)
+}
+
+// PortUpInd mocks base method.
+func (m *MockApp) PortUpInd(arg0 context.Context, arg1, arg2 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PortUpInd", arg0, arg1, arg2)
+}
+
+// PortUpInd indicates an expected call of PortUpInd.
+func (mr *MockAppMockRecorder) PortUpInd(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PortUpInd", reflect.TypeOf((*MockApp)(nil).PortUpInd), arg0, arg1, arg2)
+}
+
+// PortUpdateInd mocks base method.
+func (m *MockApp) PortUpdateInd(arg0, arg1 string, arg2 uint32) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PortUpdateInd", arg0, arg1, arg2)
+}
+
+// PortUpdateInd indicates an expected call of PortUpdateInd.
+func (mr *MockAppMockRecorder) PortUpdateInd(arg0, arg1, arg2 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PortUpdateInd", reflect.TypeOf((*MockApp)(nil).PortUpdateInd), arg0, arg1, arg2)
+}
+
+// ProcessFlowModResultIndication mocks base method.
+func (m *MockApp) ProcessFlowModResultIndication(arg0 context.Context, arg1 intf.FlowStatus) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "ProcessFlowModResultIndication", arg0, arg1)
+}
+
+// ProcessFlowModResultIndication indicates an expected call of ProcessFlowModResultIndication.
+func (mr *MockAppMockRecorder) ProcessFlowModResultIndication(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessFlowModResultIndication", reflect.TypeOf((*MockApp)(nil).ProcessFlowModResultIndication), arg0, arg1)
+}
+
+// SetRebootFlag mocks base method.
+func (m *MockApp) SetRebootFlag(arg0 bool) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "SetRebootFlag", arg0)
+}
+
+// SetRebootFlag indicates an expected call of SetRebootFlag.
+func (mr *MockAppMockRecorder) SetRebootFlag(arg0 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRebootFlag", reflect.TypeOf((*MockApp)(nil).SetRebootFlag), arg0)
+}
+
+// TriggerPendingMigrateServicesReq mocks base method.
+func (m *MockApp) TriggerPendingMigrateServicesReq(arg0 context.Context, arg1 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "TriggerPendingMigrateServicesReq", arg0, arg1)
+}
+
+// TriggerPendingMigrateServicesReq indicates an expected call of TriggerPendingMigrateServicesReq.
+func (mr *MockAppMockRecorder) TriggerPendingMigrateServicesReq(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerPendingMigrateServicesReq", reflect.TypeOf((*MockApp)(nil).TriggerPendingMigrateServicesReq), arg0, arg1)
+}
+
+// TriggerPendingProfileDeleteReq mocks base method.
+func (m *MockApp) TriggerPendingProfileDeleteReq(arg0 context.Context, arg1 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "TriggerPendingProfileDeleteReq", arg0, arg1)
+}
+
+// TriggerPendingProfileDeleteReq indicates an expected call of TriggerPendingProfileDeleteReq.
+func (mr *MockAppMockRecorder) TriggerPendingProfileDeleteReq(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerPendingProfileDeleteReq", reflect.TypeOf((*MockApp)(nil).TriggerPendingProfileDeleteReq), arg0, arg1)
+}
+
+// UpdateMvlanProfilesForDevice mocks base method.
+func (m *MockApp) UpdateMvlanProfilesForDevice(arg0 context.Context, arg1 string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "UpdateMvlanProfilesForDevice", arg0, arg1)
+}
+
+// UpdateMvlanProfilesForDevice indicates an expected call of UpdateMvlanProfilesForDevice.
+func (mr *MockAppMockRecorder) UpdateMvlanProfilesForDevice(arg0, arg1 interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMvlanProfilesForDevice", reflect.TypeOf((*MockApp)(nil).UpdateMvlanProfilesForDevice), arg0, arg1)
+}
diff --git a/internal/test/mocks/mock_dbintf.go b/internal/test/mocks/mock_dbintf.go
new file mode 100644
index 0000000..75a22ff
--- /dev/null
+++ b/internal/test/mocks/mock_dbintf.go
@@ -0,0 +1,1914 @@
+/*
+* Copyright 2022-present Open Networking Foundation
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+ */
+
+// Code generated by MockGen. DO NOT EDIT.
+// Source: /home/vinod/go/src/gerrit.opencord.org/voltha-go-controller/database/dbintf.go
+
+// Package mock_database is a generated GoMock package.
+package mocks
+
+import (
+ context "context"
+ net "net"
+ reflect "reflect"
+ of "voltha-go-controller/internal/pkg/of"
+
+ gomock "github.com/golang/mock/gomock"
+ kvstore "github.com/opencord/voltha-lib-go/v7/pkg/db/kvstore"
+)
+
+// MockDBIntf is a mock of DBIntf interface.
+type MockDBIntf struct {
+ ctrl *gomock.Controller
+ recorder *MockDBIntfMockRecorder
+}
+
+// MockDBIntfMockRecorder is the mock recorder for MockDBIntf.
+type MockDBIntfMockRecorder struct {
+ mock *MockDBIntf
+}
+
+// NewMockDBIntf creates a new mock instance.
+func NewMockDBIntf(ctrl *gomock.Controller) *MockDBIntf {
+ mock := &MockDBIntf{ctrl: ctrl}
+ mock.recorder = &MockDBIntfMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockDBIntf) EXPECT() *MockDBIntfMockRecorder {
+ return m.recorder
+}
+
+// Del mocks base method.
+func (m *MockDBIntf) Del(ctx context.Context, path string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Del", ctx, path)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Del indicates an expected call of Del.
+func (mr *MockDBIntfMockRecorder) Del(ctx, path interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Del", reflect.TypeOf((*MockDBIntf)(nil).Del), ctx, path)
+}
+
+// DelAllGroup mocks base method.
+func (m *MockDBIntf) DelAllGroup(ctx context.Context, deviceID string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelAllGroup", ctx, deviceID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelAllGroup indicates an expected call of DelAllGroup.
+func (mr *MockDBIntfMockRecorder) DelAllGroup(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelAllGroup", reflect.TypeOf((*MockDBIntf)(nil).DelAllGroup), ctx, deviceID)
+}
+
+// DelAllIgmpRcvr mocks base method.
+func (m *MockDBIntf) DelAllIgmpRcvr(ctx context.Context, mvlan of.VlanType, gip net.IP, device string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelAllIgmpRcvr", ctx, mvlan, gip, device)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelAllIgmpRcvr indicates an expected call of DelAllIgmpRcvr.
+func (mr *MockDBIntfMockRecorder) DelAllIgmpRcvr(ctx, mvlan, gip, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelAllIgmpRcvr", reflect.TypeOf((*MockDBIntf)(nil).DelAllIgmpRcvr), ctx, mvlan, gip, device)
+}
+
+// DelAllMeter mocks base method.
+func (m *MockDBIntf) DelAllMeter(ctx context.Context, device string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelAllMeter", ctx, device)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelAllMeter indicates an expected call of DelAllMeter.
+func (mr *MockDBIntfMockRecorder) DelAllMeter(ctx, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelAllMeter", reflect.TypeOf((*MockDBIntf)(nil).DelAllMeter), ctx, device)
+}
+
+// DelAllMigrateServicesReq mocks base method.
+func (m *MockDBIntf) DelAllMigrateServicesReq(ctx context.Context, deviceID string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelAllMigrateServicesReq", ctx, deviceID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelAllMigrateServicesReq indicates an expected call of DelAllMigrateServicesReq.
+func (mr *MockDBIntfMockRecorder) DelAllMigrateServicesReq(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelAllMigrateServicesReq", reflect.TypeOf((*MockDBIntf)(nil).DelAllMigrateServicesReq), ctx, deviceID)
+}
+
+// DelAllPONCounters mocks base method.
+func (m *MockDBIntf) DelAllPONCounters(ctx context.Context, device string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelAllPONCounters", ctx, device)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelAllPONCounters indicates an expected call of DelAllPONCounters.
+func (mr *MockDBIntfMockRecorder) DelAllPONCounters(ctx, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelAllPONCounters", reflect.TypeOf((*MockDBIntf)(nil).DelAllPONCounters), ctx, device)
+}
+
+// DelAllPorts mocks base method.
+func (m *MockDBIntf) DelAllPorts(ctx context.Context, deviceID string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelAllPorts", ctx, deviceID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelAllPorts indicates an expected call of DelAllPorts.
+func (mr *MockDBIntfMockRecorder) DelAllPorts(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelAllPorts", reflect.TypeOf((*MockDBIntf)(nil).DelAllPorts), ctx, deviceID)
+}
+
+// DelAllRoutesForDevice mocks base method.
+func (m *MockDBIntf) DelAllRoutesForDevice(ctx context.Context, device string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelAllRoutesForDevice", ctx, device)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelAllRoutesForDevice indicates an expected call of DelAllRoutesForDevice.
+func (mr *MockDBIntfMockRecorder) DelAllRoutesForDevice(ctx, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelAllRoutesForDevice", reflect.TypeOf((*MockDBIntf)(nil).DelAllRoutesForDevice), ctx, device)
+}
+
+// DelAllServiceChannelCounter mocks base method.
+func (m *MockDBIntf) DelAllServiceChannelCounter(ctx context.Context, serviceName string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelAllServiceChannelCounter", ctx, serviceName)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelAllServiceChannelCounter indicates an expected call of DelAllServiceChannelCounter.
+func (mr *MockDBIntfMockRecorder) DelAllServiceChannelCounter(ctx, serviceName interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelAllServiceChannelCounter", reflect.TypeOf((*MockDBIntf)(nil).DelAllServiceChannelCounter), ctx, serviceName)
+}
+
+// DelDeviceMeter mocks base method.
+func (m *MockDBIntf) DelDeviceMeter(ctx context.Context, deviceID string, meterID uint32) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelDeviceMeter", ctx, deviceID, meterID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelDeviceMeter indicates an expected call of DelDeviceMeter.
+func (mr *MockDBIntfMockRecorder) DelDeviceMeter(ctx, deviceID, meterID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelDeviceMeter", reflect.TypeOf((*MockDBIntf)(nil).DelDeviceMeter), ctx, deviceID, meterID)
+}
+
+// DelFlow mocks base method.
+func (m *MockDBIntf) DelFlow(ctx context.Context, deviceID string, flowID uint64) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelFlow", ctx, deviceID, flowID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelFlow indicates an expected call of DelFlow.
+func (mr *MockDBIntfMockRecorder) DelFlow(ctx, deviceID, flowID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelFlow", reflect.TypeOf((*MockDBIntf)(nil).DelFlow), ctx, deviceID, flowID)
+}
+
+// DelGroup mocks base method.
+func (m *MockDBIntf) DelGroup(ctx context.Context, deviceID string, groupID uint32) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelGroup", ctx, deviceID, groupID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelGroup indicates an expected call of DelGroup.
+func (mr *MockDBIntfMockRecorder) DelGroup(ctx, deviceID, groupID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelGroup", reflect.TypeOf((*MockDBIntf)(nil).DelGroup), ctx, deviceID, groupID)
+}
+
+// DelHealth mocks base method.
+func (m *MockDBIntf) DelHealth(ctx context.Context) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelHealth", ctx)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelHealth indicates an expected call of DelHealth.
+func (mr *MockDBIntfMockRecorder) DelHealth(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelHealth", reflect.TypeOf((*MockDBIntf)(nil).DelHealth), ctx)
+}
+
+// DelIGMPCfg mocks base method.
+func (m *MockDBIntf) DelIGMPCfg(ctx context.Context) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelIGMPCfg", ctx)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelIGMPCfg indicates an expected call of DelIGMPCfg.
+func (mr *MockDBIntfMockRecorder) DelIGMPCfg(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelIGMPCfg", reflect.TypeOf((*MockDBIntf)(nil).DelIGMPCfg), ctx)
+}
+
+// DelIgmpChannel mocks base method.
+func (m *MockDBIntf) DelIgmpChannel(ctx context.Context, mvlan of.VlanType, gName, device string, gip net.IP) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelIgmpChannel", ctx, mvlan, gName, device, gip)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelIgmpChannel indicates an expected call of DelIgmpChannel.
+func (mr *MockDBIntfMockRecorder) DelIgmpChannel(ctx, mvlan, gName, device, gip interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelIgmpChannel", reflect.TypeOf((*MockDBIntf)(nil).DelIgmpChannel), ctx, mvlan, gName, device, gip)
+}
+
+// DelIgmpDevice mocks base method.
+func (m *MockDBIntf) DelIgmpDevice(ctx context.Context, mvlan of.VlanType, gid string, gip net.IP, device string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelIgmpDevice", ctx, mvlan, gid, gip, device)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelIgmpDevice indicates an expected call of DelIgmpDevice.
+func (mr *MockDBIntfMockRecorder) DelIgmpDevice(ctx, mvlan, gid, gip, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelIgmpDevice", reflect.TypeOf((*MockDBIntf)(nil).DelIgmpDevice), ctx, mvlan, gid, gip, device)
+}
+
+// DelIgmpGroup mocks base method.
+func (m *MockDBIntf) DelIgmpGroup(ctx context.Context, id string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelIgmpGroup", ctx, id)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelIgmpGroup indicates an expected call of DelIgmpGroup.
+func (mr *MockDBIntfMockRecorder) DelIgmpGroup(ctx, id interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelIgmpGroup", reflect.TypeOf((*MockDBIntf)(nil).DelIgmpGroup), ctx, id)
+}
+
+// DelIgmpProfile mocks base method.
+func (m *MockDBIntf) DelIgmpProfile(ctx context.Context, name string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelIgmpProfile", ctx, name)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelIgmpProfile indicates an expected call of DelIgmpProfile.
+func (mr *MockDBIntfMockRecorder) DelIgmpProfile(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelIgmpProfile", reflect.TypeOf((*MockDBIntf)(nil).DelIgmpProfile), ctx, name)
+}
+
+// DelIgmpRcvr mocks base method.
+func (m *MockDBIntf) DelIgmpRcvr(ctx context.Context, mvlan of.VlanType, gip net.IP, device, rcvr string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelIgmpRcvr", ctx, mvlan, gip, device, rcvr)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelIgmpRcvr indicates an expected call of DelIgmpRcvr.
+func (mr *MockDBIntfMockRecorder) DelIgmpRcvr(ctx, mvlan, gip, device, rcvr interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelIgmpRcvr", reflect.TypeOf((*MockDBIntf)(nil).DelIgmpRcvr), ctx, mvlan, gip, device, rcvr)
+}
+
+// DelMcastConfig mocks base method.
+func (m *MockDBIntf) DelMcastConfig(ctx context.Context, name string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelMcastConfig", ctx, name)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelMcastConfig indicates an expected call of DelMcastConfig.
+func (mr *MockDBIntfMockRecorder) DelMcastConfig(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelMcastConfig", reflect.TypeOf((*MockDBIntf)(nil).DelMcastConfig), ctx, name)
+}
+
+// DelMeter mocks base method.
+func (m *MockDBIntf) DelMeter(ctx context.Context, name string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelMeter", ctx, name)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelMeter indicates an expected call of DelMeter.
+func (mr *MockDBIntfMockRecorder) DelMeter(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelMeter", reflect.TypeOf((*MockDBIntf)(nil).DelMeter), ctx, name)
+}
+
+// DelMigrateServicesReq mocks base method.
+func (m *MockDBIntf) DelMigrateServicesReq(ctx context.Context, deviceID, vlan string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelMigrateServicesReq", ctx, deviceID, vlan)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelMigrateServicesReq indicates an expected call of DelMigrateServicesReq.
+func (mr *MockDBIntfMockRecorder) DelMigrateServicesReq(ctx, deviceID, vlan interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelMigrateServicesReq", reflect.TypeOf((*MockDBIntf)(nil).DelMigrateServicesReq), ctx, deviceID, vlan)
+}
+
+// DelMigrationInfo mocks base method.
+func (m *MockDBIntf) DelMigrationInfo(ctx context.Context) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelMigrationInfo", ctx)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelMigrationInfo indicates an expected call of DelMigrationInfo.
+func (mr *MockDBIntfMockRecorder) DelMigrationInfo(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelMigrationInfo", reflect.TypeOf((*MockDBIntf)(nil).DelMigrationInfo), ctx)
+}
+
+// DelMvlan mocks base method.
+func (m *MockDBIntf) DelMvlan(ctx context.Context, mvlan uint16) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelMvlan", ctx, mvlan)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelMvlan indicates an expected call of DelMvlan.
+func (mr *MockDBIntfMockRecorder) DelMvlan(ctx, mvlan interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelMvlan", reflect.TypeOf((*MockDBIntf)(nil).DelMvlan), ctx, mvlan)
+}
+
+// DelNbDevicePort mocks base method.
+func (m *MockDBIntf) DelNbDevicePort(ctx context.Context, device string, ponPortID uint32) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DelNbDevicePort", ctx, device, ponPortID)
+}
+
+// DelNbDevicePort indicates an expected call of DelNbDevicePort.
+func (mr *MockDBIntfMockRecorder) DelNbDevicePort(ctx, device, ponPortID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelNbDevicePort", reflect.TypeOf((*MockDBIntf)(nil).DelNbDevicePort), ctx, device, ponPortID)
+}
+
+// DelOlt mocks base method.
+func (m *MockDBIntf) DelOlt(ctx context.Context, deviceID string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelOlt", ctx, deviceID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelOlt indicates an expected call of DelOlt.
+func (mr *MockDBIntfMockRecorder) DelOlt(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelOlt", reflect.TypeOf((*MockDBIntf)(nil).DelOlt), ctx, deviceID)
+}
+
+// DelPONCounters mocks base method.
+func (m *MockDBIntf) DelPONCounters(ctx context.Context, device, ponID string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DelPONCounters", ctx, device, ponID)
+}
+
+// DelPONCounters indicates an expected call of DelPONCounters.
+func (mr *MockDBIntfMockRecorder) DelPONCounters(ctx, device, ponID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelPONCounters", reflect.TypeOf((*MockDBIntf)(nil).DelPONCounters), ctx, device, ponID)
+}
+
+// DelPonChannelCounter mocks base method.
+func (m *MockDBIntf) DelPonChannelCounter(ctx context.Context, device, ponID, channel string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelPonChannelCounter", ctx, device, ponID, channel)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelPonChannelCounter indicates an expected call of DelPonChannelCounter.
+func (mr *MockDBIntfMockRecorder) DelPonChannelCounter(ctx, device, ponID, channel interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelPonChannelCounter", reflect.TypeOf((*MockDBIntf)(nil).DelPonChannelCounter), ctx, device, ponID, channel)
+}
+
+// DelPonCounter mocks base method.
+func (m *MockDBIntf) DelPonCounter(ctx context.Context, device, ponID string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelPonCounter", ctx, device, ponID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelPonCounter indicates an expected call of DelPonCounter.
+func (mr *MockDBIntfMockRecorder) DelPonCounter(ctx, device, ponID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelPonCounter", reflect.TypeOf((*MockDBIntf)(nil).DelPonCounter), ctx, device, ponID)
+}
+
+// DelPort mocks base method.
+func (m *MockDBIntf) DelPort(ctx context.Context, deviceID string, portID uint32) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelPort", ctx, deviceID, portID)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelPort indicates an expected call of DelPort.
+func (mr *MockDBIntfMockRecorder) DelPort(ctx, deviceID, portID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelPort", reflect.TypeOf((*MockDBIntf)(nil).DelPort), ctx, deviceID, portID)
+}
+
+// DelPortAlarmData mocks base method.
+func (m *MockDBIntf) DelPortAlarmData(ctx context.Context, deviceID string, portID uint32) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DelPortAlarmData", ctx, deviceID, portID)
+}
+
+// DelPortAlarmData indicates an expected call of DelPortAlarmData.
+func (mr *MockDBIntfMockRecorder) DelPortAlarmData(ctx, deviceID, portID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelPortAlarmData", reflect.TypeOf((*MockDBIntf)(nil).DelPortAlarmData), ctx, deviceID, portID)
+}
+
+// DelPortAlarmProfile mocks base method.
+func (m *MockDBIntf) DelPortAlarmProfile(ctx context.Context, portAlarmProfileID string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DelPortAlarmProfile", ctx, portAlarmProfileID)
+}
+
+// DelPortAlarmProfile indicates an expected call of DelPortAlarmProfile.
+func (mr *MockDBIntfMockRecorder) DelPortAlarmProfile(ctx, portAlarmProfileID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelPortAlarmProfile", reflect.TypeOf((*MockDBIntf)(nil).DelPortAlarmProfile), ctx, portAlarmProfileID)
+}
+
+// DelService mocks base method.
+func (m *MockDBIntf) DelService(ctx context.Context, name string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelService", ctx, name)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelService indicates an expected call of DelService.
+func (mr *MockDBIntfMockRecorder) DelService(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelService", reflect.TypeOf((*MockDBIntf)(nil).DelService), ctx, name)
+}
+
+// DelServiceChannelCounter mocks base method.
+func (m *MockDBIntf) DelServiceChannelCounter(ctx context.Context, serviceName, channel string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelServiceChannelCounter", ctx, serviceName, channel)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelServiceChannelCounter indicates an expected call of DelServiceChannelCounter.
+func (mr *MockDBIntfMockRecorder) DelServiceChannelCounter(ctx, serviceName, channel interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelServiceChannelCounter", reflect.TypeOf((*MockDBIntf)(nil).DelServiceChannelCounter), ctx, serviceName, channel)
+}
+
+// DelSubAlarmData mocks base method.
+func (m *MockDBIntf) DelSubAlarmData(ctx context.Context, deviceID, portName string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "DelSubAlarmData", ctx, deviceID, portName)
+}
+
+// DelSubAlarmData indicates an expected call of DelSubAlarmData.
+func (mr *MockDBIntfMockRecorder) DelSubAlarmData(ctx, deviceID, portName interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelSubAlarmData", reflect.TypeOf((*MockDBIntf)(nil).DelSubAlarmData), ctx, deviceID, portName)
+}
+
+// DelVnet mocks base method.
+func (m *MockDBIntf) DelVnet(ctx context.Context, name string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelVnet", ctx, name)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelVnet indicates an expected call of DelVnet.
+func (mr *MockDBIntfMockRecorder) DelVnet(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelVnet", reflect.TypeOf((*MockDBIntf)(nil).DelVnet), ctx, name)
+}
+
+// DelVpv mocks base method.
+func (m *MockDBIntf) DelVpv(ctx context.Context, port string, SVlan, CVlan, UniVlan uint16) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DelVpv", ctx, port, SVlan, CVlan, UniVlan)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DelVpv indicates an expected call of DelVpv.
+func (mr *MockDBIntfMockRecorder) DelVpv(ctx, port, SVlan, CVlan, UniVlan interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DelVpv", reflect.TypeOf((*MockDBIntf)(nil).DelVpv), ctx, port, SVlan, CVlan, UniVlan)
+}
+
+// DeleteAll mocks base method.
+func (m *MockDBIntf) DeleteAll(ctx context.Context, path string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DeleteAll", ctx, path)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DeleteAll indicates an expected call of DeleteAll.
+func (mr *MockDBIntfMockRecorder) DeleteAll(ctx, path interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAll", reflect.TypeOf((*MockDBIntf)(nil).DeleteAll), ctx, path)
+}
+
+// DeleteAllUnderHashKey mocks base method.
+func (m *MockDBIntf) DeleteAllUnderHashKey(ctx context.Context, hashKeyPrefix string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "DeleteAllUnderHashKey", ctx, hashKeyPrefix)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// DeleteAllUnderHashKey indicates an expected call of DeleteAllUnderHashKey.
+func (mr *MockDBIntfMockRecorder) DeleteAllUnderHashKey(ctx, hashKeyPrefix interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllUnderHashKey", reflect.TypeOf((*MockDBIntf)(nil).DeleteAllUnderHashKey), ctx, hashKeyPrefix)
+}
+
+// Get mocks base method.
+func (m *MockDBIntf) Get(ctx context.Context, key string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Get", ctx, key)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// Get indicates an expected call of Get.
+func (mr *MockDBIntfMockRecorder) Get(ctx, key interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockDBIntf)(nil).Get), ctx, key)
+}
+
+// GetAllIgmpChannels mocks base method.
+func (m *MockDBIntf) GetAllIgmpChannels(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllIgmpChannels", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllIgmpChannels indicates an expected call of GetAllIgmpChannels.
+func (mr *MockDBIntfMockRecorder) GetAllIgmpChannels(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllIgmpChannels", reflect.TypeOf((*MockDBIntf)(nil).GetAllIgmpChannels), ctx)
+}
+
+// GetAllIgmpDevices mocks base method.
+func (m *MockDBIntf) GetAllIgmpDevices(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllIgmpDevices", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllIgmpDevices indicates an expected call of GetAllIgmpDevices.
+func (mr *MockDBIntfMockRecorder) GetAllIgmpDevices(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllIgmpDevices", reflect.TypeOf((*MockDBIntf)(nil).GetAllIgmpDevices), ctx)
+}
+
+// GetAllIgmpRcvrs mocks base method.
+func (m *MockDBIntf) GetAllIgmpRcvrs(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllIgmpRcvrs", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllIgmpRcvrs indicates an expected call of GetAllIgmpRcvrs.
+func (mr *MockDBIntfMockRecorder) GetAllIgmpRcvrs(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllIgmpRcvrs", reflect.TypeOf((*MockDBIntf)(nil).GetAllIgmpRcvrs), ctx)
+}
+
+// GetAllMigrateServicesReq mocks base method.
+func (m *MockDBIntf) GetAllMigrateServicesReq(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllMigrateServicesReq", ctx, deviceID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllMigrateServicesReq indicates an expected call of GetAllMigrateServicesReq.
+func (mr *MockDBIntfMockRecorder) GetAllMigrateServicesReq(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllMigrateServicesReq", reflect.TypeOf((*MockDBIntf)(nil).GetAllMigrateServicesReq), ctx, deviceID)
+}
+
+// GetAllNbPorts mocks base method.
+func (m *MockDBIntf) GetAllNbPorts(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllNbPorts", ctx, deviceID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllNbPorts indicates an expected call of GetAllNbPorts.
+func (mr *MockDBIntfMockRecorder) GetAllNbPorts(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllNbPorts", reflect.TypeOf((*MockDBIntf)(nil).GetAllNbPorts), ctx, deviceID)
+}
+
+// GetAllPonChannelCounters mocks base method.
+func (m *MockDBIntf) GetAllPonChannelCounters(ctx context.Context, device, ponID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllPonChannelCounters", ctx, device, ponID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllPonChannelCounters indicates an expected call of GetAllPonChannelCounters.
+func (mr *MockDBIntfMockRecorder) GetAllPonChannelCounters(ctx, device, ponID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllPonChannelCounters", reflect.TypeOf((*MockDBIntf)(nil).GetAllPonChannelCounters), ctx, device, ponID)
+}
+
+// GetAllPonCounters mocks base method.
+func (m *MockDBIntf) GetAllPonCounters(ctx context.Context, device string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllPonCounters", ctx, device)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllPonCounters indicates an expected call of GetAllPonCounters.
+func (mr *MockDBIntfMockRecorder) GetAllPonCounters(ctx, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllPonCounters", reflect.TypeOf((*MockDBIntf)(nil).GetAllPonCounters), ctx, device)
+}
+
+// GetAllPortAlarmData mocks base method.
+func (m *MockDBIntf) GetAllPortAlarmData(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllPortAlarmData", ctx, deviceID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllPortAlarmData indicates an expected call of GetAllPortAlarmData.
+func (mr *MockDBIntfMockRecorder) GetAllPortAlarmData(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllPortAlarmData", reflect.TypeOf((*MockDBIntf)(nil).GetAllPortAlarmData), ctx, deviceID)
+}
+
+// GetAllServiceChannelCounters mocks base method.
+func (m *MockDBIntf) GetAllServiceChannelCounters(ctx context.Context, serviceName string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllServiceChannelCounters", ctx, serviceName)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllServiceChannelCounters indicates an expected call of GetAllServiceChannelCounters.
+func (mr *MockDBIntfMockRecorder) GetAllServiceChannelCounters(ctx, serviceName interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllServiceChannelCounters", reflect.TypeOf((*MockDBIntf)(nil).GetAllServiceChannelCounters), ctx, serviceName)
+}
+
+// GetAllSubAlarmData mocks base method.
+func (m *MockDBIntf) GetAllSubAlarmData(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetAllSubAlarmData", ctx, deviceID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetAllSubAlarmData indicates an expected call of GetAllSubAlarmData.
+func (mr *MockDBIntfMockRecorder) GetAllSubAlarmData(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllSubAlarmData", reflect.TypeOf((*MockDBIntf)(nil).GetAllSubAlarmData), ctx, deviceID)
+}
+
+// GetDeviceConfig mocks base method.
+func (m *MockDBIntf) GetDeviceConfig(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetDeviceConfig", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetDeviceConfig indicates an expected call of GetDeviceConfig.
+func (mr *MockDBIntfMockRecorder) GetDeviceConfig(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeviceConfig", reflect.TypeOf((*MockDBIntf)(nil).GetDeviceConfig), ctx)
+}
+
+// GetDeviceMeter mocks base method.
+func (m *MockDBIntf) GetDeviceMeter(ctx context.Context, deviceID string, meterID uint32) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetDeviceMeter", ctx, deviceID, meterID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetDeviceMeter indicates an expected call of GetDeviceMeter.
+func (mr *MockDBIntfMockRecorder) GetDeviceMeter(ctx, deviceID, meterID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeviceMeter", reflect.TypeOf((*MockDBIntf)(nil).GetDeviceMeter), ctx, deviceID, meterID)
+}
+
+// GetDeviceMeters mocks base method.
+func (m *MockDBIntf) GetDeviceMeters(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetDeviceMeters", ctx, deviceID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetDeviceMeters indicates an expected call of GetDeviceMeters.
+func (mr *MockDBIntfMockRecorder) GetDeviceMeters(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeviceMeters", reflect.TypeOf((*MockDBIntf)(nil).GetDeviceMeters), ctx, deviceID)
+}
+
+// GetFlow mocks base method.
+func (m *MockDBIntf) GetFlow(ctx context.Context, deviceID string, flowID uint64) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetFlow", ctx, deviceID, flowID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetFlow indicates an expected call of GetFlow.
+func (mr *MockDBIntfMockRecorder) GetFlow(ctx, deviceID, flowID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFlow", reflect.TypeOf((*MockDBIntf)(nil).GetFlow), ctx, deviceID, flowID)
+}
+
+// GetFlowHash mocks base method.
+func (m *MockDBIntf) GetFlowHash(ctx context.Context, deviceID string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetFlowHash", ctx, deviceID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetFlowHash indicates an expected call of GetFlowHash.
+func (mr *MockDBIntfMockRecorder) GetFlowHash(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFlowHash", reflect.TypeOf((*MockDBIntf)(nil).GetFlowHash), ctx, deviceID)
+}
+
+// GetFlows mocks base method.
+func (m *MockDBIntf) GetFlows(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetFlows", ctx, deviceID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetFlows indicates an expected call of GetFlows.
+func (mr *MockDBIntfMockRecorder) GetFlows(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFlows", reflect.TypeOf((*MockDBIntf)(nil).GetFlows), ctx, deviceID)
+}
+
+// GetGroup mocks base method.
+func (m *MockDBIntf) GetGroup(ctx context.Context, deviceID string, groupID uint32) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetGroup", ctx, deviceID, groupID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetGroup indicates an expected call of GetGroup.
+func (mr *MockDBIntfMockRecorder) GetGroup(ctx, deviceID, groupID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGroup", reflect.TypeOf((*MockDBIntf)(nil).GetGroup), ctx, deviceID, groupID)
+}
+
+// GetGroups mocks base method.
+func (m *MockDBIntf) GetGroups(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetGroups", ctx, deviceID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetGroups indicates an expected call of GetGroups.
+func (mr *MockDBIntfMockRecorder) GetGroups(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGroups", reflect.TypeOf((*MockDBIntf)(nil).GetGroups), ctx, deviceID)
+}
+
+// GetHealth mocks base method.
+func (m *MockDBIntf) GetHealth(ctx context.Context) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetHealth", ctx)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetHealth indicates an expected call of GetHealth.
+func (mr *MockDBIntfMockRecorder) GetHealth(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHealth", reflect.TypeOf((*MockDBIntf)(nil).GetHealth), ctx)
+}
+
+// GetIgmpChannel mocks base method.
+func (m *MockDBIntf) GetIgmpChannel(ctx context.Context, mvlan of.VlanType, gName, device string, gip net.IP) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpChannel", ctx, mvlan, gName, device, gip)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpChannel indicates an expected call of GetIgmpChannel.
+func (mr *MockDBIntfMockRecorder) GetIgmpChannel(ctx, mvlan, gName, device, gip interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpChannel", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpChannel), ctx, mvlan, gName, device, gip)
+}
+
+// GetIgmpChannels mocks base method.
+func (m *MockDBIntf) GetIgmpChannels(ctx context.Context, mvlan of.VlanType, gname, device string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpChannels", ctx, mvlan, gname, device)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpChannels indicates an expected call of GetIgmpChannels.
+func (mr *MockDBIntfMockRecorder) GetIgmpChannels(ctx, mvlan, gname, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpChannels", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpChannels), ctx, mvlan, gname, device)
+}
+
+// GetIgmpDevice mocks base method.
+func (m *MockDBIntf) GetIgmpDevice(ctx context.Context, mvlan of.VlanType, gid string, gip net.IP, device string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpDevice", ctx, mvlan, gid, gip, device)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpDevice indicates an expected call of GetIgmpDevice.
+func (mr *MockDBIntfMockRecorder) GetIgmpDevice(ctx, mvlan, gid, gip, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpDevice", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpDevice), ctx, mvlan, gid, gip, device)
+}
+
+// GetIgmpDevices mocks base method.
+func (m *MockDBIntf) GetIgmpDevices(ctx context.Context, mvlan of.VlanType, gid string, gip net.IP) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpDevices", ctx, mvlan, gid, gip)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpDevices indicates an expected call of GetIgmpDevices.
+func (mr *MockDBIntfMockRecorder) GetIgmpDevices(ctx, mvlan, gid, gip interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpDevices", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpDevices), ctx, mvlan, gid, gip)
+}
+
+// GetIgmpGroup mocks base method.
+func (m *MockDBIntf) GetIgmpGroup(ctx context.Context, id string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpGroup", ctx, id)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpGroup indicates an expected call of GetIgmpGroup.
+func (mr *MockDBIntfMockRecorder) GetIgmpGroup(ctx, id interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpGroup", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpGroup), ctx, id)
+}
+
+// GetIgmpGroups mocks base method.
+func (m *MockDBIntf) GetIgmpGroups(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpGroups", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpGroups indicates an expected call of GetIgmpGroups.
+func (mr *MockDBIntfMockRecorder) GetIgmpGroups(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpGroups", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpGroups), ctx)
+}
+
+// GetIgmpProfile mocks base method.
+func (m *MockDBIntf) GetIgmpProfile(ctx context.Context, name string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpProfile", ctx, name)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpProfile indicates an expected call of GetIgmpProfile.
+func (mr *MockDBIntfMockRecorder) GetIgmpProfile(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpProfile", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpProfile), ctx, name)
+}
+
+// GetIgmpProfiles mocks base method.
+func (m *MockDBIntf) GetIgmpProfiles(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpProfiles", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpProfiles indicates an expected call of GetIgmpProfiles.
+func (mr *MockDBIntfMockRecorder) GetIgmpProfiles(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpProfiles", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpProfiles), ctx)
+}
+
+// GetIgmpRcvr mocks base method.
+func (m *MockDBIntf) GetIgmpRcvr(ctx context.Context, mvlan of.VlanType, gip net.IP, device, rcvr string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpRcvr", ctx, mvlan, gip, device, rcvr)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpRcvr indicates an expected call of GetIgmpRcvr.
+func (mr *MockDBIntfMockRecorder) GetIgmpRcvr(ctx, mvlan, gip, device, rcvr interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpRcvr", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpRcvr), ctx, mvlan, gip, device, rcvr)
+}
+
+// GetIgmpRcvrs mocks base method.
+func (m *MockDBIntf) GetIgmpRcvrs(ctx context.Context, mvlan of.VlanType, gip net.IP, device string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetIgmpRcvrs", ctx, mvlan, gip, device)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetIgmpRcvrs indicates an expected call of GetIgmpRcvrs.
+func (mr *MockDBIntfMockRecorder) GetIgmpRcvrs(ctx, mvlan, gip, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetIgmpRcvrs", reflect.TypeOf((*MockDBIntf)(nil).GetIgmpRcvrs), ctx, mvlan, gip, device)
+}
+
+// GetMcastConfig mocks base method.
+func (m *MockDBIntf) GetMcastConfig(ctx context.Context, name string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetMcastConfig", ctx, name)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetMcastConfig indicates an expected call of GetMcastConfig.
+func (mr *MockDBIntfMockRecorder) GetMcastConfig(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMcastConfig", reflect.TypeOf((*MockDBIntf)(nil).GetMcastConfig), ctx, name)
+}
+
+// GetMcastConfigs mocks base method.
+func (m *MockDBIntf) GetMcastConfigs(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetMcastConfigs", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetMcastConfigs indicates an expected call of GetMcastConfigs.
+func (mr *MockDBIntfMockRecorder) GetMcastConfigs(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMcastConfigs", reflect.TypeOf((*MockDBIntf)(nil).GetMcastConfigs), ctx)
+}
+
+// GetMeter mocks base method.
+func (m *MockDBIntf) GetMeter(ctx context.Context, name string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetMeter", ctx, name)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetMeter indicates an expected call of GetMeter.
+func (mr *MockDBIntfMockRecorder) GetMeter(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMeter", reflect.TypeOf((*MockDBIntf)(nil).GetMeter), ctx, name)
+}
+
+// GetMeters mocks base method.
+func (m *MockDBIntf) GetMeters(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetMeters", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetMeters indicates an expected call of GetMeters.
+func (mr *MockDBIntfMockRecorder) GetMeters(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMeters", reflect.TypeOf((*MockDBIntf)(nil).GetMeters), ctx)
+}
+
+// GetMigrateServicesReq mocks base method.
+func (m *MockDBIntf) GetMigrateServicesReq(ctx context.Context, deviceID, vlan string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetMigrateServicesReq", ctx, deviceID, vlan)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetMigrateServicesReq indicates an expected call of GetMigrateServicesReq.
+func (mr *MockDBIntfMockRecorder) GetMigrateServicesReq(ctx, deviceID, vlan interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMigrateServicesReq", reflect.TypeOf((*MockDBIntf)(nil).GetMigrateServicesReq), ctx, deviceID, vlan)
+}
+
+// GetMigrationInfo mocks base method.
+func (m *MockDBIntf) GetMigrationInfo(ctx context.Context) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetMigrationInfo", ctx)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetMigrationInfo indicates an expected call of GetMigrationInfo.
+func (mr *MockDBIntfMockRecorder) GetMigrationInfo(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMigrationInfo", reflect.TypeOf((*MockDBIntf)(nil).GetMigrationInfo), ctx)
+}
+
+// GetMvlan mocks base method.
+func (m *MockDBIntf) GetMvlan(ctx context.Context, mvlan uint16) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetMvlan", ctx, mvlan)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetMvlan indicates an expected call of GetMvlan.
+func (mr *MockDBIntfMockRecorder) GetMvlan(ctx, mvlan interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMvlan", reflect.TypeOf((*MockDBIntf)(nil).GetMvlan), ctx, mvlan)
+}
+
+// GetMvlans mocks base method.
+func (m *MockDBIntf) GetMvlans(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetMvlans", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetMvlans indicates an expected call of GetMvlans.
+func (mr *MockDBIntfMockRecorder) GetMvlans(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMvlans", reflect.TypeOf((*MockDBIntf)(nil).GetMvlans), ctx)
+}
+
+// GetOlt mocks base method.
+func (m *MockDBIntf) GetOlt(ctx context.Context, deviceID string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetOlt", ctx, deviceID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetOlt indicates an expected call of GetOlt.
+func (mr *MockDBIntfMockRecorder) GetOlt(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOlt", reflect.TypeOf((*MockDBIntf)(nil).GetOlt), ctx, deviceID)
+}
+
+// GetOltFlowService mocks base method.
+func (m *MockDBIntf) GetOltFlowService(ctx context.Context) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetOltFlowService", ctx)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetOltFlowService indicates an expected call of GetOltFlowService.
+func (mr *MockDBIntfMockRecorder) GetOltFlowService(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOltFlowService", reflect.TypeOf((*MockDBIntf)(nil).GetOltFlowService), ctx)
+}
+
+// GetOltIgmpCounter mocks base method.
+func (m *MockDBIntf) GetOltIgmpCounter(ctx context.Context, device string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetOltIgmpCounter", ctx, device)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetOltIgmpCounter indicates an expected call of GetOltIgmpCounter.
+func (mr *MockDBIntfMockRecorder) GetOltIgmpCounter(ctx, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOltIgmpCounter", reflect.TypeOf((*MockDBIntf)(nil).GetOltIgmpCounter), ctx, device)
+}
+
+// GetPonChannelCounter mocks base method.
+func (m *MockDBIntf) GetPonChannelCounter(ctx context.Context, device, ponID, channel string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPonChannelCounter", ctx, device, ponID, channel)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPonChannelCounter indicates an expected call of GetPonChannelCounter.
+func (mr *MockDBIntfMockRecorder) GetPonChannelCounter(ctx, device, ponID, channel interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPonChannelCounter", reflect.TypeOf((*MockDBIntf)(nil).GetPonChannelCounter), ctx, device, ponID, channel)
+}
+
+// GetPonCounter mocks base method.
+func (m *MockDBIntf) GetPonCounter(ctx context.Context, device, ponID string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPonCounter", ctx, device, ponID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPonCounter indicates an expected call of GetPonCounter.
+func (mr *MockDBIntfMockRecorder) GetPonCounter(ctx, device, ponID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPonCounter", reflect.TypeOf((*MockDBIntf)(nil).GetPonCounter), ctx, device, ponID)
+}
+
+// GetPort mocks base method.
+func (m *MockDBIntf) GetPort(ctx context.Context, deviceID string, portID uint32) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPort", ctx, deviceID, portID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPort indicates an expected call of GetPort.
+func (mr *MockDBIntfMockRecorder) GetPort(ctx, deviceID, portID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPort", reflect.TypeOf((*MockDBIntf)(nil).GetPort), ctx, deviceID, portID)
+}
+
+// GetPortAlarmData mocks base method.
+func (m *MockDBIntf) GetPortAlarmData(ctx context.Context, deviceID string, portID uint32) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPortAlarmData", ctx, deviceID, portID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPortAlarmData indicates an expected call of GetPortAlarmData.
+func (mr *MockDBIntfMockRecorder) GetPortAlarmData(ctx, deviceID, portID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPortAlarmData", reflect.TypeOf((*MockDBIntf)(nil).GetPortAlarmData), ctx, deviceID, portID)
+}
+
+// GetPortAlarmProfile mocks base method.
+func (m *MockDBIntf) GetPortAlarmProfile(ctx context.Context, portAlarmProfileID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPortAlarmProfile", ctx, portAlarmProfileID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPortAlarmProfile indicates an expected call of GetPortAlarmProfile.
+func (mr *MockDBIntfMockRecorder) GetPortAlarmProfile(ctx, portAlarmProfileID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPortAlarmProfile", reflect.TypeOf((*MockDBIntf)(nil).GetPortAlarmProfile), ctx, portAlarmProfileID)
+}
+
+// GetPorts mocks base method.
+func (m *MockDBIntf) GetPorts(ctx context.Context, deviceID string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPorts", ctx, deviceID)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPorts indicates an expected call of GetPorts.
+func (mr *MockDBIntfMockRecorder) GetPorts(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPorts", reflect.TypeOf((*MockDBIntf)(nil).GetPorts), ctx, deviceID)
+}
+
+// GetPrevIgmpChannels mocks base method.
+func (m *MockDBIntf) GetPrevIgmpChannels(ctx context.Context, gname, device string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPrevIgmpChannels", ctx, gname, device)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPrevIgmpChannels indicates an expected call of GetPrevIgmpChannels.
+func (mr *MockDBIntfMockRecorder) GetPrevIgmpChannels(ctx, gname, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrevIgmpChannels", reflect.TypeOf((*MockDBIntf)(nil).GetPrevIgmpChannels), ctx, gname, device)
+}
+
+// GetPrevIgmpDevices mocks base method.
+func (m *MockDBIntf) GetPrevIgmpDevices(ctx context.Context, mvlan of.VlanType, gid string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPrevIgmpDevices", ctx, mvlan, gid)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPrevIgmpDevices indicates an expected call of GetPrevIgmpDevices.
+func (mr *MockDBIntfMockRecorder) GetPrevIgmpDevices(ctx, mvlan, gid interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrevIgmpDevices", reflect.TypeOf((*MockDBIntf)(nil).GetPrevIgmpDevices), ctx, mvlan, gid)
+}
+
+// GetPrevIgmpRcvrs mocks base method.
+func (m *MockDBIntf) GetPrevIgmpRcvrs(ctx context.Context, gip net.IP, device string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetPrevIgmpRcvrs", ctx, gip, device)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetPrevIgmpRcvrs indicates an expected call of GetPrevIgmpRcvrs.
+func (mr *MockDBIntfMockRecorder) GetPrevIgmpRcvrs(ctx, gip, device interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrevIgmpRcvrs", reflect.TypeOf((*MockDBIntf)(nil).GetPrevIgmpRcvrs), ctx, gip, device)
+}
+
+// GetService mocks base method.
+func (m *MockDBIntf) GetService(ctx context.Context, name string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetService", ctx, name)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetService indicates an expected call of GetService.
+func (mr *MockDBIntfMockRecorder) GetService(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetService", reflect.TypeOf((*MockDBIntf)(nil).GetService), ctx, name)
+}
+
+// GetServiceChannelCounter mocks base method.
+func (m *MockDBIntf) GetServiceChannelCounter(ctx context.Context, serviceName, channel string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetServiceChannelCounter", ctx, serviceName, channel)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetServiceChannelCounter indicates an expected call of GetServiceChannelCounter.
+func (mr *MockDBIntfMockRecorder) GetServiceChannelCounter(ctx, serviceName, channel interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetServiceChannelCounter", reflect.TypeOf((*MockDBIntf)(nil).GetServiceChannelCounter), ctx, serviceName, channel)
+}
+
+// GetServices mocks base method.
+func (m *MockDBIntf) GetServices(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetServices", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetServices indicates an expected call of GetServices.
+func (mr *MockDBIntfMockRecorder) GetServices(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetServices", reflect.TypeOf((*MockDBIntf)(nil).GetServices), ctx)
+}
+
+// GetSubAlarmData mocks base method.
+func (m *MockDBIntf) GetSubAlarmData(ctx context.Context, deviceID, portName string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetSubAlarmData", ctx, deviceID, portName)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetSubAlarmData indicates an expected call of GetSubAlarmData.
+func (mr *MockDBIntfMockRecorder) GetSubAlarmData(ctx, deviceID, portName interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubAlarmData", reflect.TypeOf((*MockDBIntf)(nil).GetSubAlarmData), ctx, deviceID, portName)
+}
+
+// GetVnet mocks base method.
+func (m *MockDBIntf) GetVnet(ctx context.Context, name string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetVnet", ctx, name)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetVnet indicates an expected call of GetVnet.
+func (mr *MockDBIntfMockRecorder) GetVnet(ctx, name interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVnet", reflect.TypeOf((*MockDBIntf)(nil).GetVnet), ctx, name)
+}
+
+// GetVnets mocks base method.
+func (m *MockDBIntf) GetVnets(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetVnets", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetVnets indicates an expected call of GetVnets.
+func (mr *MockDBIntfMockRecorder) GetVnets(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVnets", reflect.TypeOf((*MockDBIntf)(nil).GetVnets), ctx)
+}
+
+// GetVpv mocks base method.
+func (m *MockDBIntf) GetVpv(ctx context.Context, port string, SVlan, CVlan, UniVlan uint16) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetVpv", ctx, port, SVlan, CVlan, UniVlan)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetVpv indicates an expected call of GetVpv.
+func (mr *MockDBIntfMockRecorder) GetVpv(ctx, port, SVlan, CVlan, UniVlan interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpv", reflect.TypeOf((*MockDBIntf)(nil).GetVpv), ctx, port, SVlan, CVlan, UniVlan)
+}
+
+// GetVpvs mocks base method.
+func (m *MockDBIntf) GetVpvs(ctx context.Context) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetVpvs", ctx)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetVpvs indicates an expected call of GetVpvs.
+func (mr *MockDBIntfMockRecorder) GetVpvs(ctx interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpvs", reflect.TypeOf((*MockDBIntf)(nil).GetVpvs), ctx)
+}
+
+// List mocks base method.
+func (m *MockDBIntf) List(ctx context.Context, key string) (map[string]*kvstore.KVPair, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "List", ctx, key)
+ ret0, _ := ret[0].(map[string]*kvstore.KVPair)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// List indicates an expected call of List.
+func (mr *MockDBIntfMockRecorder) List(ctx, key interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockDBIntf)(nil).List), ctx, key)
+}
+
+// OltExists mocks base method.
+func (m *MockDBIntf) OltExists(ctx context.Context, deviceID string) bool {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "OltExists", ctx, deviceID)
+ ret0, _ := ret[0].(bool)
+ return ret0
+}
+
+// OltExists indicates an expected call of OltExists.
+func (mr *MockDBIntfMockRecorder) OltExists(ctx, deviceID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OltExists", reflect.TypeOf((*MockDBIntf)(nil).OltExists), ctx, deviceID)
+}
+
+// Put mocks base method.
+func (m *MockDBIntf) Put(ctx context.Context, fullKeyPath, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Put", ctx, fullKeyPath, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Put indicates an expected call of Put.
+func (mr *MockDBIntfMockRecorder) Put(ctx, fullKeyPath, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockDBIntf)(nil).Put), ctx, fullKeyPath, value)
+}
+
+// PutDeviceConfig mocks base method.
+func (m *MockDBIntf) PutDeviceConfig(ctx context.Context, serialNum, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutDeviceConfig", ctx, serialNum, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutDeviceConfig indicates an expected call of PutDeviceConfig.
+func (mr *MockDBIntfMockRecorder) PutDeviceConfig(ctx, serialNum, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutDeviceConfig", reflect.TypeOf((*MockDBIntf)(nil).PutDeviceConfig), ctx, serialNum, value)
+}
+
+// PutDeviceMeter mocks base method.
+func (m *MockDBIntf) PutDeviceMeter(ctx context.Context, deviceID string, meterID uint32, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutDeviceMeter", ctx, deviceID, meterID, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutDeviceMeter indicates an expected call of PutDeviceMeter.
+func (mr *MockDBIntfMockRecorder) PutDeviceMeter(ctx, deviceID, meterID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutDeviceMeter", reflect.TypeOf((*MockDBIntf)(nil).PutDeviceMeter), ctx, deviceID, meterID, value)
+}
+
+// PutFlow mocks base method.
+func (m *MockDBIntf) PutFlow(ctx context.Context, deviceID string, flowID uint64, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutFlow", ctx, deviceID, flowID, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutFlow indicates an expected call of PutFlow.
+func (mr *MockDBIntfMockRecorder) PutFlow(ctx, deviceID, flowID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutFlow", reflect.TypeOf((*MockDBIntf)(nil).PutFlow), ctx, deviceID, flowID, value)
+}
+
+// PutFlowHash mocks base method.
+func (m *MockDBIntf) PutFlowHash(ctx context.Context, deviceID, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutFlowHash", ctx, deviceID, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutFlowHash indicates an expected call of PutFlowHash.
+func (mr *MockDBIntfMockRecorder) PutFlowHash(ctx, deviceID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutFlowHash", reflect.TypeOf((*MockDBIntf)(nil).PutFlowHash), ctx, deviceID, value)
+}
+
+// PutGroup mocks base method.
+func (m *MockDBIntf) PutGroup(ctx context.Context, deviceID string, groupID uint32, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutGroup", ctx, deviceID, groupID, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutGroup indicates an expected call of PutGroup.
+func (mr *MockDBIntfMockRecorder) PutGroup(ctx, deviceID, groupID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutGroup", reflect.TypeOf((*MockDBIntf)(nil).PutGroup), ctx, deviceID, groupID, value)
+}
+
+// PutHealth mocks base method.
+func (m *MockDBIntf) PutHealth(ctx context.Context, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutHealth", ctx, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutHealth indicates an expected call of PutHealth.
+func (mr *MockDBIntfMockRecorder) PutHealth(ctx, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutHealth", reflect.TypeOf((*MockDBIntf)(nil).PutHealth), ctx, value)
+}
+
+// PutIgmpChannel mocks base method.
+func (m *MockDBIntf) PutIgmpChannel(ctx context.Context, mvlan of.VlanType, gName, device string, gip net.IP, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutIgmpChannel", ctx, mvlan, gName, device, gip, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutIgmpChannel indicates an expected call of PutIgmpChannel.
+func (mr *MockDBIntfMockRecorder) PutIgmpChannel(ctx, mvlan, gName, device, gip, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutIgmpChannel", reflect.TypeOf((*MockDBIntf)(nil).PutIgmpChannel), ctx, mvlan, gName, device, gip, value)
+}
+
+// PutIgmpDevice mocks base method.
+func (m *MockDBIntf) PutIgmpDevice(ctx context.Context, mvlan of.VlanType, gid string, gip net.IP, device, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutIgmpDevice", ctx, mvlan, gid, gip, device, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutIgmpDevice indicates an expected call of PutIgmpDevice.
+func (mr *MockDBIntfMockRecorder) PutIgmpDevice(ctx, mvlan, gid, gip, device, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutIgmpDevice", reflect.TypeOf((*MockDBIntf)(nil).PutIgmpDevice), ctx, mvlan, gid, gip, device, value)
+}
+
+// PutIgmpGroup mocks base method.
+func (m *MockDBIntf) PutIgmpGroup(ctx context.Context, id, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutIgmpGroup", ctx, id, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutIgmpGroup indicates an expected call of PutIgmpGroup.
+func (mr *MockDBIntfMockRecorder) PutIgmpGroup(ctx, id, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutIgmpGroup", reflect.TypeOf((*MockDBIntf)(nil).PutIgmpGroup), ctx, id, value)
+}
+
+// PutIgmpProfile mocks base method.
+func (m *MockDBIntf) PutIgmpProfile(ctx context.Context, name, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutIgmpProfile", ctx, name, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutIgmpProfile indicates an expected call of PutIgmpProfile.
+func (mr *MockDBIntfMockRecorder) PutIgmpProfile(ctx, name, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutIgmpProfile", reflect.TypeOf((*MockDBIntf)(nil).PutIgmpProfile), ctx, name, value)
+}
+
+// PutIgmpRcvr mocks base method.
+func (m *MockDBIntf) PutIgmpRcvr(ctx context.Context, mvlan of.VlanType, gip net.IP, device, rcvr, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutIgmpRcvr", ctx, mvlan, gip, device, rcvr, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutIgmpRcvr indicates an expected call of PutIgmpRcvr.
+func (mr *MockDBIntfMockRecorder) PutIgmpRcvr(ctx, mvlan, gip, device, rcvr, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutIgmpRcvr", reflect.TypeOf((*MockDBIntf)(nil).PutIgmpRcvr), ctx, mvlan, gip, device, rcvr, value)
+}
+
+// PutMcastConfig mocks base method.
+func (m *MockDBIntf) PutMcastConfig(ctx context.Context, name, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutMcastConfig", ctx, name, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutMcastConfig indicates an expected call of PutMcastConfig.
+func (mr *MockDBIntfMockRecorder) PutMcastConfig(ctx, name, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMcastConfig", reflect.TypeOf((*MockDBIntf)(nil).PutMcastConfig), ctx, name, value)
+}
+
+// PutMeter mocks base method.
+func (m *MockDBIntf) PutMeter(ctx context.Context, name, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutMeter", ctx, name, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutMeter indicates an expected call of PutMeter.
+func (mr *MockDBIntfMockRecorder) PutMeter(ctx, name, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMeter", reflect.TypeOf((*MockDBIntf)(nil).PutMeter), ctx, name, value)
+}
+
+// PutMigrateServicesReq mocks base method.
+func (m *MockDBIntf) PutMigrateServicesReq(ctx context.Context, deviceID, vlan, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutMigrateServicesReq", ctx, deviceID, vlan, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutMigrateServicesReq indicates an expected call of PutMigrateServicesReq.
+func (mr *MockDBIntfMockRecorder) PutMigrateServicesReq(ctx, deviceID, vlan, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMigrateServicesReq", reflect.TypeOf((*MockDBIntf)(nil).PutMigrateServicesReq), ctx, deviceID, vlan, value)
+}
+
+// PutMigrationInfo mocks base method.
+func (m *MockDBIntf) PutMigrationInfo(ctx context.Context, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutMigrationInfo", ctx, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutMigrationInfo indicates an expected call of PutMigrationInfo.
+func (mr *MockDBIntfMockRecorder) PutMigrationInfo(ctx, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMigrationInfo", reflect.TypeOf((*MockDBIntf)(nil).PutMigrationInfo), ctx, value)
+}
+
+// PutMvlan mocks base method.
+func (m *MockDBIntf) PutMvlan(ctx context.Context, mvlan uint16, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutMvlan", ctx, mvlan, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutMvlan indicates an expected call of PutMvlan.
+func (mr *MockDBIntfMockRecorder) PutMvlan(ctx, mvlan, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMvlan", reflect.TypeOf((*MockDBIntf)(nil).PutMvlan), ctx, mvlan, value)
+}
+
+// PutNbDevicePort mocks base method.
+func (m *MockDBIntf) PutNbDevicePort(ctx context.Context, device string, ponPortID uint32, value string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PutNbDevicePort", ctx, device, ponPortID, value)
+}
+
+// PutNbDevicePort indicates an expected call of PutNbDevicePort.
+func (mr *MockDBIntfMockRecorder) PutNbDevicePort(ctx, device, ponPortID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutNbDevicePort", reflect.TypeOf((*MockDBIntf)(nil).PutNbDevicePort), ctx, device, ponPortID, value)
+}
+
+// PutOlt mocks base method.
+func (m *MockDBIntf) PutOlt(ctx context.Context, deviceID, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutOlt", ctx, deviceID, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutOlt indicates an expected call of PutOlt.
+func (mr *MockDBIntfMockRecorder) PutOlt(ctx, deviceID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutOlt", reflect.TypeOf((*MockDBIntf)(nil).PutOlt), ctx, deviceID, value)
+}
+
+// PutOltFlowService mocks base method.
+func (m *MockDBIntf) PutOltFlowService(ctx context.Context, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutOltFlowService", ctx, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutOltFlowService indicates an expected call of PutOltFlowService.
+func (mr *MockDBIntfMockRecorder) PutOltFlowService(ctx, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutOltFlowService", reflect.TypeOf((*MockDBIntf)(nil).PutOltFlowService), ctx, value)
+}
+
+// PutOltIgmpCounters mocks base method.
+func (m *MockDBIntf) PutOltIgmpCounters(ctx context.Context, device, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutOltIgmpCounters", ctx, device, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutOltIgmpCounters indicates an expected call of PutOltIgmpCounters.
+func (mr *MockDBIntfMockRecorder) PutOltIgmpCounters(ctx, device, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutOltIgmpCounters", reflect.TypeOf((*MockDBIntf)(nil).PutOltIgmpCounters), ctx, device, value)
+}
+
+// PutPonChannelCounter mocks base method.
+func (m *MockDBIntf) PutPonChannelCounter(ctx context.Context, device, ponID, channel, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutPonChannelCounter", ctx, device, ponID, channel, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutPonChannelCounter indicates an expected call of PutPonChannelCounter.
+func (mr *MockDBIntfMockRecorder) PutPonChannelCounter(ctx, device, ponID, channel, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPonChannelCounter", reflect.TypeOf((*MockDBIntf)(nil).PutPonChannelCounter), ctx, device, ponID, channel, value)
+}
+
+// PutPonCounter mocks base method.
+func (m *MockDBIntf) PutPonCounter(ctx context.Context, device, ponID, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutPonCounter", ctx, device, ponID, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutPonCounter indicates an expected call of PutPonCounter.
+func (mr *MockDBIntfMockRecorder) PutPonCounter(ctx, device, ponID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPonCounter", reflect.TypeOf((*MockDBIntf)(nil).PutPonCounter), ctx, device, ponID, value)
+}
+
+// PutPort mocks base method.
+func (m *MockDBIntf) PutPort(ctx context.Context, deviceID string, portID uint32, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutPort", ctx, deviceID, portID, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutPort indicates an expected call of PutPort.
+func (mr *MockDBIntfMockRecorder) PutPort(ctx, deviceID, portID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPort", reflect.TypeOf((*MockDBIntf)(nil).PutPort), ctx, deviceID, portID, value)
+}
+
+// PutPortAlarmData mocks base method.
+func (m *MockDBIntf) PutPortAlarmData(ctx context.Context, deviceID string, portID uint32, value string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PutPortAlarmData", ctx, deviceID, portID, value)
+}
+
+// PutPortAlarmData indicates an expected call of PutPortAlarmData.
+func (mr *MockDBIntfMockRecorder) PutPortAlarmData(ctx, deviceID, portID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPortAlarmData", reflect.TypeOf((*MockDBIntf)(nil).PutPortAlarmData), ctx, deviceID, portID, value)
+}
+
+// PutPortAlarmProfile mocks base method.
+func (m *MockDBIntf) PutPortAlarmProfile(ctx context.Context, portAlarmProfileID, value string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PutPortAlarmProfile", ctx, portAlarmProfileID, value)
+}
+
+// PutPortAlarmProfile indicates an expected call of PutPortAlarmProfile.
+func (mr *MockDBIntfMockRecorder) PutPortAlarmProfile(ctx, portAlarmProfileID, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPortAlarmProfile", reflect.TypeOf((*MockDBIntf)(nil).PutPortAlarmProfile), ctx, portAlarmProfileID, value)
+}
+
+// PutService mocks base method.
+func (m *MockDBIntf) PutService(ctx context.Context, name, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutService", ctx, name, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutService indicates an expected call of PutService.
+func (mr *MockDBIntfMockRecorder) PutService(ctx, name, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutService", reflect.TypeOf((*MockDBIntf)(nil).PutService), ctx, name, value)
+}
+
+// PutServiceChannelCounter mocks base method.
+func (m *MockDBIntf) PutServiceChannelCounter(ctx context.Context, serviceName, channel, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutServiceChannelCounter", ctx, serviceName, channel, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutServiceChannelCounter indicates an expected call of PutServiceChannelCounter.
+func (mr *MockDBIntfMockRecorder) PutServiceChannelCounter(ctx, serviceName, channel, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutServiceChannelCounter", reflect.TypeOf((*MockDBIntf)(nil).PutServiceChannelCounter), ctx, serviceName, channel, value)
+}
+
+// PutSubAlarmData mocks base method.
+func (m *MockDBIntf) PutSubAlarmData(ctx context.Context, deviceID, portName, value string) {
+ m.ctrl.T.Helper()
+ m.ctrl.Call(m, "PutSubAlarmData", ctx, deviceID, portName, value)
+}
+
+// PutSubAlarmData indicates an expected call of PutSubAlarmData.
+func (mr *MockDBIntfMockRecorder) PutSubAlarmData(ctx, deviceID, portName, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutSubAlarmData", reflect.TypeOf((*MockDBIntf)(nil).PutSubAlarmData), ctx, deviceID, portName, value)
+}
+
+// PutVnet mocks base method.
+func (m *MockDBIntf) PutVnet(ctx context.Context, name, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutVnet", ctx, name, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutVnet indicates an expected call of PutVnet.
+func (mr *MockDBIntfMockRecorder) PutVnet(ctx, name, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutVnet", reflect.TypeOf((*MockDBIntf)(nil).PutVnet), ctx, name, value)
+}
+
+// PutVpv mocks base method.
+func (m *MockDBIntf) PutVpv(ctx context.Context, port string, SVlan, CVlan, UniVlan uint16, value string) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PutVpv", ctx, port, SVlan, CVlan, UniVlan, value)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PutVpv indicates an expected call of PutVpv.
+func (mr *MockDBIntfMockRecorder) PutVpv(ctx, port, SVlan, CVlan, UniVlan, value interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutVpv", reflect.TypeOf((*MockDBIntf)(nil).PutVpv), ctx, port, SVlan, CVlan, UniVlan, value)
+}