mirror of
https://github.com/espressif/openthread.git
synced 2026-08-21 18:09:52 +00:00
[scripts] fix test_router_reattach (#5517)
Fix test_router_attach.py failing by a small chance. Root cause: routerdowngradethreshold restored back to default (23) after node reset, so the test had 5/120 chance to downgrade. We should set it back to 32 before starting it. This commit also enhances the test for a little bit: - Make sure the node reattached as Router within 1 second - Make sure the node does not downgrade after Router Selection Jitter (3s)
This commit is contained in:
@@ -771,6 +771,10 @@ class Node:
|
||||
self.send_command(cmd)
|
||||
self._expect('Done')
|
||||
|
||||
def get_router_downgrade_threshold(self) -> int:
|
||||
self.send_command('routerdowngradethreshold')
|
||||
return int(self._expect_result(r'\d+'))
|
||||
|
||||
def prefer_router_id(self, router_id):
|
||||
cmd = 'preferrouterid %d' % router_id
|
||||
self.send_command(cmd)
|
||||
|
||||
Reference in New Issue
Block a user