[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:
Simon Lin
2020-09-11 08:56:53 -07:00
committed by GitHub
parent d251a743fc
commit 8b842d39a6
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -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)