[cert] THCI: enhance firmware validation (#2797)

This commit is contained in:
rongli
2018-06-18 11:23:41 -07:00
committed by Jonathan Hui
parent eb4fcff15f
commit 3e0f0b25f4
+13 -1
View File
@@ -53,6 +53,10 @@ class OpenThread(IThci):
LOWEST_POSSIBLE_PARTATION_ID = 0x1
LINK_QUALITY_CHANGE_TIME = 100
# Used for reference firmware version control for Test Harness.
# This variable will be updated to match the OpenThread reference firmware officially released.
firmwarePrefix = "OPENTHREAD/201806"
#def __init__(self, SerialPort=COMPortName, EUI=MAC_Address):
def __init__(self, **kwargs):
"""initialize the serial port and default network parameters
@@ -647,9 +651,17 @@ class OpenThread(IThci):
"""initialize the serial port with baudrate, timeout parameters"""
print '%s call intialize' % self.port
try:
self.deviceConnected = False
# init serial port
self._connect()
self.deviceConnected = True
if self.firmwarePrefix in self.UIStatusMsg:
self.deviceConnected = True
else:
self.UIStatusMsg = "Firmware Not Matching Expecting " + self.firmwarePrefix + " Now is " + self.UIStatusMsg
ModuleHelper.WriteIntoDebugLogger("Err: OpenThread device Firmware not matching..")
except Exception, e:
ModuleHelper.WriteIntoDebugLogger("intialize() Error: " + str(e))
self.deviceConnected = False