mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 18:20:06 +00:00
[test] add test_key_rotation_and_key_guard_time (#9906)
- Validates that key guard time is updated to 93% of key rotation time when it changes. - Checks for proper key sequence updates after key rotation expiration. - Confirms key guard mechanism blocks key sequence increments while mesh nodes staying connected.
This commit is contained in:
@@ -1700,6 +1700,10 @@ class NodeImpl:
|
||||
self.send_command(cmd)
|
||||
self._expect_done()
|
||||
|
||||
def get_key_switch_guardtime(self):
|
||||
self.send_command('keysequence guardtime')
|
||||
return int(self._expect_result(r'\d+'))
|
||||
|
||||
def set_key_switch_guardtime(self, key_switch_guardtime):
|
||||
cmd = 'keysequence guardtime %d' % key_switch_guardtime
|
||||
self.send_command(cmd)
|
||||
@@ -2683,7 +2687,7 @@ class NodeImpl:
|
||||
self.send_command('dataset commit pending')
|
||||
self._expect_done()
|
||||
|
||||
def start_dataset_updater(self, panid=None, channel=None):
|
||||
def start_dataset_updater(self, panid=None, channel=None, security_policy=None, delay=None):
|
||||
self.send_command('dataset clear')
|
||||
self._expect_done()
|
||||
|
||||
@@ -2697,6 +2701,18 @@ class NodeImpl:
|
||||
self.send_command(cmd)
|
||||
self._expect_done()
|
||||
|
||||
if security_policy is not None:
|
||||
cmd = 'dataset securitypolicy %d %s ' % (security_policy[0], security_policy[1])
|
||||
if (len(security_policy) >= 3):
|
||||
cmd += '%d ' % (security_policy[2])
|
||||
self.send_command(cmd)
|
||||
self._expect_done()
|
||||
|
||||
if delay is not None:
|
||||
cmd = 'dataset delay %d ' % delay
|
||||
self.send_command(cmd)
|
||||
self._expect_done()
|
||||
|
||||
self.send_command('dataset updater start')
|
||||
self._expect_done()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user