vgc unit tests part 2

Change-Id: Iec7e27c73f90b5d40d36b52a4b71e97cf166798c
diff --git a/internal/pkg/application/application_test.go b/internal/pkg/application/application_test.go
index ca2e2b9..7670e3b 100644
--- a/internal/pkg/application/application_test.go
+++ b/internal/pkg/application/application_test.go
@@ -34,6 +34,8 @@
 	"go.uber.org/atomic"
 )
 
+var test_data = "1234"
+
 func TestVoltApplication_RestoreNbDeviceFromDb(t *testing.T) {
 	type args struct {
 		cntx     context.Context
@@ -424,7 +426,7 @@
 	}
 	macAdd, _ := net.ParseMAC("ff:ff:ff:ff:ff:ff")
 	macPort := map[string]string{}
-	macPort[macAdd.String()] = "1234"
+	macPort[macAdd.String()] = test_data
 	tests := []struct {
 		name string
 		args args
@@ -433,7 +435,7 @@
 			name: "Positive_Case_UpdateMacInPortMap",
 			args: args{
 				macAddr: macAdd,
-				port:    "1234",
+				port:    test_data,
 			},
 		},
 	}
@@ -453,7 +455,7 @@
 	}
 	macAdd, _ := net.ParseMAC("ff:ff:ff:ff:ff:ff")
 	macPort := map[string]string{}
-	macPort[macAdd.String()] = "1234"
+	macPort[macAdd.String()] = test_data
 	tests := []struct {
 		name string
 		args args
@@ -464,7 +466,7 @@
 			args: args{
 				macAddr: macAdd,
 			},
-			want: "1234",
+			want: test_data,
 		},
 	}
 	for _, tt := range tests {
@@ -2375,3 +2377,323 @@
 		})
 	}
 }
