VOL-1494: Support for adding multiple logical uni
Also error handling in ofagent and system-test
now starts onos. Needed to update proto for ofagent
Change-Id: I0d061edc9f1bdac6ebaf7b2e9254e8ea69b3b2d5
diff --git a/compose/system-test.yml b/compose/system-test.yml
index f44ac73..9ab55ac 100644
--- a/compose/system-test.yml
+++ b/compose/system-test.yml
@@ -134,6 +134,21 @@
restart: unless-stopped
+ onos:
+ image: "voltha/voltha-onos:latest"
+ ports:
+ - "8101:8101" # ssh
+ - "6653:6653" # OF
+ - "8181:8181" # UI
+ environment:
+ ONOS_APPS: 'drivers,openflow-base'
+ volumes:
+ - "/var/run/docker.sock:/tmp/docker.sock"
+ networks:
+ - default
+ restart: unless-stopped
+
+
adapter_openolt:
image: "${REGISTRY}${REPOSITORY}voltha-openolt-adapter${TAG}"
logging:
diff --git a/protos/logical_device.proto b/protos/logical_device.proto
index b8d424f..54b9e02 100644
--- a/protos/logical_device.proto
+++ b/protos/logical_device.proto
@@ -22,6 +22,7 @@
string device_id = 3;
uint32 device_port_no = 4;
bool root_port = 5;
+ openflow_13.ofp_port_stats ofp_port_stats = 6;
}
message LogicalPorts {
diff --git a/python/ofagent/of_protocol_handler.py b/python/ofagent/of_protocol_handler.py
index 8d09461..604ce3c 100755
--- a/python/ofagent/of_protocol_handler.py
+++ b/python/ofagent/of_protocol_handler.py
@@ -263,11 +263,14 @@
@inlineCallbacks
def handle_port_desc_request(self, req):
port_list = yield self.rpc.get_port_list(self.device_id)
- self.cxn.send(ofp.message.port_desc_stats_reply(
- xid=req.xid,
- #flags=None,
- entries=[to_loxi(port.ofp_port) for port in port_list]
- ))
+ try:
+ self.cxn.send(ofp.message.port_desc_stats_reply(
+ xid=req.xid,
+ #flags=None,
+ entries=[to_loxi(port.ofp_port) for port in port_list]
+ ))
+ except Exception as err:
+ log.exception('failed-port-desc-reply', err=err)
def handle_queue_stats_request(self, req):
raise NotImplementedError()
diff --git a/rw_core/core/logical_device_agent.go b/rw_core/core/logical_device_agent.go
index 4a0488a..e4e855b 100644
--- a/rw_core/core/logical_device_agent.go
+++ b/rw_core/core/logical_device_agent.go
@@ -1319,10 +1319,8 @@
} else {
log.Debugw("adding-uni", log.Fields{"deviceId": childDevice.Id})
portCap.Port.RootPort = false
- //TODO: For now use the channel id assigned by the OLT as logical port number
- lPortNo := childDevice.ProxyAddress.ChannelId
- portCap.Port.Id = fmt.Sprintf("uni-%d", lPortNo)
- portCap.Port.OfpPort.PortNo = lPortNo
+ portCap.Port.Id = port.Label
+ portCap.Port.OfpPort.PortNo = port.PortNo
portCap.Port.OfpPort.Name = portCap.Port.Id
portCap.Port.DeviceId = childDevice.Id
portCap.Port.DevicePortNo = port.PortNo