445 Commits

Author SHA1 Message Date
JaneFromSilabs 9e0bf6a263 [thci] prefix fix for TH 1.1 border router 7.x.x cases (#7367) 2022-01-31 10:25:09 -08:00
Eduardo Montoya 1c6062c610 [thci] fix implementation of setKeepAliveTimeOut (#7373)
Thread 1.2 harness uses this method to set the child timeout in
DUA-TC-10, DUA-TC-21 and DUA-TC-22.
2022-01-28 12:00:53 -08:00
Karthick 9f70bafd67 [thci] update registerMulticast to align with #7253 (#7364)
Enabling registration to multiple mcast addresses on the same command
line in THCI.
2022-01-28 08:21:03 -08:00
Simon Lin 9e17e471ad [thci] print traceback and re-raise exceptions (#7356)
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.
2022-01-28 08:14:59 -08:00
Eduardo Montoya d4e041096f [bbr] implement new Sequence Number increase rules (#7342)
"BBR Sequence Number Updating" section in Thread Specification
requires special wraps when increasing BBR Dataset Sequence Number.
2022-01-25 18:20:36 -08:00
JaneFromSilabs 4af585400e [thci] reset and multicast changes (#7340)
- 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.
2022-01-24 09:49:59 -08:00
Simon Lin 0dccf05473 [otci] fix read error after close (#7331)
This commit fixes OTCI that CLI connection via serial may fail when
closing.
2022-01-20 08:56:47 -08:00
canisLupus1313 556cee64d3 [thci] add implementation of setVrCheckSkip in THCI (#7329) 2022-01-19 14:03:01 -08:00
tomaszkob89 bb658e2705 [thci] fix THCI for T1.1 9.2.4 commissioner (#7311)
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.
2022-01-13 10:38:49 -08:00
Eduardo Montoya c9066b6506 [bbr] add bbr skipseqnuminc command for reference device (#7283)
Add a command to allow skipping the increase of Sequence Number
when recovering the BBR Dataset from Network Data.
2022-01-13 09:59:30 -08:00
Eduardo Montoya 32bdcae210 [thci] discard IPv4 link local address in mDNS browsing (#7277)
When looking for the Border Agent's link local address in the mDNS
response do not consider a possible IPv4 address record.
2022-01-03 15:17:27 -08:00
Eduardo Montoya f10e662692 [thci] improve mDNS browsing using Zeroconf (#7249)
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.
2021-12-23 12:55:47 -08:00
tomaszkob89 4fcd48ce8c [thci] drop empty lines returned in command outout from the response (#7236)
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.
2021-12-22 22:23:02 -08:00
Eduardo Montoya 348f0a10a3 [thci] register multicast addresses on the host side (#7193)
Make use of the `mcast6.py` application in order to listen to
multicast traffic on the host side when required by the harness.
2021-12-22 09:51:47 -08:00
Simon Lin 54d848e11b [otci] add method to run shell commands (#7230) 2021-12-13 23:43:11 -08:00
Kacper Szeweńko 775c568286 [thci] fix failing Thread 1.1 Cert Tests (#7199)
This commit fixes tests of 1.1 certification: SED 6_5_1, 6_5_2, 6_5_3,
9_2_8; Commissioner 9_2_4; Leader 9_2_11
2021-11-26 22:29:44 -08:00
tomaszkob89 cf4b71d8b9 [thci] fix issue with not initialized isPowerDown flag (#7196)
When the GRL starts, it calls initialize() reset() method on each
device. Reset method call fails due to missing (uninitialized)
attribute `isPowerDown`.
2021-11-23 10:03:10 -08:00
canisLupus1313 0e8b6604cb [thci] add setCcmState method in thci (#7179)
This commit adds API method setCcmState to THCI file.
2021-11-19 10:34:13 -08:00
JaneFromSilabs e67f432284 [thci] fix for GRL TH1.1 Leader 5.5.2, Leader 5.5.3 (#7163) 2021-11-19 08:00:14 -08:00
tomaszkob89 130957d489 [thci] fix issue with isPowerDown flag and reset method (#7160)
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.
2021-11-17 11:32:53 -08:00
Eduardo Montoya 825227a71a [thci] fix mdns_query (#7154)
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.
2021-11-17 10:14:32 -08:00
Simon Lin 34c8c82ee4 [dnssd] add tests for Service Instance names with spaces (#7143)
This commit adds tests to make sure Service Instance names with spaces
are handled properly by SRP and DNS-SD.
2021-11-15 10:15:10 -08:00
Eduardo Montoya b4c76b3e17 [thci] allow for sufficient time after a ping from OTBR (#7158)
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.
2021-11-12 13:31:58 -08:00
Simon Lin c02d111026 [otci] misc enhancements (#7104) 2021-11-10 22:30:19 -08:00
Simon Lin 01009a3eff [thci] fix THCI error on Harness 1.1 (#7148) 2021-11-10 12:04:32 -08:00
Eduardo Montoya 7184999022 [thci] override forceSetSlaac for border router (#7149)
Manually configured addresses need to be added to the TUN interface in
order for the host to handle them.
2021-11-10 08:45:33 -08:00
Eduardo Montoya dc9ce005f3 [thci] retrieve BA port from mDNS response (#7130)
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.
2021-11-09 08:11:04 -08:00
Eduardo Montoya a36a931975 [thci] fix Zephyr detection (#7131)
Make sure the variables are accessible in the child class and use
proper line endings for first Zephyr command.
2021-11-03 22:44:55 -07:00
Eduardo Montoya 14acfb8a14 [thci] add Thread 1.2 Certification fixes (#7122)
Several fixes for Thread 1.2 Certification, including:
- getMAC
- setPollingRate
- joinCommissioned
- MGMT_ACTIVE_SET
- setCSLtout
- LinkMetricsMgmtReq
- send_udp
- setCSLsuspension
- set_max_addrs_per_child
- getMlrLogs
- mldv2_query
- mdns_query
- powerDown
- powerUp
2021-11-02 21:02:49 -07:00
Eduardo Montoya 76cdf9dc7f [thci] serial handling improvements (#7113)
Improve handling of timeouts, exceptions and logging for device serial
communication.

Also include other minor syntax editions.
2021-10-28 11:24:54 -07:00
Eduardo Montoya 75243e3892 [thci] allow to use Zephyr platforms (#7099)
On initialization, detect if the device is running Zephyr and in that
case modify the commands prefix and line ends.
2021-10-25 13:12:22 -07:00
Simon Lin 025405645e [otci] support MLE Discovery (#7073) 2021-10-25 08:34:49 -07:00
Simon Lin db2e313ef0 [cli] disallow concurrent commands (#6695)
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.
2021-09-09 20:46:43 -07:00
priyankaCh22 34366834b0 [otci] dns query timeout fix (#6946)
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.
2021-08-23 14:41:11 -07:00
whd cd6d57d1af [cli] add API/CLI to support querying SRP server state (#6914) 2021-08-12 10:52:04 -07:00
Simon Lin 15584dcda3 [cli] allow binding CLI udp socket to unspecified interface (#6761) 2021-08-09 19:49:18 -07:00
gabekassel a34f5bc76e [otci] allow callbacks on all read lines (#6851)
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.
2021-08-04 22:23:19 -07:00
Eduardo Montoya 907a9ff62e [thci] allow REED DUTs to upgrade (#6789)
Some Thread 1.2 tests require that REED DUTs upgrade to Router. Allow
it while keeping existent functionality for reference devices.
2021-07-07 18:29:07 -07:00
Simon Lin 478fb1e3a3 [otci] add backward compability (#6780) 2021-07-06 11:31:54 -07:00
Abtin Keshavarzian 0faa3fd4fe [srp-server] add support for service subtypes (#6760)
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.
2021-07-02 09:35:03 -07:00
Eduardo Montoya e2205fbf79 [thci] add support for SSED DUT (#6775)
Enable joining a network as SSED, which is required for several
Thread 1.2 certification tests.
2021-07-01 10:32:11 -07:00
gabekassel 4c117b92de [otci] fix OTCI.wait arg order (#6777)
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
2021-06-30 21:25:17 -07:00
Simon Lin 3a7e836dd7 [otci] fix wait duration (#6759) 2021-06-24 22:29:38 -07:00
Simon Lin 98d9b455cc [otci] fix command issue after factoryreset (#6670) 2021-06-24 21:18:14 -07:00
Mason Tran 11ac430155 [thci] remove assert which checks if the port is unicode (#6762)
In the case where the connection is over Telnet, self.port will be None.
2021-06-23 21:28:31 -07:00
Simon Lin d5d6361669 [otci] misc enhancements (#6753)
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.
2021-06-22 10:20:31 -07:00
Simon Lin 875bb57791 [otci] remove debug prints (#6749) 2021-06-18 11:47:59 -07:00
Simon Lin bb00ec3d86 [thci] fix THCI issue on Thread Dev Harness 1.1 (#6745) 2021-06-17 09:45:34 -07:00
Jonathan Hui aaabf25ff2 [network-key] change name from master to network (#6721) 2021-06-16 23:07:23 -07:00
Simon Lin 95c5cb793a [thci] enhance THCI for 1.2 Certification (#6609)
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.
2021-06-10 23:54:47 -07:00