THCI used to catch Exceptions and print errors using
`ModuleHelper.WriteIntoDebugLogger`. However, in most of time it just
help hide the actual issue and make it harder to debug.
Re-raising the exceptions should be a better approach:
- @API decorator will print the full exception Traceback via
`ModuleHelper.WriteIntoDebugLogger` and then re-raise.
- THCI changes for bbr reset procedure to make a better effort to
reset and to also make sure to restart the otbr-agent prior to
attempting a factoryreset to cover the case where the agent cannot
currently communicate to the rcp.
- THCI change to move from sudo service restart otbr-agent to sudo
systemctl restart otbr-agent, which is more comprehensive.
- THCI changes for multicast to use ipmaddr in both soc and bbr cases.
During running T.1.1 tests with the T.1.2 capable sample it turned out
that 9.2.4 commissioner TC is not working when using the device that
is T.1.2 capable. The reason is that in MGMT_ACTIVE_SET
listSecurityPolicy list has only two elements and we are entering the
code, where we assume it is three element, which raises IndexError.
Previous approach with `dig` was not enough because it was only
parsing one mDNS response and not taking account that the response
could be from an inactive Border Router.
Use Python Zeroconf to properly parse all services.
In some cases the first element from the output from __executeCommand
might be empty line, which casues command failures like on below
trace:
__executeCommand('extaddr',) returns ['', '166e0a0000000001', '', 'Done']
FUNC getMAC failed: invalid literal for int() with base 16: ''
This commit filters out empty string from the result of
__executeCommand.
When the GRL starts, it calls initialize() reset() method on each
device. Reset method call fails due to missing (uninitialized)
attribute `isPowerDown`.
Some certification tests are failing because otbr-agent service is not
started back after calling powerDown (isPowerDown flag is kept False
and reset function fails on checking thread state - since the service
is stopped, we can't return status).
Also minor fixes for printing logs, disabling paramiko DEBUG level.
Avoid parsing responses for not expected cases.
Fixes some issues with Thread 1.2 certification test cases in which
it's not required to parse the mDNS response.
Some certification tests are failing because not enough delay is
applied after a Linux ping command is sent and the capture misses the
ICMP transaction.
Also removing unneeded check for Thread 1.2 harness version when
reconnecting to the serial port after a reset.
Modify `mdns_query` to accept a list of reference devices link local
addresses in order to discard their mDNS responses.
Also accept a service string to be used for the Thread 1.3
Certification program.
Return the DUT's Border Agent address and port.
This commit disallows concurrent commands.
With this commit, the CLI only execute a new command after it complete
the previous command. CLI can also prompt properly after the command
execution is done.
Other fixes and enhancements:
- Fixes premature command prompt
- Add ping async command for ping in async mode: output Done
immediately but print ping responses later on.
- Fixes networkdiagnostic get outputs multiple Done by always waiting
for 5 seconds.
We discovered that dns resolve takes a little longer i.e. 15sec to
finish (rather than default timeout of 10s). Thus using a larger
timeout for dns resolve (and other dns commands), e.g. 30s has helped.
This allows for registering a callback on all lines read from a
device, making it possible to react to output from asynchronous cli
commands while concurrently executing new commands on the same
device. Normally, executing those new commands would result in the
async command output being lost.
Known caveats:
1. The same limitations as with wait apply to OtbrSshCommandRunner
(you can't get async output).
2. For OtCliCommandRunner, any commands sent to the device in the
callback need to be offloaded to another thread. Otherwise the read
routine thread will be blocked, and the command will timeout.
This commit adds support for service subtypes in SRP server. It
updates the internal data model to store services in `Srp::Server`.
Every `Host` now has a list of `Service` entries along with a list of
`Service::Description` entries. These types mirror the SRP update
message format and the set of instructions that form the SRP message.
The `Service` entries represent the "Service Discovery Instructions",
i.e., the PTR records mapping a service name or a subtype name to a
service instance. A `Service::Description` entry represents the the
SRV and TXT records. A `Service` entry is always associated with a
`Service::Description` and the subtypes of the same service instance
all share the same `Service::Description` entry.
This commit also adds a new method `Host::FindNextService()` and the
public API `otSrpServerHostFindNextService()` which is very flexible
and can be used in different ways. It can be used to iterate over the
full list of services, or over a specific subset of services matching
certain conditions, e.g., iterate over all base services excluding
subtypes, or over all subtypes of an instance, or over all deleted
services, etc. It can also be used to find a specific service with a
given instance and service names.
This commit also simplifies and enhances the logging in `Srp::Server`.
In particular, when a new host is added, we now also log the list of
services being added along with it. Also a change to a `Service` is
only logged if the `Service` is marked as committed. This ensures
that temporary `Service` entries associated with a newly received SRP
update message are not logged (e.g., when an associated temporary
`Host` object is being freed after its content is merged with an
existing `Host` entry).
Finally, this commit adds a test `test_srp_sub_type.py` to cover the
subtype service registration on SRP client and server.
In wait, match_line is called with the arguments flipped. The first
argument is supposed to the be the line being checked, and the second
is supposed to be the pattern to match. The reason this still works
for strings is because output is treated as a list of lines to expect,
and each is just compared with == to the actual expected line
This commit contains misc enhancements to OTCI:
- Allow connecting to OTBR without password
- Allow not using sudo for ot-ctl commands
- Use -- to separate OT-CLI commands.
This commit enhances THCI for 1.2 Certification:
- OpenThread.py: 1.2 non-BR
- OpenThread_BR.py: 1.2 BR and Host (otbr-agent solution)
This commit should also make THCI work for both TH1.1 and TH1.2.