+
+func TestVoltApplication_GetDeviceFromPort(t *testing.T) {
+	type args struct {
+		port string
+	}
+	voltDev := &VoltDevice{
+		Name:           "SDX6320031",
+		SerialNum:      "SDX6320031",
+		NniDhcpTrapVid: 123,
+		NniPort:        "16777216",
+		SouthBoundID:   "49686e2d-618f-4e8e-bca0-442ab850a63a",
+		Ports:          sync.Map{},
+	}
+	voltPort := &VoltPort{
+		Name:                     "16777216",
+		Device:                   "SDX6320031",
+		ID:                       16777216,
+		State:                    PortStateDown,
+		ChannelPerSubAlarmRaised: false,
+		Type:                     VoltPortTypeNni,
+	}
+	tests := []struct {
+		name    string
+		args    args
+		want    *VoltDevice
+		wantErr bool
+	}{
+		{
+			name: "Positive_Case_GetDeviceFromPort",
+			args: args{
+				port: "16777216",
+			},
+			want:    voltDev,
+			wantErr: false,
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				DevicesDisc: sync.Map{},
+				PortsDisc:   sync.Map{},
+			}
+			va.PortsDisc.Store("16777216", voltPort)
+			va.DevicesDisc.Store("SDX6320031", voltDev)
+			got, err := va.GetDeviceFromPort(tt.args.port)
+			if (err != nil) != tt.wantErr {
+				t.Errorf("VoltApplication.GetDeviceFromPort() error = %v, wantErr %v", err, tt.wantErr)
+				return
+			}
+			if !reflect.DeepEqual(got, tt.want) {
+				t.Errorf("VoltApplication.GetDeviceFromPort() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
+
+func TestVoltApplication_GetPortID(t *testing.T) {
+	type args struct {
+		port string
+	}
+	voltPort := &VoltPort{
+		Name:                     "16777216",
+		Device:                   "SDX6320031",
+		ID:                       16777216,
+		State:                    PortStateDown,
+		ChannelPerSubAlarmRaised: false,
+		Type:                     VoltPortTypeNni,
+	}
+	tests := []struct {
+		name    string
+		args    args
+		want    uint32
+		wantErr bool
+	}{
+		{
+			name: "Positive_Case_GetPortID",
+			args: args{
+				port: "16777216",
+			},
+			want:    16777216,
+			wantErr: false,
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				PortsDisc: sync.Map{},
+			}
+			va.PortsDisc.Store("16777216", voltPort)
+			got, err := va.GetPortID(tt.args.port)
+			if (err != nil) != tt.wantErr {
+				t.Errorf("VoltApplication.GetPortID() error = %v, wantErr %v", err, tt.wantErr)
+				return
+			}
+			if got != tt.want {
+				t.Errorf("VoltApplication.GetPortID() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
+
+func TestVoltApplication_GetPortName(t *testing.T) {
+	type args struct {
+		port uint32
+	}
+	voltPort := &VoltPort{
+		Name:                     "16777216",
+		Device:                   "SDX6320031",
+		ID:                       16777216,
+		State:                    PortStateDown,
+		ChannelPerSubAlarmRaised: false,
+		Type:                     VoltPortTypeNni,
+	}
+	tests := []struct {
+		name    string
+		args    args
+		want    string
+		wantErr bool
+	}{
+		{
+			name: "Positive_Case_GetPortID",
+			args: args{
+				port: 16777216,
+			},
+			want:    "16777216",
+			wantErr: false,
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				PortsDisc: sync.Map{},
+			}
+			va.PortsDisc.Store("16777216", voltPort)
+			got, err := va.GetPortName(tt.args.port)
+			if (err != nil) != tt.wantErr {
+				t.Errorf("VoltApplication.GetPortName() error = %v, wantErr %v", err, tt.wantErr)
+				return
+			}
+			if got != tt.want {
+				t.Errorf("VoltApplication.GetPortName() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
+
+func TestVoltApplication_PortUpInd(t *testing.T) {
+	type args struct {
+		cntx   context.Context
+		device string
+		port   string
+	}
+	voltDev := &VoltDevice{
+		Name:           "SDX6320031",
+		SerialNum:      "SDX6320031",
+		NniDhcpTrapVid: 123,
+		NniPort:        "16777472",
+		SouthBoundID:   "49686e2d-618f-4e8e-bca0-442ab850a63a",
+		Ports:          sync.Map{},
+		VpvsBySvlan:    util.NewConcurrentMap(),
+	}
+	voltPort := &VoltPort{
+		Name:                     "16777472",
+		Device:                   "SDX6320031",
+		ID:                       16777472,
+		State:                    PortStateUp,
+		ChannelPerSubAlarmRaised: false,
+		Type:                     VoltPortTypeNni,
+	}
+	voltServ := &VoltService{
+		VoltServiceOper: VoltServiceOper{
+			Device: "SDX6320031",
+		},
+		VoltServiceCfg: VoltServiceCfg{
+			IsActivated: true,
+		},
+	}
+	voltPortVnets := make([]*VoltPortVnet, 0)
+	voltPortVnet := &VoltPortVnet{
+		Device:           "SDX6320031",
+		Port:             "16777472",
+		DeleteInProgress: false,
+		services:         sync.Map{},
+		SVlan:            4096,
+		CVlan:            2310,
+		UniVlan:          4096,
+		SVlanTpid:        65,
+		servicesCount:    atomic.NewUint64(1),
+	}
+	voltPortVnets = append(voltPortVnets, voltPortVnet)
+
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "Positive_Case_PortUpInd",
+			args: args{
+				cntx:   context.Background(),
+				port:   "16777472",
+				device: "SDX6320031",
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				DevicesDisc: sync.Map{},
+				VnetsByPort: sync.Map{},
+			}
+			va.DevicesDisc.Store("SDX6320031", voltDev)
+			voltDev.Ports.Store("16777472", voltPort)
+			va.VnetsByPort.Store("16777472", voltPortVnets)
+			voltPortVnet.services.Store("SDX6320031-1_SDX6320031-1-4096-2310-4096-65", voltServ)
+			voltapp := GetApplication()
+			voltapp.DevicesDisc.Store("SDX6320031", voltDev)
+			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).AnyTimes()
+			va.PortUpInd(tt.args.cntx, tt.args.device, tt.args.port)
+		})
+	}
+}
+
+func TestVoltApplication_PortDownInd(t *testing.T) {
+	type args struct {
+		cntx   context.Context
+		device string
+		port   string
+	}
+	voltDev := &VoltDevice{
+		Name:           "SDX6320031",
+		SerialNum:      "SDX6320031",
+		NniDhcpTrapVid: 123,
+		NniPort:        "16777472",
+		SouthBoundID:   "49686e2d-618f-4e8e-bca0-442ab850a63a",
+		Ports:          sync.Map{},
+		VpvsBySvlan:    util.NewConcurrentMap(),
+	}
+	voltPort := &VoltPort{
+		Name:                     "16777472",
+		Device:                   "SDX6320031",
+		ID:                       16777472,
+		State:                    PortStateDown,
+		ChannelPerSubAlarmRaised: false,
+		Type:                     VoltPortTypeNni,
+	}
+	voltPortVnets := make([]*VoltPortVnet, 0)
+	voltPortVnet := &VoltPortVnet{
+		Device:           "SDX6320031",
+		Port:             "16777472",
+		DeleteInProgress: false,
+		services:         sync.Map{},
+		SVlan:            4096,
+		CVlan:            2310,
+		UniVlan:          4096,
+		SVlanTpid:        65,
+		servicesCount:    atomic.NewUint64(1),
+	}
+	voltPortVnets = append(voltPortVnets, voltPortVnet)
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "Positive_Case_PortDownInd",
+			args: args{
+				cntx:   context.Background(),
+				port:   "16777472",
+				device: "SDX6320031",
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{}
+			va.DevicesDisc.Store("SDX6320031", voltDev)
+			voltDev.Ports.Store("16777472", voltPort)
+			va.VnetsByPort.Store("16777472", voltPortVnets)
+			voltApp := GetApplication()
+			voltApp.DevicesDisc.Store("SDX6320031", voltDev)
+			va.PortDownInd(tt.args.cntx, tt.args.device, tt.args.port)
+		})
+	}
+}
+
+func TestVoltApplication_UpdateDeviceSerialNumberList(t *testing.T) {
+	type args struct {
+		oldOltSlNo string
+		newOltSlNo string
+	}
+	voltDev := &VoltDevice{
+		Name:           "49686e2d-618f-4e8e-bca0",
+		SerialNum:      "SDX6320031",
+		NniDhcpTrapVid: 123,
+		NniPort:        "16777472",
+		SouthBoundID:   "49686e2d-618f-4e8e-bca0-442ab850a63a",
+		Ports:          sync.Map{},
+		VpvsBySvlan:    util.NewConcurrentMap(),
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "Positive_Case_UpdateDeviceSerialNumberList",
+			args: args{
+				oldOltSlNo: "SDX6320030",
+				newOltSlNo: "SDX6320031",
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{}
+			va.DevicesDisc.Store("SDX6320031", voltDev)
+			va.UpdateDeviceSerialNumberList(tt.args.oldOltSlNo, tt.args.newOltSlNo)
+		})
+	}
+}
diff --git a/internal/pkg/application/pppoeia_test.go b/internal/pkg/application/pppoeia_test.go
new file mode 100644
index 0000000..45b76fa
--- /dev/null
+++ b/internal/pkg/application/pppoeia_test.go
@@ -0,0 +1,266 @@
+/*
+* 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"
+	"net"
+	"sync"
+	"testing"
+	cntlr "voltha-go-controller/internal/pkg/controller"
+	"voltha-go-controller/internal/pkg/of"
+	"voltha-go-controller/internal/test/mocks"
+
+	"github.com/golang/mock/gomock"
+	"github.com/google/gopacket"
+	"github.com/google/gopacket/layers"
+	"github.com/stretchr/testify/assert"
+)
+
+var eth = &layers.Ethernet{
+	SrcMAC:       layers.EthernetBroadcast,
+	DstMAC:       layers.EthernetBroadcast,
+	EthernetType: layers.EthernetTypeARP,
+	Length:       uint16(1),
+}
+var dot1Q = &layers.Dot1Q{
+	Priority:     uint8(1),
+	DropEligible: true,
+	Type:         layers.EthernetTypeARP,
+}
+var LayerTypeDot2Q = []gopacket.Layer{
+	dot1Q,
+}
+
+func TestPppoeIaPacketTask_Start(t *testing.T) {
+	type args struct {
+		ctx    context.Context
+		taskID uint8
+	}
+	tests := []struct {
+		name    string
+		args    args
+		wantErr bool
+	}{
+		{
+			name: "PppoeIaPacketTask_Start",
+			args: args{
+				ctx:    context.Background(),
+				taskID: EtherType8100,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			pppoe := &layers.PPPoE{
+				Version: uint8(1),
+			}
+			pkt := mocks.NewMockPacket(gomock.NewController(t))
+			var dpt = &PppoeIaPacketTask{
+				pkt: pkt,
+			}
+			pkt.EXPECT().Layer(layers.LayerTypePPPoE).Return(pppoe).Times(2)
+			pkt.EXPECT().Layer(layers.LayerTypeEthernet).Return(eth).Times(1)
+			pkt.EXPECT().Layer(layers.LayerTypeDot1Q).Return(dot1Q).Times(1)
+			pkt.EXPECT().Layers().Return(LayerTypeDot2Q).Times(1)
+			err := dpt.Start(tt.args.ctx, tt.args.taskID)
+			assert.Nil(t, err)
+		})
+	}
+}
+
+func TestVoltApplication_ProcessPPPoEIaPacket(t *testing.T) {
+	type args struct {
+		cntx   context.Context
+		device string
+		port   string
+		pkt    gopacket.Packet
+	}
+	pkt := mocks.NewMockPacket(gomock.NewController(t))
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "ProcessPPPoEIaPacket_ProcessUsPppoeIaPacket",
+			args: args{
+				cntx:   context.Background(),
+				device: test_device,
+				port:   "test_port",
+				pkt:    pkt,
+			},
+		},
+		{
+			name: "pppoel_nil",
+			args: args{
+				cntx:   context.Background(),
+				device: test_device,
+				port:   "test_port",
+				pkt:    pkt,
+			},
+		},
+		{
+			name: "pppoel_invalidType",
+			args: args{
+				cntx:   context.Background(),
+				device: test_device,
+				port:   "test_port",
+				pkt:    pkt,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{}
+			// dot1Q := &layers.Dot1Q{
+			// 	Priority:     uint8(1),
+			// 	DropEligible: true,
+			// 	Type:         layers.EthernetTypeARP,
+			// }
+			// LayerTypeDot2Q := []gopacket.Layer{
+			// 	dot1Q,
+			// }
+			ga := GetApplication()
+			switch tt.name {
+			case "ProcessPPPoEIaPacket_ProcessUsPppoeIaPacket":
+				ga.DevicesDisc.Store(test_device, voltDevice)
+				pkt.EXPECT().Layer(layers.LayerTypePPPoE).Return(&layers.PPPoE{
+					Version: uint8(1),
+				}).Times(1)
+				pkt.EXPECT().Layers().Return(LayerTypeDot2Q).Times(2)
+				va.ProcessPPPoEIaPacket(tt.args.cntx, tt.args.device, tt.args.port, tt.args.pkt)
+			case "pppoel_nil":
+				pkt.EXPECT().Layer(layers.LayerTypePPPoE).Return(nil).Times(1)
+				va.ProcessPPPoEIaPacket(tt.args.cntx, tt.args.device, tt.args.port, tt.args.pkt)
+			case "pppoel_invalidType":
+				pkt.EXPECT().Layer(layers.LayerTypePPPoE).Return(&layers.ARP{}).Times(1)
+				va.ProcessPPPoEIaPacket(tt.args.cntx, tt.args.device, tt.args.port, tt.args.pkt)
+			}
+		})
+	}
+}
+
+func TestVoltApplication_ProcessUsPppoeIaPacket(t *testing.T) {
+	type args struct {
+		cntx   context.Context
+		device string
+		port   string
+		pkt    gopacket.Packet
+	}
+	pkt := mocks.NewMockPacket(gomock.NewController(t))
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "VoltApplication_ProcessUsPppoeIaPacket",
+			args: args{
+				cntx:   context.Background(),
+				device: test_device,
+				port:   "test_port",
+				pkt:    pkt,
+			},
+		},
+	}
+	macAdd, _ := net.ParseMAC("ff:ff:ff:ff:ff:ff")
+	macPort := map[string]string{}
+	macPort[macAdd.String()] = test_data
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				macPortMap:  macPort,
+				VnetsByPort: sync.Map{},
+				DevicesDisc: sync.Map{},
+			}
+			voltServ := &VoltService{
+				VoltServiceOper: VoltServiceOper{
+					Device: "SDX6320031",
+				},
+				VoltServiceCfg: VoltServiceCfg{
+					IsActivated: true,
+					Pbits:       []of.PbitType{PbitMatchAll},
+				},
+			}
+			switch tt.name {
+			case "VoltApplication_ProcessUsPppoeIaPacket":
+				va.DevicesDisc.Store(test_device, voltDevice)
+				pkt.EXPECT().Layers().Return(LayerTypeDot2Q).Times(3)
+				voltPortVnet1[0].SVlan = 0
+				voltDevice.NniPort = "1"
+				va.VnetsByPort.Store("test_port", voltPortVnet1)
+				voltPortVnet1[0].PppoeIa = true
+				voltPortVnet1[0].AllowTransparent = true
+				voltPortVnet1[0].Port = test_data
+				pendingDeleteFlow := map[string]bool{}
+				pendingDeleteFlow["test_cookie"] = true
+				voltPortVnet1[0].PendingDeleteFlow = pendingDeleteFlow
+				dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+				db = dbintf
+				eth.SrcMAC = layers.EthernetBroadcast
+				dbintf.EXPECT().PutVpv(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).Times(1)
+				voltPortVnet1[0].services.Store("SDX6320031-1_SDX6320031-1-4096-2310-4096-65", voltServ)
+				pkt.EXPECT().Layer(layers.LayerTypeEthernet).Return(eth).Times(2)
+				pkt.EXPECT().Layer(layers.LayerTypePPPoE).Return(&layers.PPPoE{
+					Version: uint8(1),
+					Code:    layers.PPPoECodePADI,
+				}).Times(1)
+				pkt.EXPECT().Layer(layers.LayerTypeDot1Q).Return(dot1Q).Times(1)
+				_ = cntlr.NewController(context.Background(), mocks.NewMockApp(gomock.NewController(t)))
+				va.ProcessUsPppoeIaPacket(tt.args.cntx, tt.args.device, tt.args.port, tt.args.pkt)
+			}
+		})
+	}
+}
+
+func TestVoltApplication_ProcessDsPppoeIaPacket(t *testing.T) {
+	type args struct {
+		cntx   context.Context
+		device string
+		port   string
+		pkt    gopacket.Packet
+	}
+	pkt := mocks.NewMockPacket(gomock.NewController(t))
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "VoltApplication_ProcessDsPppoeIaPacket",
+			args: args{
+				cntx:   context.Background(),
+				device: test_device,
+				port:   "test_port",
+				pkt:    pkt,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{}
+			pkt.EXPECT().Layer(layers.LayerTypeEthernet).Return(eth).Times(1)
+			pkt.EXPECT().Layer(layers.LayerTypePPPoE).Return(&layers.PPPoE{
+				Version: uint8(1),
+				Code:    layers.PPPoECodePADI,
+			}).Times(1)
+			pkt.EXPECT().Layer(layers.LayerTypeDot1Q).Return(dot1Q).Times(1)
+			pkt.EXPECT().Layers().Return(LayerTypeDot2Q).Times(3)
+			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)
+			va.ProcessDsPppoeIaPacket(tt.args.cntx, tt.args.device, tt.args.port, tt.args.pkt)
+		})
+	}
+}
diff --git a/internal/pkg/application/service_test.go b/internal/pkg/application/service_test.go
index b9c458b..c687e55 100644
--- a/internal/pkg/application/service_test.go
+++ b/internal/pkg/application/service_test.go
@@ -19,6 +19,8 @@
 	"context"
 	"encoding/json"
 	"errors"
+	"net"
+	"reflect"
 	"sync"
 	"testing"
 	"voltha-go-controller/internal/pkg/controller"
@@ -48,8 +50,9 @@
 }
 
 var voltMeter = &VoltMeter{
-	Name:    "test_volt_meter",
-	Version: "test_version",
+	Name:               "test_volt_meter",
+	Version:            "test_version",
+	AssociatedServices: 3,
 }
 
 var voltVnet = &VoltVnet{
@@ -74,6 +77,26 @@
 	State: cntlr.DeviceStateDOWN,
 }
 
+var voltDevice2 = &VoltDevice{
+	Name:              "test_name",
+	State:             controller.DeviceStateUP,
+	FlowAddEventMap:   util.NewConcurrentMap(),
+	FlowDelEventMap:   util.NewConcurrentMap(),
+	SerialNum:         "test_serial_number",
+	MigratingServices: util.NewConcurrentMap(),
+}
+
+var voltService2 = &VoltService{
+	Version: "test_version",
+	VoltServiceCfg: VoltServiceCfg{
+		VnetID:  "test_vnet_id",
+		Port:    "test_port",
+		SVlan:   of.VlanAny,
+		CVlan:   of.VlanAny,
+		UniVlan: of.VlanAny,
+	},
+}
+
 var GetDeviceFromPort_error = "GetDeviceFromPort_error"
 
 func TestVoltApplication_RestoreSvcsFromDb(t *testing.T) {
@@ -105,7 +128,7 @@
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			voltService := &VoltService{
+			voltService4 := &VoltService{
 				VoltServiceOper: VoltServiceOper{
 					Device:           "SDX6320031",
 					ForceDelete:      true,
@@ -116,7 +139,7 @@
 				},
 			}
 			serviceToDelete := map[string]bool{}
-			serviceToDelete[voltService.VoltServiceCfg.Name] = true
+			serviceToDelete[voltService4.VoltServiceCfg.Name] = true
 			va := &VoltApplication{
 				ServicesToDelete: serviceToDelete,
 			}
@@ -125,7 +148,7 @@
 			switch tt.name {
 			case "VoltApplication_RestoreSvcsFromDb":
 
-				b, err := json.Marshal(voltService)
+				b, err := json.Marshal(voltService4)
 				if err != nil {
 					panic(err)
 				}
@@ -441,6 +464,19 @@
 				serviceMigration: true,
 			},
 		},
+		{
+			name: "GetMeterByID_not_nil",
+			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) {
@@ -448,7 +484,7 @@
 				ServiceByName: sync.Map{},
 				VnetsByPort:   sync.Map{},
 			}
-			voltService := &VoltService{
+			voltService3 := &VoltService{
 				Version: "test_version",
 				VoltServiceCfg: VoltServiceCfg{
 					Port:    "4096-4096-4096",
@@ -457,13 +493,30 @@
 					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)
+			switch tt.name {
+			case "VoltApplication_DelService":
+				va.ServiceByName.Store(tt.args.name, voltService3)
+				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)
+			case "GetMeterByID_not_nil":
+				va.ServiceByName.Store(tt.args.name, voltService3)
+				va.VnetsByPort.Store("4096-4096-4096", voltPortVnet1)
+				voltService3.AggDsMeterID = uint32(1)
+				voltService3.DsMeterID = uint32(1)
+				voltService3.UsMeterID = uint32(2)
+				va.MeterMgr.MetersByID.Store(voltService3.AggDsMeterID, voltMeter)
+				va.MeterMgr.MetersByID.Store(voltService3.DsMeterID, voltMeter)
+				va.MeterMgr.MetersByID.Store(voltService3.UsMeterID, voltMeter)
+				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)
+			}
 		})
 	}
 }
@@ -910,7 +963,7 @@
 			name: "VoltApplication_ActivateService",
 			args: args{
 				cntx:     context.Background(),
-				deviceID: "test_name",
+				deviceID: DeviceAny,
 				portNo:   "test_port",
 				sVlan:    of.VlanNone,
 				cVlan:    of.VlanAny,
@@ -939,6 +992,28 @@
 				tpID:     AnyVlan,
 			},
 		},
+		{
+			name: "deviceID != device.Name",
+			args: args{
+				cntx:     context.Background(),
+				deviceID: "test_name1",
+				portNo:   "test_port",
+				sVlan:    of.VlanNone,
+				cVlan:    of.VlanAny,
+				tpID:     AnyVlan,
+			},
+		},
+		{
+			name: "sVlan != of.VlanNone && sVlan != vs.SVlan",
+			args: args{
+				cntx:     context.Background(),
+				deviceID: "test_name",
+				portNo:   "test_port",
+				sVlan:    1,
+				cVlan:    of.VlanAny,
+				tpID:     AnyVlan,
+			},
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
@@ -992,6 +1067,31 @@
 			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)
+			case "deviceID != device.Name":
+				var voltPortTest1 = &VoltPort{
+					Name:   "test_name",
+					State:  PortStateUp,
+					Device: test_device,
+				}
+				var voltDevice_test = &VoltDevice{
+					Name:            "",
+					State:           controller.DeviceStateUP,
+					FlowAddEventMap: util.NewConcurrentMap(),
+					FlowDelEventMap: util.NewConcurrentMap(),
+					SerialNum:       "test_serial_number",
+				}
+				va.PortsDisc.Store("test_port", voltPortTest1)
+				va.DevicesDisc.Store(test_device, voltDevice_test)
+				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)
+			case "sVlan != of.VlanNone && sVlan != vs.SVlan":
+				voltPortTest.Device = test_device
+				va.PortsDisc.Store("test_port", voltPortTest)
+				va.DevicesDisc.Store(test_device, voltDevice)
+				va.ServiceByName.Store("test_name", voltServiceTest)
+				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)
+				}
 			}
 		})
 	}
@@ -1522,6 +1622,16 @@
 			},
 			want: false,
 		},
+		{
+			name: "nvs.IsOption82Enabled != evs.IsOption82Enabled",
+			args: args{
+				evs: &VoltServiceCfg{
+					IsOption82Enabled: true,
+				},
+				nvs: &VoltServiceCfg{},
+			},
+			want: false,
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
@@ -1542,7 +1652,8 @@
 				"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":
+				"nvs.MaxDataRateUs != evs.MaxDataRateUs", "nvs.MaxDataRateDs != evs.MaxDataRateDs",
+				"nvs.IsOption82Enabled != evs.IsOption82Enabled":
 				if got := va.DeepEqualServicecfg(tt.args.evs, tt.args.nvs); got != tt.want {
 					t.Errorf("VoltApplication.DeepEqualServicecfg() = %v, want %v", got, tt.want)
 				}
@@ -1550,3 +1661,1414 @@
 		})
 	}
 }
+
+func Test_forceUpdateAllServices(t *testing.T) {
+	type args struct {
+		cntx context.Context
+		msr  *MigrateServicesRequest
+	}
+	servicesList := map[string]bool{}
+	servicesList[test_device] = true
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "forceUpdateAllServices",
+			args: args{
+				cntx: context.Background(),
+				msr: &MigrateServicesRequest{
+					ID:           "test_id",
+					ServicesList: servicesList,
+					DeviceID:     test_device,
+				},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			ga := GetApplication()
+			dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+			db = dbintf
+			dbintf.EXPECT().DelMigrateServicesReq(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+			ga.ServiceByName.Store(test_device, voltService2)
+			voltService2.VoltServiceOper.Metadata = &MigrateServiceMetadata{
+				NewVnetID: "test_new_vnet_id",
+				RequestID: "test_request_id",
+			}
+			newConcurrentMap := util.NewConcurrentMap()
+			ga.DevicesDisc.Store(test_device, voltDevice2)
+			voltDevice2.MigratingServices.Set("test_vnet_id", newConcurrentMap)
+			migrateServicesRequest := &MigrateServicesRequest{
+				ID:           "test_id",
+				ServicesList: servicesList,
+			}
+			newConcurrentMap.Set("test_request_id", migrateServicesRequest)
+			dbintf.EXPECT().PutMigrateServicesReq(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+			forceUpdateAllServices(tt.args.cntx, tt.args.msr)
+		})
+	}
+}
+
+func TestVoltService_updateVnetProfile(t *testing.T) {
+	type args struct {
+		cntx     context.Context
+		deviceID string
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "DeleteInProgress_true",
+			args: args{
+				cntx:     context.Background(),
+				deviceID: test_device,
+			},
+		},
+		{
+			name: "metadata_nil",
+			args: args{
+				cntx:     context.Background(),
+				deviceID: test_device,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			switch tt.name {
+			case "DeleteInProgress_true":
+				vs := &VoltService{
+					VoltServiceOper: VoltServiceOper{
+						DeleteInProgress: true,
+					},
+				}
+				vs.updateVnetProfile(tt.args.cntx, tt.args.deviceID)
+			case "metadata_nil":
+				vs := &VoltService{
+					VoltServiceOper: VoltServiceOper{
+						Metadata: &MigrateServiceMetadata{},
+					},
+				}
+				vs.updateVnetProfile(tt.args.cntx, tt.args.deviceID)
+			}
+		})
+	}
+}
+
+func TestMigrateServicesRequest_serviceMigrated(t *testing.T) {
+	type args struct {
+		cntx        context.Context
+		serviceName string
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "ServicesList_nil",
+			args: args{
+				cntx:        context.Background(),
+				serviceName: "test_service_name",
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			msr := &MigrateServicesRequest{
+				ServicesList: map[string]bool{},
+			}
+			dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+			db = dbintf
+			dbintf.EXPECT().DelMigrateServicesReq(gomock.All(), gomock.Any(), gomock.Any()).Return(nil).Times(1)
+			msr.serviceMigrated(tt.args.cntx, tt.args.serviceName)
+		})
+	}
+}
+
+func TestVoltApplication_TriggerPendingMigrateServicesReq(t *testing.T) {
+	type args struct {
+		cntx   context.Context
+		device string
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "VoltApplication_TriggerPendingMigrateServicesReq",
+			args: args{
+				cntx:   context.Background(),
+				device: test_device,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				ServiceByName: sync.Map{},
+			}
+			migrateServicesRequest := &MigrateServicesRequest{
+				ID:        "test_id",
+				OldVnetID: "test_vnet_id",
+				DeviceID:  test_device,
+			}
+			b, err := json.Marshal(migrateServicesRequest)
+			if err != nil {
+				panic(err)
+			}
+			kvpair := map[string]*kvstore.KVPair{}
+			kvpair["test_device_id"] = &kvstore.KVPair{
+				Key:   "test_device_id",
+				Value: b,
+			}
+
+			dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+			db = dbintf
+			ga := GetApplication()
+			ga.DevicesDisc.Store(test_device, voltDevice2)
+			newConcurrentMap := util.NewConcurrentMap()
+			voltDevice2.MigratingServices.Set("test_vnet_id", newConcurrentMap)
+			dbintf.EXPECT().GetAllMigrateServicesReq(gomock.Any(), gomock.Any()).Return(kvpair, nil).AnyTimes()
+			va.TriggerPendingMigrateServicesReq(tt.args.cntx, tt.args.device)
+		})
+	}
+}
+
+func TestVoltApplication_FetchAndProcessAllMigrateServicesReq(t *testing.T) {
+	type args struct {
+		cntx      context.Context
+		device    string
+		msrAction func(context.Context, *MigrateServicesRequest)
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "invalid_value_type",
+			args: args{
+				cntx:      context.Background(),
+				device:    test_device,
+				msrAction: func(ctx context.Context, msr *MigrateServicesRequest) {},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				DevicesDisc: sync.Map{},
+			}
+			dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+			db = dbintf
+			kvpair := map[string]*kvstore.KVPair{}
+			kvpair["test_device_id"] = &kvstore.KVPair{
+				Key:   "test_device_id",
+				Value: "invalid_value",
+			}
+			dbintf.EXPECT().GetAllMigrateServicesReq(gomock.Any(), gomock.Any()).Return(kvpair, nil).AnyTimes()
+			va.FetchAndProcessAllMigrateServicesReq(tt.args.cntx, tt.args.device, tt.args.msrAction)
+		})
+	}
+}
+
+func TestVoltApplication_createMigrateServicesFromString(t *testing.T) {
+	type args struct {
+		b []byte
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "Unmarshal_error",
+			args: args{
+				b: []byte{},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				vendorID: test_device,
+			}
+			got := va.createMigrateServicesFromString(tt.args.b)
+			assert.NotNil(t, got)
+		})
+	}
+}
+
+func TestVoltApplication_getMigrateServicesRequest(t *testing.T) {
+	type args struct {
+		deviceID  string
+		oldVnetID string
+		requestID string
+	}
+	tests := []struct {
+		name string
+		args args
+		want *MigrateServicesRequest
+	}{
+		{
+			name: "GetDevice_nil",
+			args: args{
+				deviceID: test_device,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				vendorID: "vendorID",
+			}
+			if got := va.getMigrateServicesRequest(tt.args.deviceID, tt.args.oldVnetID, tt.args.requestID); !reflect.DeepEqual(got, tt.want) {
+				t.Errorf("VoltApplication.getMigrateServicesRequest() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
+
+func TestVoltDevice_AddMigratingServices(t *testing.T) {
+	type args struct {
+		msr *MigrateServicesRequest
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "MigratingServices_Get_nil",
+			args: args{
+				msr: &MigrateServicesRequest{
+					ID: "test_id",
+				},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			d := &VoltDevice{
+				MigratingServices: util.NewConcurrentMap(),
+			}
+			d.AddMigratingServices(tt.args.msr)
+		})
+	}
+}
+
+func TestMigrateServicesRequest_ProcessMigrateServicesProfRequest(t *testing.T) {
+	type args struct {
+		cntx context.Context
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "ServicesList_true",
+			args: args{
+				cntx: context.Background(),
+			},
+		},
+		{
+			name: "ServicesList_false",
+			args: args{
+				cntx: context.Background(),
+			},
+		},
+		{
+			name: "GetVnetByPort_nil",
+			args: args{
+				cntx: context.Background(),
+			},
+		},
+		{
+			name: "UsHSIAFlowsApplied_true",
+			args: args{
+				cntx: context.Background(),
+			},
+		},
+		{
+			name: "ServiceByName_nil",
+			args: args{
+				cntx: context.Background(),
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+			db = dbintf
+			switch tt.name {
+			case "ServicesList_true":
+				servicesList := map[string]bool{}
+				servicesList[test_device] = true
+				msr := &MigrateServicesRequest{
+					ServicesList: servicesList,
+				}
+				dbintf.EXPECT().DelMigrateServicesReq(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+				msr.ProcessMigrateServicesProfRequest(tt.args.cntx)
+			case "ServicesList_false":
+				servicesList := map[string]bool{}
+				servicesList[test_device] = false
+				msr := &MigrateServicesRequest{
+					ServicesList: servicesList,
+				}
+				ga := GetApplication()
+				ga.ServiceByName.Store(test_device, voltService2)
+				ga.VnetsByPort.Store("test_port", voltPortVnet1)
+				msr.ProcessMigrateServicesProfRequest(tt.args.cntx)
+			case "GetVnetByPort_nil":
+				servicesList := map[string]bool{}
+				servicesList[test_device] = false
+				msr := &MigrateServicesRequest{
+					ServicesList: servicesList,
+				}
+				ga := GetApplication()
+				var voltService1 = &VoltService{
+					Version: "test_version",
+					VoltServiceCfg: VoltServiceCfg{
+						VnetID:  "test_vnet_id",
+						SVlan:   of.VlanAny,
+						CVlan:   of.VlanAny,
+						UniVlan: of.VlanAny,
+					},
+				}
+				ga.ServiceByName.Store(test_device, voltService1)
+				ga.VnetsByPort.Store("test_port1", nil)
+				msr.ProcessMigrateServicesProfRequest(tt.args.cntx)
+			case "UsHSIAFlowsApplied_true":
+				servicesList := map[string]bool{}
+				servicesList[test_device] = false
+				msr := &MigrateServicesRequest{
+					ServicesList: servicesList,
+				}
+				ga := GetApplication()
+				voltService2.UsHSIAFlowsApplied = true
+				ga.ServiceByName.Store(test_device, voltService2)
+				ga.VnetsByPort.Store("test_port", voltPortVnet1)
+				dbintf.EXPECT().PutVpv(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+				dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+				msr.ProcessMigrateServicesProfRequest(tt.args.cntx)
+			case "ServiceByName_nil":
+				servicesList := map[string]bool{}
+				servicesList[""] = false
+				msr := &MigrateServicesRequest{
+					ServicesList: servicesList,
+				}
+				msr.ProcessMigrateServicesProfRequest(tt.args.cntx)
+			}
+		})
+	}
+}
+
+func TestVoltApplication_MigrateServices(t *testing.T) {
+	type args struct {
+		cntx        context.Context
+		serialNum   string
+		reqID       string
+		oldVnetID   string
+		newVnetID   string
+		serviceList []string
+	}
+	tests := []struct {
+		name    string
+		args    args
+		wantErr bool
+	}{
+		{
+			name: "VoltApplication_MigrateServices",
+			args: args{
+				cntx:        context.Background(),
+				serialNum:   "test_serial_number",
+				reqID:       "test_reqid",
+				oldVnetID:   "test_old_vnet_id",
+				newVnetID:   "test_new_vnet_id",
+				serviceList: []string{"test_service_list_1", "test_service_list_2"},
+			},
+		},
+		{
+			name: "Old Vnet Id not found",
+			args: args{
+				cntx:        context.Background(),
+				serialNum:   "test_serial_number",
+				reqID:       "test_reqid",
+				oldVnetID:   "",
+				newVnetID:   "test_new_vnet_id",
+				serviceList: []string{"test_service_list_1", "test_service_list_2"},
+			},
+		},
+		{
+			name: "New Vnet Id not found",
+			args: args{
+				cntx:        context.Background(),
+				serialNum:   "test_serial_number",
+				reqID:       "test_reqid",
+				oldVnetID:   "test_old_vnet_id",
+				newVnetID:   "",
+				serviceList: []string{"test_service_list_1", "test_service_list_2"},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				VnetsByName: sync.Map{},
+			}
+			voltVnet2 := &VoltVnet{
+				Version: "v3",
+				VnetConfig: VnetConfig{
+					Name:      "2310-4096-4096",
+					VnetType:  "Encapsulation",
+					SVlan:     2310,
+					CVlan:     4096,
+					UniVlan:   4096,
+					SVlanTpid: 33024,
+				},
+				VnetOper: VnetOper{
+					PendingDeviceToDelete: "SDX63200313",
+				},
+			}
+			switch tt.name {
+			case "VoltApplication_MigrateServices":
+				va.VnetsByName.Store("test_old_vnet_id", voltVnet2)
+				va.VnetsByName.Store("test_new_vnet_id", voltVnet2)
+				va.DevicesDisc.Store(test_device, voltDevice2)
+				dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+				db = dbintf
+				dbintf.EXPECT().PutMigrateServicesReq(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+				if err := va.MigrateServices(tt.args.cntx, tt.args.serialNum, tt.args.reqID, tt.args.oldVnetID, tt.args.newVnetID, tt.args.serviceList); (err != nil) != tt.wantErr {
+					t.Errorf("VoltApplication.MigrateServices() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "Old Vnet Id not found":
+				va.VnetsByName.Store("test_old_vnet_id", voltVnet2)
+				err := va.MigrateServices(tt.args.cntx, tt.args.serialNum, tt.args.reqID, tt.args.oldVnetID, tt.args.newVnetID, tt.args.serviceList)
+				assert.NotNil(t, err)
+			case "New Vnet Id not found":
+				va.VnetsByName.Store("test_old_vnet_id", voltVnet2)
+				va.VnetsByName.Store("test_new_vnet_id", voltVnet2)
+				err := va.MigrateServices(tt.args.cntx, tt.args.serialNum, tt.args.reqID, tt.args.oldVnetID, tt.args.newVnetID, tt.args.serviceList)
+				assert.NotNil(t, err)
+			}
+		})
+	}
+}
+
+func TestMigrateServicesRequest_WriteToDB(t *testing.T) {
+	type args struct {
+		cntx context.Context
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "PutMigrateServicesReq_error",
+			args: args{
+				cntx: context.Background(),
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			msr := &MigrateServicesRequest{
+				ID: test_device,
+			}
+			dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+			db = dbintf
+			dbintf.EXPECT().PutMigrateServicesReq(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(errors.New("error")).Times(1)
+			msr.WriteToDB(tt.args.cntx)
+		})
+	}
+}
+
+func TestVoltService_MatchesVlans(t *testing.T) {
+	type args struct {
+		vlans []of.VlanType
+	}
+	tests := []struct {
+		name string
+		args args
+		want bool
+	}{
+		{
+			name: "vlans_nil",
+			args: args{
+				vlans: []of.VlanType{},
+			},
+			want: false,
+		},
+		{
+			name: "MatchesVlans",
+			args: args{
+				vlans: []of.VlanType{
+					of.VlanAny,
+				},
+			},
+			want: true,
+		},
+		{
+			name: "vlans[0] != vs.CVlan",
+			args: args{
+				vlans: []of.VlanType{
+					of.VlanNone,
+				},
+			},
+			want: false,
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{
+				VoltServiceCfg: VoltServiceCfg{CVlan: of.VlanAny},
+			}
+			switch tt.name {
+			case "vlans_nil", "MatchesVlans", "vlans[0] != vs.CVlan":
+				if got := vs.MatchesVlans(tt.args.vlans); got != tt.want {
+					t.Errorf("VoltService.MatchesVlans() = %v, want %v", got, tt.want)
+				}
+			}
+		})
+	}
+}
+
+func TestVoltService_MatchesPbits(t *testing.T) {
+	type args struct {
+		pbits []of.PbitType
+	}
+	tests := []struct {
+		name string
+		args args
+		want bool
+	}{
+		{
+			name: "VoltService_MatchesPbits",
+			args: args{
+				pbits: []of.PbitType{
+					of.PbitMatchAll,
+				},
+			},
+			want: true,
+		},
+		{
+			name: "PbitType_nil",
+			args: args{
+				pbits: []of.PbitType{},
+			},
+			want: false,
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{
+				VoltServiceCfg: VoltServiceCfg{
+					Pbits: []of.PbitType{
+						of.PbitMatchAll,
+					},
+				},
+			}
+			switch tt.name {
+			case "VoltService_MatchesPbits", "PbitType_nil":
+				if got := vs.MatchesPbits(tt.args.pbits); got != tt.want {
+					t.Errorf("VoltService.MatchesPbits() = %v, want %v", got, tt.want)
+				}
+			}
+		})
+	}
+}
+
+func TestVoltApplication_DelServiceWithPrefix(t *testing.T) {
+	type args struct {
+		cntx   context.Context
+		prefix string
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "VoltApplication_DelServiceWithPrefix",
+			args: args{
+				cntx:   context.Background(),
+				prefix: test_device,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			va := &VoltApplication{
+				VnetsBySvlan: util.NewConcurrentMap(),
+			}
+			va.ServiceByName.Store(test_device, voltService)
+			va.VnetsByName.Store("0-0-0", voltVnet)
+			dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+			db = dbintf
+			dbintf.EXPECT().PutVnet(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).Times(1)
+			cuncurrentMap := &util.ConcurrentMap{
+				Count: atomic.NewUint64(0),
+			}
+			va.VnetsBySvlan.Set(of.VlanAny, cuncurrentMap)
+			dbintf.EXPECT().DelVnet(gomock.Any(), gomock.Any()).Return(nil).Times(1)
+			va.DelServiceWithPrefix(tt.args.cntx, tt.args.prefix)
+		})
+	}
+}
+
+func TestVoltService_FlowInstallFailure(t *testing.T) {
+	type args struct {
+		cookie    string
+		errorCode uint32
+		errReason string
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "VoltService_FlowInstallFailure",
+			args: args{
+				cookie:    "test_cookie",
+				errorCode: uint32(1),
+				errReason: "err_reason",
+			},
+		},
+		{
+			name: "PendingFlows[cookie]_false",
+			args: args{
+				cookie:    "test_cookie",
+				errorCode: uint32(1),
+				errReason: "err_reason",
+			},
+		},
+	}
+	pendingFlows := map[string]bool{}
+	pendingFlows["test_cookie"] = true
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{
+				VoltServiceOper: VoltServiceOper{},
+			}
+			switch tt.name {
+			case "VoltService_FlowInstallFailure":
+				vs.PendingFlows = pendingFlows
+				vs.FlowInstallFailure(tt.args.cookie, tt.args.errorCode, tt.args.errReason)
+			case "PendingFlows[cookie]_false":
+				vs.FlowInstallFailure(tt.args.cookie, tt.args.errorCode, tt.args.errReason)
+			}
+		})
+	}
+}
+
+func TestVoltService_FlowRemoveSuccess(t *testing.T) {
+	type args struct {
+		cntx   context.Context
+		cookie string
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "GetDevice != nil",
+			args: args{
+				cntx:   context.Background(),
+				cookie: "test_cookie",
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{
+				VoltServiceOper: VoltServiceOper{
+					Device: test_device,
+				},
+			}
+			ga := GetApplication()
+			ga.DevicesDisc.Store(test_device, voltDevice2)
+			voltDevice2.State = controller.DeviceStateUP
+			dbintf := mocks.NewMockDBIntf(gomock.NewController(t))
+			db = dbintf
+			dbintf.EXPECT().PutService(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
+			vs.FlowRemoveSuccess(tt.args.cntx, tt.args.cookie)
+		})
+	}
+}
+
+func TestVoltService_setDSMatchActionVlanT0(t *testing.T) {
+	type args struct {
+		flow *of.VoltSubFlow
+	}
+	tests := []struct {
+		name    string
+		args    args
+		wantErr bool
+	}{
+		{
+			name: "VlanControl: ONUCVlanOLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: OLTCVlanOLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: ONUCVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: OLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: OLTSVlan && UniVlan != of.VlanAny",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "invalid VlanControl",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{
+				VoltServiceCfg: VoltServiceCfg{
+					SVlan:       of.VlanAny,
+					UniVlan:     of.VlanAny,
+					VlanControl: ONUCVlanOLTSVlan,
+				},
+			}
+			switch tt.name {
+			case "VlanControl: ONUCVlanOLTSVlan":
+				vs.VlanControl = ONUCVlanOLTSVlan
+				if err := vs.setDSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: OLTCVlanOLTSVlan":
+				vs.VlanControl = OLTCVlanOLTSVlan
+				if err := vs.setDSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: ONUCVlan":
+				vs.VlanControl = ONUCVlan
+				if err := vs.setDSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: OLTSVlan":
+				vs.VlanControl = OLTSVlan
+				vs.UniVlan = vs.CVlan
+				if err := vs.setDSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: OLTSVlan && UniVlan != of.VlanAny":
+				vs.VlanControl = OLTSVlan
+				if err := vs.setDSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "invalid VlanControl":
+				vs.VlanControl = 5
+				err := vs.setDSMatchActionVlanT0(tt.args.flow)
+				assert.NotNil(t, err)
+			}
+		})
+	}
+}
+
+func TestVoltService_setUSMatchActionVlanT1(t *testing.T) {
+	type args struct {
+		flow *of.VoltSubFlow
+	}
+	tests := []struct {
+		name    string
+		args    args
+		wantErr bool
+	}{
+		{
+			name: "VlanControl: ONUCVlanOLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: OLTCVlanOLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: ONUCVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: OLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: OLTSVlan vs.UniVlan != of.VlanAny && vs.UniVlan != of.VlanNone",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: OLTSVlan vs.UniVlan == of.VlanNone",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "VlanControl: default",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{
+				VoltServiceCfg: VoltServiceCfg{
+					SVlan:       of.VlanAny,
+					UniVlan:     of.VlanAny,
+					VlanControl: ONUCVlanOLTSVlan,
+				},
+			}
+			switch tt.name {
+			case "VlanControl: ONUCVlanOLTSVlan":
+				vs.VlanControl = ONUCVlanOLTSVlan
+				if err := vs.setUSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: OLTCVlanOLTSVlan":
+				vs.VlanControl = OLTCVlanOLTSVlan
+				if err := vs.setUSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: ONUCVlan":
+				vs.VlanControl = ONUCVlan
+				if err := vs.setUSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: OLTSVlan":
+				vs.VlanControl = OLTSVlan
+				if err := vs.setUSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: OLTSVlan vs.UniVlan != of.VlanAny && vs.UniVlan != of.VlanNone":
+				vs.VlanControl = OLTSVlan
+				vs.UniVlan = vs.CVlan
+				if err := vs.setUSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: OLTSVlan vs.UniVlan == of.VlanNone":
+				vs.VlanControl = OLTSVlan
+				vs.UniVlan = of.VlanNone
+				if err := vs.setUSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "VlanControl: default":
+				vs.VlanControl = 6
+				err := vs.setUSMatchActionVlanT1(tt.args.flow)
+				assert.NotNil(t, err)
+			}
+		})
+	}
+}
+
+func TestVoltService_setUSMatchActionVlanT0(t *testing.T) {
+	type args struct {
+		flow *of.VoltSubFlow
+	}
+	tests := []struct {
+		name    string
+		args    args
+		wantErr bool
+	}{
+		{
+			name: "vs.VlanControl: ONUCVlanOLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: ONUCVlanOLTSVlan vs.UniVlan == of.VlanNone",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: OLTCVlanOLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: ONUCVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: ONUCVlan vs.UniVlan == of.VlanNone",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: OLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{}
+			switch tt.name {
+			case "vs.VlanControl: ONUCVlanOLTSVlan":
+				vs.VlanControl = ONUCVlanOLTSVlan
+				if err := vs.setUSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setUSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: ONUCVlanOLTSVlan vs.UniVlan == of.VlanNone":
+				vs.VlanControl = ONUCVlanOLTSVlan
+				vs.UniVlan = of.VlanNone
+				if err := vs.setUSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setUSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: OLTCVlanOLTSVlan":
+				vs.VlanControl = OLTCVlanOLTSVlan
+				if err := vs.setUSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setUSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: ONUCVlan":
+				vs.VlanControl = ONUCVlan
+				if err := vs.setUSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setUSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: ONUCVlan vs.UniVlan == of.VlanNone":
+				vs.VlanControl = ONUCVlan
+				vs.UniVlan = of.VlanNone
+				if err := vs.setUSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setUSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: OLTSVlan":
+				vs.VlanControl = OLTSVlan
+				if err := vs.setUSMatchActionVlanT0(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setUSMatchActionVlanT0() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			}
+		})
+	}
+}
+
+func TestVoltService_setDSMatchActionVlanT1(t *testing.T) {
+	type args struct {
+		flow *of.VoltSubFlow
+	}
+	tests := []struct {
+		name    string
+		args    args
+		wantErr bool
+	}{
+		{
+			name: "vs.VlanControl: ONUCVlanOLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: ONUCVlanOLTSVlan vs.UniVlan == of.VlanNone",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: OLTCVlanOLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: ONUCVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: ONUCVlan vs.UniVlan == of.VlanNone",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: OLTSVlan",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+		{
+			name: "vs.VlanControl: default",
+			args: args{
+				flow: &of.VoltSubFlow{
+					ErrorReason: "test_error_reason",
+					Cookie:      uint64(1),
+					OldCookie:   uint64(2),
+					TableID:     uint32(3),
+					Priority:    uint32(4),
+					State:       uint8(5),
+				},
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{}
+			switch tt.name {
+			case "vs.VlanControl: ONUCVlanOLTSVlan":
+				vs.VlanControl = ONUCVlanOLTSVlan
+				if err := vs.setDSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT1() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: ONUCVlanOLTSVlan vs.UniVlan == of.VlanNone":
+				vs.VlanControl = ONUCVlanOLTSVlan
+				vs.UniVlan = of.VlanNone
+				if err := vs.setDSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT1() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: OLTCVlanOLTSVlan":
+				vs.VlanControl = OLTCVlanOLTSVlan
+				if err := vs.setDSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT1() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: ONUCVlan":
+				vs.VlanControl = ONUCVlan
+				if err := vs.setDSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT1() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: ONUCVlan vs.UniVlan == of.VlanNone":
+				vs.VlanControl = ONUCVlan
+				vs.UniVlan = of.VlanNone
+				if err := vs.setDSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT1() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: OLTSVlan":
+				vs.VlanControl = OLTSVlan
+				if err := vs.setDSMatchActionVlanT1(tt.args.flow); (err != nil) != tt.wantErr {
+					t.Errorf("VoltService.setDSMatchActionVlanT1() error = %v, wantErr %v", err, tt.wantErr)
+				}
+			case "vs.VlanControl: default":
+				vs.VlanControl = 6
+				err := vs.setDSMatchActionVlanT1(tt.args.flow)
+				assert.NotNil(t, err)
+			}
+		})
+	}
+}
+
+func TestVoltService_SetIpv6Addr(t *testing.T) {
+	type args struct {
+		addr net.IP
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "SetIpv6Addr",
+			args: args{
+				addr: AllSystemsMulticastGroupIP,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{}
+			vs.SetIpv6Addr(tt.args.addr)
+		})
+	}
+}
+
+func TestVoltService_SetIpv4Addr(t *testing.T) {
+	type args struct {
+		addr net.IP
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "VoltService_SetIpv4Addr",
+			args: args{
+				addr: AllSystemsMulticastGroupIP,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{}
+			vs.SetIpv4Addr(tt.args.addr)
+		})
+	}
+}
+
+func TestVoltService_SetMacAddr(t *testing.T) {
+	type args struct {
+		addr net.HardwareAddr
+	}
+	tests := []struct {
+		name string
+		args args
+	}{
+		{
+			name: "VoltService_SetMacAddr",
+			args: args{
+				addr: BroadcastMAC,
+			},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{}
+			vs.SetMacAddr(tt.args.addr)
+		})
+	}
+}
+
+func TestVoltService_GetCircuitID(t *testing.T) {
+	tests := []struct {
+		name string
+		want []byte
+	}{
+		{
+			name: "VoltService_GetCircuitID",
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{}
+			_ = vs.GetCircuitID()
+		})
+	}
+}
+
+func TestVoltService_GetRemoteID(t *testing.T) {
+	tests := []struct {
+		name string
+		want []byte
+	}{
+		{
+			name: "VoltService_GetRemoteID",
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{}
+			_ = vs.GetRemoteID()
+		})
+	}
+}
+
+func TestVoltService_IPAssigned(t *testing.T) {
+	tests := []struct {
+		name string
+		want bool
+	}{
+		{
+			name: "VoltService_IPAssigned",
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			vs := &VoltService{}
+			_ = vs.IPAssigned()
+		})
+	}
+}