opticalUtils advertises correct port types
This should proactively prevent linc-OE from misbehaving if support for changing
port type through the network config system is added.
Change-Id: I80667f0292922eca37a51f3e461b6745ecbf9d46
diff --git a/core/net/src/main/java/org/onosproject/net/device/impl/OpticalPortOperator.java b/core/net/src/main/java/org/onosproject/net/device/impl/OpticalPortOperator.java
index 19377cf..8f60149 100644
--- a/core/net/src/main/java/org/onosproject/net/device/impl/OpticalPortOperator.java
+++ b/core/net/src/main/java/org/onosproject/net/device/impl/OpticalPortOperator.java
@@ -112,10 +112,10 @@
return new OduCltPortDescription(port, odu.isEnabled(), odu.signalType(), sa);
case PACKET:
case FIBER:
+ case COPPER:
return new DefaultPortDescription(port, descr.isEnabled(), descr.type(),
descr.portSpeed(), sa);
default:
- // this includes copper ports.
log.warn("Unsupported optical port type {} - can't update", descr.type());
return descr;
}
diff --git a/tools/test/topos/opticalUtils.py b/tools/test/topos/opticalUtils.py
index a1ae834..5d955e5 100644
--- a/tools/test/topos/opticalUtils.py
+++ b/tools/test/topos/opticalUtils.py
@@ -344,7 +344,10 @@
continue
portDict = {}
portDict[ 'port' ] = port
- portDict[ 'type' ] = 'FIBER' if isinstance(intf.link, LINCLink) else 'COPPER'
+ portType = 'COPPER'
+ if isinstance(intf.link, LINCLink):
+ portType = 'OCH' if intf.link.isCrossConnect else 'OMS'
+ portDict[ 'type' ] = portType
intfList = [ intf.link.intf1, intf.link.intf2 ]
intfList.remove(intf)
portDict[ 'speed' ] = intfList[ 0 ].speed if isinstance(intf.link, LINCLink) else 0
@@ -787,7 +790,10 @@
configDict = {}
configDict[ 'port' ] = self.port
configDict[ 'speed' ] = self.speed
- configDict[ 'type' ] = 'FIBER'
+ portType = 'COPPER'
+ if isinstance(self.link, LINCLink):
+ portType = 'OCH' if self.link.isCrossConnect else 'OMS'
+ configDict[ 'type' ] = portType
return configDict
def config(self, *args, **kwargs):