VOL-3121 - Separated out logical ports from logical agent.
Similar to flows/groups/meters.
Also modified device_route tests to generate unique port IDs (`.OfpPort.PortNo`s) across all UNI ports withing each test, i.e. within an OLT.
Also replaced logicalPortsNo map & associated NNI vs UNI logic with root device checks.
Change-Id: Ib0cecbf7d4f8d509ce7c989b9ccf697c8b0d17d6
diff --git a/tests/core/api/grpc_nbi_api_handler_client_test.go b/tests/core/api/grpc_nbi_api_handler_client_test.go
index ac9da6c..53dcd07 100644
--- a/tests/core/api/grpc_nbi_api_handler_client_test.go
+++ b/tests/core/api/grpc_nbi_api_handler_client_test.go
@@ -361,7 +361,9 @@
for _, ld := range lresponse.Items {
logicalDevices[ld.Id] = ld
// Ensure each logical device have two ports
- assert.Equal(t, 2, len(ld.Ports))
+ ports, err := stub.ListLogicalDevicePorts(ctx, &voltha.ID{Id: ld.Id})
+ assert.Nil(t, err)
+ assert.Equal(t, 2, len(ports.Items))
}
//7. Disable all ONUs & check status & check logical device
@@ -399,7 +401,9 @@
for _, ld := range lresponse.Items {
logicalDevices[ld.Id] = ld
// Ensure each logical device have one port - only olt port
- assert.Equal(t, 1, len(ld.Ports))
+ ports, err := stub.ListLogicalDevicePorts(ctx, &common.ID{Id: ld.Id})
+ assert.Nil(t, err)
+ assert.Equal(t, 1, len(ports.Items))
}
//8. Enable all ONUs & check status & check logical device