Commit Graph

464 Commits

Author SHA1 Message Date
Simon Lin 9fcdb290ae [simulation] increase simulator UDP buffer size (#6006) 2021-01-05 10:27:42 -08:00
Simon Lin 22b043bf62 [otci] add OpenThread Controller Interface library (#5779)
This commit introduces the Proof of Concept implementation of the
OpenThread Controller Interface (OTCI) which can be used to connect
and manage various kinds of OT devices.

This commit also adds the tests to verify that OTCI works for both
simulation and real OT devices.

- Device Connectors
  - CLI Virtual Time Simulation
  - CLI Real Time Simulation
  - CLI SOC Device
  - NCP Virtual Time Simulation (not all APIs work)
  - Real device via SSH
- OTCI tests of simulation devices are executed in Github Actions
- OTCI tests of real devices can be executed like below:

# Install otci python library
cd tests/scripts/thread-cert/otci && python3 setup.py install --user
# Test OT CLI SOC device at /dev/ttyACM0
REAL_DEVICE=1 OT_CLI_SERIAL=/dev/ttyACM0 python3 tests/test_otci.py
# Test OTBR device via SSH
REAL_DEVICE=1 OTBR_SSH=172.16.243.151 python3 tests/test_otci.py
2020-12-30 11:29:27 -08:00
Moandor 069e26b51e [key-manager] remove default master key (#5998)
When initializing, we should use randomly generated network parameters
instead of default ones, to eliminate the possibility of unintentional
use of default credentials.
2020-12-30 11:25:48 -08:00
Li Cao 82c682fbc9 [low-power] fix test case Low Power 5_3_01 (#6022) 2020-12-30 11:20:03 -08:00
Simon Lin 471cf8bedf [ip6] use ALOC source address (#6007)
CoAP requires that the source address of a response must match the
destination addresses of the request. So, if a device sends a TMF
request using ALOC as destination address, the TMF response SHOULD use
the ALOC as source address. Otherwise, CoAP implementations (beside
OpenThread) may fail to match the request and response.
2020-12-24 11:00:03 -08:00
Jing Ma e0bff3641f [thread-cert] fix case 7.1.5 intermittent failure (#5973) 2020-12-23 15:45:01 -08:00
kangping 995ad66846 [border-router] initial implementation of prefix/route management (#5856)
This is the initial implementation of Thread Border Router
prefix/route management with:

- Create & publish off-mesh routable (OMR) prefix for Thread network
  - configure the BR as default route.
  - converge to the smallest OMR prefix if multiple prefixes are
    present at the same time.
- Create & advertise on-link prefix for infrastructure network
  - monitor RA messages on infra link and stops myself if there is
    someone else advertising an on-link prefix.

It currently supports single infrastructure link with possibly
multiple BRs. Support for multiple infrastructure links is left for
future.
2020-12-23 15:19:12 -08:00
Simon Lin 24ed1ffd37 [cli] router table command to output Link (#5997)
This commit enhance OT CLI command router table to output whether Link
Established in Link field.
2020-12-22 22:52:14 -08:00
Jiacheng Guo b306cb0bbe [radio] send radio command to the region (#5999)
Some radio region has further limit over max power table. We need to
send the region code the radio driver as well.
2020-12-22 22:51:03 -08:00
Moandor 27609159d9 [expect] fix CLI router tests (#5996)
The next hop here is not deterministic. This changes it to expect any
4-digit hex.
2020-12-22 08:54:29 -08:00
Jing Ma 7d2d228fa7 [thread-cert] relax time difference to less than 1.1 for case 5.1.13 to fix issue #5979 (#5987) 2020-12-21 07:12:25 -08:00
Jing Ma cd355d499e [thread-cert] remove deprecated case 6.1.9 referring to testplan v67 (#5984) 2020-12-20 16:27:50 -08:00
Jing Ma 3b832ef470 [thread-cert] add case 7.1.7 using pktverify (#5881) 2020-12-19 19:00:41 -08:00
Jing Ma 6583a3d8cf [thread-cert] fix case 8.3.1 intermittent failure (#5975) 2020-12-19 08:23:36 -08:00
Jing Ma 1811223a25 [thread-cert] fix case 7.1.6 intermittent failure (#5974)
An issue is caused by tiny time difference as well between step 5 and
step 6, step 6 occasionally is sent out ahead of step5.
2020-12-19 08:22:20 -08:00
Jing Ma ae43f3fda2 [thread-cert] fix case 5.1.12 intermittent failure (#5976)
An issue is caused by The Challenge TLV and TLV Request TLV MUST be
included if the response is an Accept and Request message in Step 4,
delete these two TLV checks when the response is a Link Accept
message.
2020-12-19 08:20:53 -08:00
Jing Ma 3166f6a0ed [thread-cert] add case 9.2.6 DatasetDissemination using pktverify (#5972) 2020-12-18 20:24:49 -08:00
Jing Ma 0e105524cb [thread-cert] add case 5.8.4 SecurityPolicyTLV using pktverify (#5967) 2020-12-18 08:05:08 -08:00
Jing Ma f1e0fad475 [thread-cert] refactor case 9.2.9 using pktverify (#5962) 2020-12-17 07:10:26 -08:00
Moandor d4c1c5d725 [spinel] fix errors in RCP recovery (#5965)
If mError is set to error state before entering the RCP recovery, this
error will be recognized as an error in the recovery process, and
cause it to die, while there is actually no error.

This fixes it by clearing mError when starting the recovery process.
2020-12-16 22:08:59 -08:00
Jing Ma 03cd73ad1c [thread-cert] add case 9.2.5 ActiveDataset using pktverify (#5959) 2020-12-16 20:08:07 -08:00
Jing Ma 4caecf44fb [thread-cert] add case 8.2.5 JoinerRouter using pktverify (#5924) 2020-12-16 08:07:44 -08:00
Jing Ma f3968c5891 [thread-cert] refactor case 9.2.8 using pktverify (#5930) 2020-12-16 08:06:12 -08:00
Jing Ma 69e97581e7 [thread-cert] add case 8.1.6 using pktverify (#5898) 2020-12-14 23:24:43 -08:00
Jing Ma bd00cafbec [thread-cert] add case 9.2.19 PendingDatasetGet using pktverify (#5951) 2020-12-14 11:49:24 -08:00
Jing Ma 53aebc851e [thread-cert] add case 5.7.2 CoapDiagCommands using pktverify (#5940) 2020-12-14 11:48:31 -08:00
Jing Ma b1dd1d7bf5 [thread-cert] refactor case 9.2.2 using pktverify (#5913) 2020-12-14 08:38:18 -08:00
Jing Ma 69e57d52e0 [thread-cert] refactor case 9.2.11 using pktveriy (#5931) 2020-12-14 08:37:15 -08:00
Jing Ma 98e70c425c [thread-cert] add case 9.2.3 ActiveDatasetGet using pktverify (#5949) 2020-12-14 08:36:33 -08:00
Jing Ma 234562a577 [thread-cert] add case 9.2.1 MGMTCommissionerGet using pktverify (#5952) 2020-12-14 08:34:39 -08:00
Jing Ma c455eb9cdd [thread-cert] add case 5.7.3 CoapDiagCommands using pktverify (#5938) 2020-12-14 08:33:43 -08:00
Jing Ma 3cb8c7b03d [thread-cert] add case 8.3.1 CommissionerPetition using pktverify (#5904)
Also fix wrong COMMISSIONING_DATA_TLV const in cases 5.6.6 and 5.6.9.
2020-12-11 07:35:44 -08:00
Li Cao ae07fe27ff [low-power] implement enhanced-ack based probing (#5780)
This commit implements Enhanced-ACK Probing (on simulation platform).

- Add a new public API otLinkMetricsConfigEnhAckProbing which sends
  Link Metrics Management Request to configure the probing. This is
  called on Probing Initiator side.

- Add a new radio platform API otPlatRadioConfigureEnhAckProbing. This
  API should be called on Probing Subject side when handling the
  requests from Initiators. This API notifies the radio to start/stop
  aggregating link metrics info and include the data into Vendor IE in
  enhanced-ACK for the specific neighbor. As discussed in #5746, the
  code for doing such thing should be put in radio driver.

- Add a util module util/link_metrics, which provides a group of APIs
  to implement Probing Subject side logic for Enh-ACK Probing. Any
  platform could use this module to implement the feature easily in
  radio driver.

- Add new util APIs in util/mac_frame to generate Enh-ACK Probing IE
  (Vendor IE with Thread OUI and SubType = 0) and set value for this
  IE.

- Update the implementation in simulation/radio.c to support Probing
  Subject side logic for Enh-ACK Probing, using APIs in
  util/link_metrics and util/mac_frame.

- Add a test
  v1_2_LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks.py for
  testing.

Misc:

  - Add check for all the public Link Metrics APIs (Initiator side) to
    ensure that the Subject is a neighbor of the Initiator. If the
    address is not link-local or the neighbor is not found, an error
    UNKNOWN_NEIGHBOR would be returned.

  - Update PrepareEmptyFrame so that when it's called for reference
    device, its frame version would be set to 2015.
2020-12-10 23:31:41 -08:00
Jing Ma eb3f6fd2f2 [thread-cert] refactor case 6.5.2 using pktverify (#5886) 2020-12-09 23:32:16 -08:00
Simon Lin 9380ffd07c [scripts] test multicast routing across Thread and Backbone (#5852)
- This commit fixes some issue in multicast forwarding from Thread to
  Backbone.
- It also adds a test to verify that multicast forwarding works across
  Thread and Backbone.
  - Test script tests/scripts/thread-cert/mcast6.py is added for Host
    to subscribe to a multicast address

The ping reply can not reach ROUTER1 since DUA feature is not
complete.
2020-12-09 08:49:07 -08:00
Jing Ma fdc8a97594 [thread-cert] refactor case 8.1.1 using pktverify (#5883) 2020-12-09 07:34:07 -08:00
Jing Ma 17d813eadd [thread-cert] add case 7.1.8 BorderRouterAsFED using pktverify (#5869) 2020-12-08 10:39:17 -08:00
Jing Ma 60344b6c57 [thread-cert] refactor case 7.1.5 using pktverfiy (#5882) 2020-12-07 22:43:16 -08:00
Jing Ma f804879b8a [thread-cert] add case 7.1.6 BorderRouterAsLeader using pktverify (#5868) 2020-12-07 20:17:26 -08:00
Yakun Xu 7a7390b9ee [test] separate code coverage data files (#5920)
This commit ensures each node create its own profile data, so that they
can be merged after tests to produce more accurate profile data.

This commit also prints the coverage data of message.cpp after all
profile data are merged.
2020-12-07 13:23:26 -08:00
Jing Ma dc5c25799d [thread-cert] refactor case 7.1.3 using pktverify (#5859) 2020-12-07 10:09:31 -08:00
Jing Ma c6c079baaf [thread-cert] fix case 5.3.6 issue #5909 (#5912) 2020-12-07 10:06:05 -08:00
Jiacheng Guo f5a7dc2b9a [radio] send max power table to radio (#5867)
This change sends the max power table to the radio so that the radio
chip can manage the transmit power by self.
2020-12-04 08:08:52 -08:00
Yakun Xu a8b5b07849 [diag] check state before entering diagnostic mode (#5908)
This commit restrict diagnostic mode only when network stack is not up,
which prevents some issues caused by switching to diag mode after the
device was attached. For example, timers may not be triggered properly
after returnning from diagnostic mode.
2020-12-02 23:16:08 -08:00
Simon Lin 6088200bf0 [thread-cert] fix 5.3.3 random fail by small chance (#5892)
5.3.3 pktverify fail by small chance when the ping reply is forwarded
from Router3 -> Leader -> Router2 instead of Router3 -> Router2. In
such case, the direct wpan.dst16 is not Router2's RLOC16, but Leader's
RLOC16.

This commit change 5.3.3 to check for both 6lowpan mesh dst16 and
wpan.dst16 against Router2's RLOC16.
2020-12-02 21:26:31 -08:00
Jing Ma 8f2e1138e8 [thread-cert] refactor case 5.7.1 using pktverify (#5834) 2020-12-02 12:03:35 -08:00
Jing Ma 54b7e2b951 [thread-cert] refactor case 5.5.1 using pktverify (#5827) 2020-12-02 12:02:22 -08:00
Jing Ma 11930730c6 [thread-cert] refactor case 5.3.11 using pktverify (#5825) 2020-12-02 12:02:09 -08:00
Jing Ma 141208b9d3 [thread-cert] refactor case 5.3.9 using pktverify (#5823) 2020-12-02 12:01:58 -08:00
Jing Ma d218dfcb35 [thread-cert] refactor case 7.1.1 using pktverify (#5855) 2020-12-02 08:31:12 -08:00