mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[cli] add lease info to srp server host and srp server service (#12589)
This commit adds lease and remaining lease information to the output of `srp server host` and `srp server service` CLI commands. The information includes: - `lease`: The total lease time in seconds. - `key-lease`: The total key lease time in seconds. - `remaining lease`: The remaining lease time in seconds (with millisecond precision). - `remaining key-lease`: The remaining key lease time in seconds (with millisecond precision). A new utility method `OutputMsecDurationInSec()` is added to `Utils` class to format durations in milliseconds as seconds with a fractional part. The SRP server host and service output parsers in `tests/scripts/thread-cert/node.py`, `tests/toranj/cli/cli.py`, and `tools/otci/otci/otci.py` are updated to correctly handle the new fields for both active and deleted entries.
This commit is contained in:
committed by
GitHub
parent
d5b5f863d7
commit
cf1d23c11e
@@ -1164,6 +1164,10 @@ class OTCI(object):
|
||||
|
||||
v = v[1:-1]
|
||||
info['addresses'] = list(map(Ip6Addr, v.split(', ')))
|
||||
|
||||
elif k in ('lease', 'key-lease', 'remaining lease', 'remaining key-lease'):
|
||||
info[k] = v
|
||||
|
||||
else:
|
||||
raise UnexpectedCommandOutput(output)
|
||||
|
||||
@@ -1195,6 +1199,8 @@ class OTCI(object):
|
||||
info[k] = list() if v == '(null)' else list(v.split(','))
|
||||
elif k in ('port', 'weight', 'priority', 'ttl', 'lease', 'key-lease'):
|
||||
info[k] = int(v)
|
||||
elif k in ('remaining lease', 'remaining key-lease'):
|
||||
info[k] = v
|
||||
elif k in ('host',):
|
||||
info[k] = v
|
||||
elif k == 'TXT':
|
||||
|
||||
Reference in New Issue
Block a user