VOL-3121 - Removing usage of device.Ports
Changed device.Ports usages to GetDevicePort() and ListDevicePorts()
Added port type filter to PortsStateUpdate()
Change-Id: I4fab819a909379ee71e70eb48ac44044e9810185
diff --git a/internal/pkg/core/openolt_test.go b/internal/pkg/core/openolt_test.go
index 764cb20..a2ac77b 100644
--- a/internal/pkg/core/openolt_test.go
+++ b/internal/pkg/core/openolt_test.go
@@ -25,6 +25,10 @@
import (
"context"
"errors"
+ "reflect"
+ "sync"
+ "testing"
+
com "github.com/opencord/voltha-lib-go/v3/pkg/adapters/common"
fu "github.com/opencord/voltha-lib-go/v3/pkg/flows"
"github.com/opencord/voltha-lib-go/v3/pkg/kafka"
@@ -35,9 +39,6 @@
"github.com/opencord/voltha-protos/v3/go/openflow_13"
ofp "github.com/opencord/voltha-protos/v3/go/openflow_13"
"github.com/opencord/voltha-protos/v3/go/voltha"
- "reflect"
- "sync"
- "testing"
)
// mocks the OpenOLT struct.
@@ -81,14 +82,10 @@
// mockDevice mocks Device.
func mockDevice() *voltha.Device {
- device := &voltha.Device{
+ return &voltha.Device{
Id: "olt",
Root: true,
ParentId: "logical_device",
- Ports: []*voltha.Port{
- {PortNo: 1, Label: "pon"},
- {PortNo: 2, Label: "nni"},
- },
ProxyAddress: &voltha.Device_ProxyAddress{
DeviceId: "olt",
DeviceType: "onu",
@@ -97,7 +94,6 @@
},
ConnectStatus: 1,
}
- return device
}
func TestNewOpenOLT(t *testing.T) {