Commit Graph

501 Commits

Author SHA1 Message Date
whd fc8a97997d [tests] attempt to fix intermittent failures of MATN-12 (#6858)
The test failed because the script failed to read the output of ipaddr
rloc. This can be fixed by adding some wait time at the end of the
test.
2021-08-10 18:26:22 -07:00
whd 3f8462709b [tests] add test to verify name conflict resolution for meshcop service (#6904)
This commit includes a test case to verify that multiple border
routers can publish their meshcop services successfully without
instance name conflicts.
2021-08-10 12:56:09 -07:00
Damian Królik 43997a7d2a [srp-server] fix adding service with subtypes to existing host (#6901)
When a new service with subtypes is added to an existing
host, the SRP server incorrectly merges the subtype service
copies so that the TXT information is lost, i.e. 0-length
TXT record is created.

Moreover, the OT DNS client cannot parse services with
0-length TXT record (instead of ignoring the TXT record
itself) causing that such a service cannot be examined
at all.

The problem is caused by incorrect merging of the service
description structure which is shared across all services
with the same instance name (i.e. among the base type
service and its subtypes).

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2021-08-09 11:53:27 -07:00
whd 0eee7277c2 [tests] update meshcop service instance name in test case (#6894)
This commit aims to update the meshcop service instance name in
test_publish_meshcop_service.py to make it consistent with the change
on ot-br-posix side.
2021-08-05 08:34:30 -07:00
whd 9cfa0448b5 [tests] fix test_publish_meshcop_service.py (#6888)
The test fails frequently due to missing delay before checking the
meshcop service.
2021-08-03 19:59:16 -07:00
whd c33df6f0ee [border-agent] update meshcop test cases (#6865)
Add a new test case to verify the meshcop service is published with
proper fields.
2021-08-02 18:25:13 -07:00
kangping 706021dfd5 [tests] simplify border router tests (#6870)
This commit simplifies the border router tests by replacing
self.nodes[<NODE_ID>] with shorter names.
2021-07-30 15:51:48 -07:00
canisLupus1313 02d968baa6 [csl] add TLV for CSL clock accuracy (#6802) 2021-07-23 17:08:05 -07:00
Jonathan Hui de53d721de [tests] fix intermittent failure in Cert_9_2_09_PendingPartition.py (#6833)
Keeping network id timeout at 70 can result in ROUTER2 occasionally
creating its own partition. Reset back to 120 to avoid occasional test
failures.
2021-07-21 11:20:23 -07:00
Abtin Keshavarzian 71e00eb20f [test] add missing tests in the Makefile.am & update file access mode (#6825)
This commits updates `thread-cert/Makefile.am` adding some existing
tests that were not included in the Makefile when the tests were
added. It also sorts the entries to be in alphabetical order.

This commit also updates the access control mode for all script files
to be executable by all (`chmod 755` or "-rwxr-xr-x").
2021-07-19 14:35:50 -07:00
whd 6e2b6fd03d [tests] fix test_external_route test case name (#6828) 2021-07-19 12:15:27 -07:00
Abtin Keshavarzian 9f084ac7bb [netdata] allow zero-len external route prefix (#6784)
This commit allows a zero-len prefix `::/0` to be added as an external
route in Network Data. Such a prefix can act as a default route. This
commit also adds `test_zero_len_external_route.py` testcase to verify
the network's behavior using a zero-len external route.
2021-07-12 20:06:29 -07:00
Abtin Keshavarzian 42d86ed832 [dns-client] feature to auto set the default server address (#6787)
This commit adds a new feature in DNS client to automatically set and
update the server's IPv6 address in the default config. This is done
only when user does not explicitly set or specify the server address.
This behavior requires SRP client and its auto-start feature to be
enabled. SRP client will then monitor the Thread Network Data for
DNS/SRP Service entries to select an SRP server. The selected SRP
server address is also set as the DNS server address in the default
config.

This commit also adds `test_dns_client_config_auto_start.py` which
verifies the behavior of the new feature. In particular, that the DNS
client's default config gets changed and mirrors the SRP client
selected server address (when not set by user) and that it remains
unchanged if user explicitly sets the address in the default config.
2021-07-12 17:25:02 -07:00
whd 0f680af4ba [posix] add external routes to kernel on POSIX (#6782)
This is helpful when POSIX kernel is handling a packet at the thread
TUN device.
2021-07-08 09:45:33 -07:00
kangping 4484042ced [srp-server] track lease time per service instance (#6786)
The SRP draft 09 spec suggests that the SRP Servers SHOULD also track
a lease time per service instance.
2021-07-07 21:53:16 -07:00
Eduardo Montoya a0c34f8230 [dua] increase DUA registration test coverage (#6798)
Modify DUA registration test to check that ML-EID TLV content is as
expected for every DUA.req sent.
2021-07-07 14:11:32 -07:00
Eduardo Montoya dc90ed51d4 [link-metrics] fix Link Metrics Status Sub-TLV value (#6799)
When the Initiator requests a reserved Metric Type ID Flag the status
value should be "Value 254: Failure – Other failure".
2021-07-07 12:57:12 -07:00
Abtin Keshavarzian 48b129e74b [dnssd] add support for service subtypes in DNS-SD server and client (#6773)
This commit updates `Dns::ServiceDiscovery::Server` to add support for
browsing a service subtype. In particular, it updates the code which
breaks a DNS name into its components such that it can correctly
parse and accept a service subtype name. It also updates how the
service name compression is done to handle the subtype names.

This commit also updates `Dns::Client` to remove the extra check of
service name (which is already verified) when trying to find a PTR
record for a given service instance name. This change enables browse
for service subtype (parsing the browse response).

This commit also updates and enhances the `test_dnssd.py` script
adding test-cases for browsing for service subtype.
2021-07-02 11:42:55 -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
Simon Lin db51e39cf1 [dua] fix test_dua_dad random fails (#6765)
Relax check for Backbone Query delay.
2021-06-24 21:20:08 -07:00
Abtin Keshavarzian b11d0d2205 [test] restart SRP server (instead of reset) to validate port change (#6763)
This commit updates `test_srp_server_reboot_port` to restart the SRP
sever instead of performing a full device reset. The SRP restart will
trigger the port number change by the server which is the behavior
this test is intended to verify. This change should help address
intermittent failures on this test.
2021-06-24 10:28:08 -07:00
Jonathan Hui aaabf25ff2 [network-key] change name from master to network (#6721) 2021-06-16 23:07:23 -07:00
Jonathan Hui 13ec0e7a63 [tests] fix intermittent failures in Cert_9_2_16 (#6731)
Add additional delay to prevent link repair using MLE Link Request on
Adv timeout.
2021-06-16 11:53:52 -07:00
Jonathan Hui deba1024c9 [mle] enable sending MLE Link Request on Adv timeout by default (#6713)
The `OPENTHREAD_CONFIG_MLE_SEND_LINK_REQUEST_ON_ADV_TIMEOUT` feature
has been incorporated into the Thread 1.2.1 draft specification.
2021-06-10 10:58:13 -07:00
kangping b7006ce74c [tests] remove unnecessary host SLAAC assertions (#6715)
The assertion is verifying the (linux) host SLAAC behavior which is
not guaranteed on different platform and linux
distributions. Moreover, it is required for testing the BR behavior.
2021-06-09 21:28:54 -07:00
whd 87e6cf5991 [srp-server] choose different UDP port from previous on reboot (#6702)
This commit implements a mechanism to let an SRP server listen to a
different UDP port on a reboot.
- When an SRP server starts, it reads the UDP port used in the last
  time from Settings. Then the SRP server listens to the next port in
  the reserved range.
- When SRP server successfully starts, store its UDP port in Settings.
2021-06-06 22:11:11 -07:00
kangping fa8ec6ded0 [tests] give more time for SRP client to upgrade to router (#6694) 2021-05-31 21:44:54 -07:00
Abtin Keshavarzian 1796f50264 [srp-client] support saving selected server info (by auto-start) (#6672)
This commit adds support for a new feature in SRP client which allows
it to save the selected server info (by the auto-start feature) in
non-volatile settings. On SRP client restart (e.g., due to a device
reset) the client will select the same server when searching to
discover and pick one from the Thread Network Data service entries.
Config `OPENTHREAD_CONFIG_SRP_CLIENT_SAVE_SELECTED_SERVER_ENABLE` can
be used to enable/disable this feature.

The server info is saved only after the host info is successfully
registered with the server and if it is selected by auto-start from a
network data SRP *unicast* service entry.

This commit also adds `test_srp_client_save_server_info.py` test-case
which verifies the behavior of the new feature.
2021-05-25 18:34:07 -07:00
kangping f1ab57bb66 [border-router] add vicarious router solicitation (#6514)
This commit adds vicarious router solicitation which is described in
https://www.ietf.org/archive/id/draft-lemon-stub-networks-02.html#section-3.1.1
2021-05-20 12:32:59 -07:00
kangping 9eff7616b3 [srp-server] fix removing services when the host is expired (#6649)
The SRP server tries to notify the advertising proxy when a service is
expired.  The expired service is firstly removed from the service list
and later added back to the head of the service list if the service
name should be retailed. This will result in deadloop when there are
two or more services on the same host.

This commit fixes this issue by keeping the expired service in the
service list by simply mark the service deleted and pass all services
of the host to the advertising proxy. The advertising proxy will
republish those services that are not expired but this should be fine
since service expiration is not a common case.

Also update the advertising proxy test case to cover multiple
services.
2021-05-20 09:07:39 -07:00
whd 53b50577d4 [github-actions] fix MATN_16_LargeNumberOfMulticastGroupSubscriptionsToBBR (#6576) 2021-05-12 19:27:41 -07:00
Simon Lin 9347b290e1 [cli] make command output consistent (#6592)
This commit makes the CLI command output consistent under all cases:

- Output Error 6: Parse when the command line is too long (no output
  originally).

- Output Error 7: InvalidArgs when the command line has too many
  arguments. The original output is Error: too many args (max %d),
  which does not strictly follow the Error <code>: <msg> pattern.

- Output Error 13: InvalidState for running non-diag command in
  diagnosis mode to follow Error <code>: <msg> pattern.
2021-05-12 18:50:03 -07:00
Simon Lin e0a1987336 [ip6] set Mesh Local IID for Reference Devices (#6599) 2021-05-11 21:38:14 -07:00
Abtin Keshavarzian a40b42e299 [network-data] add new DNS/SRP anycast/unicast service definitions (#6501)
This commit adds new network data service entry definitions to
indicate presence of DNS/SRP servers within the Thread mesh and
provide info about them. Two service TLV formats are added:

`NetworkData::Service::DnsSrpAnycast` indicates that DNS/SRP client on
a device can use the associated anycast address with this service TLV
to reach the DNS/SRP server. The use of anycast address ensures that
the messages are routed to the nearest node which has added such a
service entry in the network data. The service TLV data in this model
contains a one byte sequence number which is used to notify the SRP
clients if they need to re-register with the server(s) (e.g., due
server reset/reboot and/or loss of previous registrations).

`NetworkData::Service::DnsSrpUnicast` directly provides the IPv6
address and port info for a DNS/SRP server which can be included as
part of the service TLV data and/or the server TLV data. Using service
TLV data allows the info about a common infrastructure SRP/DNS server
to be added by multiple BRs. In the case of server TLV, the IPv6
address info can be optionally omitted (i.e. just a port number is
provided) which then causes the associated RLOC/ALOC address of the
node who added the service entry to be used as the server's IPv6
address.

This commit updates the `Srp::Client` to use the new service entries
to discover/select the SRP sever when auto-start mode is enabled. The
client prefers and uses a `DnsSrpAnycast` over `DnsSrpUnicast`
entries. The `Srp::Server` is also updated to publish its info as
`DnsSrpAnycast` entry (using mesh-local address).

This commit also updates the `test_network_data` unit test to cover
the behavior of newly methods which iterate and parse different
service entry formats.
2021-05-11 13:44:29 -07:00
Simon Lin c1e2e168d6 [tests] set default node parameters (#6593)
This commit set default node parameters and remove unnecessary
parameters in topologies.
- router selection jitter to 1s
- panid to 0xface
2021-05-11 12:56:33 -07:00
whd f97d9c7de5 [github-actions] fix MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py (#6608)
The test case failed because pktverify failed to find an ACK packet
sent to TD. However, TD_RLOC has changed during the test while we were
using the latter RLOC to verify the packet. Therefore it wasn't able
to find the packet.

For this test case, we can verify the existence of that ACK packet
using the source address of its according CON packet.
2021-05-11 12:54:28 -07:00
Simon Lin 8dc9a53cc7 [tests] fix bbr_5_11_01 random fails (#6589)
Set default BBR registration delay to 2. Defining a smaller BBR jitter
can help all TCs to be more robust.
2021-05-07 21:31:05 -07:00
Simon Lin 5b425a1b58 [tests] fix dig output TXT parsing (#6577) 2021-05-07 12:37:56 -07:00
Abtin Keshavarzian 5b6654d0bc [doc] update the BR name in comments/documentations (#6581)
This commit updates the BR name in comments and documentation
(removes the uses of "duckhorn")
2021-05-06 19:28:54 -07:00
whd 9de2134f67 [tests] fix MATN_09_DefaultBRMulticastForwarding.py (#6579)
The second to the last packet verification statement expects a ping
request sent by Router_1 after BR_2 becomes the PBBR.  However, this
statement wrongly matches a ping request sent by Router_1 before BR_2
becomes the PBBR.  Added a restriction of the echo identifier to make
sure the packet verification statement doesn't match the previous ping
request.
2021-05-06 10:10:36 -07:00
kangping 217727ec62 [border-router] send RA immediately when RA parameters are updated (#6565) 2021-05-06 10:08:07 -07:00
whd 26cdf63231 [github-actions] fix MATN_15_ChangeOfPrimaryBBRTriggersRegistration (#6535) 2021-05-05 19:52:42 -07:00
Li Cao f1fd52b9ef [tests] fix v1_2_LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks (#6537)
Extend ping timeout.
2021-04-29 18:05:39 -07:00
kangping 5db938dbed [border-router] learn RA header and parameters from infra interface (#6431)
The commit enhances the Routing Manager to learn RA header and
parameters from RA messages initiated from infra interface. This
addresses the issue that the BR may be using different RA header
against another RA daemon which is working on the same infra interface
(Have BR and another RA daemon working on the same interface is common
for Wi-Fi + Thread routers).

We also changed to accept RS messages initiated from the infra
interface: this is for case that multiple Border Routers run on the
same host (as we are trying to support multiple ot-daemons on the same
host).
2021-04-29 12:56:12 -07:00
whd 7620e59e7a [scripts] MATN-TC-09: Failure of Primary BBR – Outbound Multicast (#6463) 2021-04-27 18:56:34 -07:00
whd b5ec673e2f [scripts] MATN-TC-16: Large number of multicast group subscriptions to BBR (#6507) 2021-04-26 09:14:10 -07:00
Simon Lin 27d1e9d65a [backbone-router] fix incorrect PBBR ALOC (#6505) 2021-04-26 09:09:39 -07:00
whd 0656fbc9ed [scripts] MATN-TC-15: Change of Primary BBR triggers a re-registration (#6504) 2021-04-26 07:04:15 -07:00
Simon Lin ccedef530e [github-actions] add more packet verification tests (#6508)
Packet verification of some test scripts were not executed. This
commit runs these tests in packet verification checks.
2021-04-25 21:36:01 -07:00
whd c8902e9419 [scripts] MATN-TC-05: Re-registration to same Multicast Group (#6444) 2021-04-22 22:17:03 -07:00