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/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):