mirror of
https://github.com/espressif/openthread.git
synced 2026-09-10 19:20:06 +00:00
[thci] add delay to joinNetwork and ping (#4319)
Recent updates to the Thread Group Test Harness have caused 5.2.3, 5.5.2 tests to fail. This commit: - adds more delay interval to address the Test Harness' change in delays - merge Test Harness' OpenThread THCI change for updateRouterStatus The reduction in ping delay and joinNetwork delay have caused test 5.5.2 to fail by side affects described in DEV-2008. Even though it is a Test Harness validation issue rather than an OpenThread THCI issue, we increase the ping & joinNetwork delay so that we have a more stable regression environment. Both 5.2.3 and 5.5.2 pass on Harness 2.0.0 with this commit.
This commit is contained in:
@@ -69,6 +69,8 @@ class OpenThread(IThci):
|
||||
# officially released.
|
||||
firmwarePrefix = 'OPENTHREAD/'
|
||||
|
||||
_update_router_status = False
|
||||
|
||||
# def __init__(self, SerialPort=COMPortName, EUI=MAC_Address):
|
||||
def __init__(self, **kwargs):
|
||||
"""initialize the serial port and default network parameters
|
||||
@@ -1086,6 +1088,11 @@ class OpenThread(IThci):
|
||||
self.__startOpenThread()
|
||||
time.sleep(3)
|
||||
|
||||
if self._update_router_status and eRoleId == Thread_Device_Role.Router:
|
||||
self.__updateRouterStatus()
|
||||
|
||||
time.sleep(5) # increase delay temporally (+5s) to remedy TH's delay updates
|
||||
|
||||
return True
|
||||
except Exception as e:
|
||||
ModuleHelper.WriteIntoDebugLogger('joinNetwork() Error: ' + str(e))
|
||||
@@ -1186,7 +1193,7 @@ class OpenThread(IThci):
|
||||
self._sendline(cmd)
|
||||
self._expect(cmd)
|
||||
# wait echo reply
|
||||
time.sleep(1)
|
||||
time.sleep(6) # increase delay temporally (+5s) to remedy TH's delay updates
|
||||
except Exception as e:
|
||||
ModuleHelper.WriteIntoDebugLogger('ping() Error: ' + str(e))
|
||||
|
||||
@@ -2817,6 +2824,9 @@ class OpenThread(IThci):
|
||||
|
||||
def updateRouterStatus(self):
|
||||
"""force update to router as if there is child id request"""
|
||||
self._update_router_status = True
|
||||
|
||||
def __updateRouterStatus(self):
|
||||
print('%s call updateRouterStatus' % self.port)
|
||||
cmd = 'state'
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user