Commit Graph

293 Commits

Author SHA1 Message Date
Simon Lin c73320ff3e [mlr] add MulticastListenersTable on BBR (#5292)
This commit adds the Multicast Listener Table for BBR:

- Implements Multicast Listener Table on BBR
  - Adds registered MAs to MulticastListenerTable
  - Reject when the table is full or the multicast address is invalid
    and return failed status
  - Respond with unsuccessful status along with failed addresses
  - Expire Listeners from MulticastListenerTable per second (using
    MinHeap for better performance)
- MLR enhancement
  - Re-register only failed multicast addresses (used to register all
    registering multicast addresses)
- Reference Device only APIs
  - Some APIs are defined for reference devices and tests.
- Add tests
  - Add unit test: test_multicast_listener_table.cpp (runs for 1.2-bbr
    only)
  - Add functional tests
2020-08-21 08:40:58 -07:00
Simon Lin ec0373c354 [tests] check send MLR.req for MAs when PBBR is enabled (#5337)
This commit adds one test to verify that if a node subscribed MAs when
there is no PBBR in the network, it should still be able to send
MLR.req after PBBR is enabled.

This is a case that wasn't tested in existing tests.
2020-08-20 22:22:23 -07:00
Jing Ma 2373fcbf01 [thread-cert] refactor case 6.2.2 using pktverify (#5353) 2020-08-19 08:42:27 -07:00
Jing Ma 2ab2f9af3e [thread-cert] refactor case 5.5.5 using pktverify (#5332) 2020-08-19 08:41:36 -07:00
Jing Ma 9fec90ffe1 [thread-cert] refactor case 5.5.7 using pktverify (#5313) 2020-08-19 08:38:39 -07:00
Li Cao 7db8c6815c [low-power] add csl feature for Thread 1.2 (#4557)
This commit implements the CSL feature in Thread 1.2.

- Add macro definitions for low power to control the compiling of
  source code.

- Add data and methods for running CSL in Mac and SubMac. This mainly
  includes setting CSL parameters, starting/stopping CSL, and the
  timer handling process.

- Add otPlatTimeGetAPI and implementation.

- Add CSL transmission implementation. CSL transmission is a new kind
  of transmission, the related definition and implementaion for the
  whole transmitting process is added.

- Add calling of start/stop CSL in certain cases.

- Implement CSL synchronization maintainence. If a CSL cordinator
  didn't get a frame containing CSL IE for CSLTimeout, the CSL
  receiver is regarded as de-synchronized.

- Add Cli interface for using CSL.

- Implement enhanced Ack with IE. The original code can only generate
  auto ack for Imm-Ack. As CSL requires CSL IE included in enhanced
  ack. This PR implements it.

- Add basic functional test for CSL transmission. More tests
  corresponding to test plan would be added later.
2020-08-18 10:55:33 -07:00
Jing Ma 962c06f8e7 [thread-cert] refactor case 5.5.4 using pktverify (#5331) 2020-08-17 22:37:30 -07:00
Jintao Lin 3f38068a71 [mac] change address filter and seek function to accept frame without PAN ID (#5389)
In 802.15.4-2015 spec Table 7-2, it is possible to receive frame with
destination address but without destination PAN ID. This commit
changes the address filter function to avoid dropping such frames.
2020-08-17 22:34:38 -07:00
Yakun Xu 16a5c52d9f [netdata] add api to check if joiner is in steering data (#5392) 2020-08-14 22:09:14 -07:00
Jing Ma bc195d1329 [thread-cert] refactor case 5.5.2 using pktverify (#5330) 2020-08-14 22:06:01 -07:00
Jing Ma 93243b5f1d [thread-cert] refactor case 5.8.2 and 5.8.3 using pktverify (#5291) 2020-08-12 23:18:33 -07:00
Jonathan Hui b47dda45cf [test] add test for router reattach with many routers 2020-08-11 13:22:01 -07:00
Yakun Xu 66dcbac15d [mle] add discovery request callback (#5131)
This commit allows notifying the application a discovery request is
received, which is useful if the application wants to be more active
when a joiner comes.
2020-08-11 10:22:10 -07:00
Zhanglong Xia 9af8fe8cc5 [cli] add cli commands to set unsecure port and link security (#5349) 2020-08-11 09:28:55 -07:00
Simon Lin ecd9436427 [scripts] add packet verification framework (#4428)
This commit introduces the packet verification (PV) framework for
certification tests.

- Add packet verification framework code

- Implement packet verification for cert 5.1.7 as a minimal
  example. There will be more 1.1/1.2 tests with PV submitted in the
  future.

- Download pre-built thread-wireshark binaries from
  openthread/wireshark/releases for packet dissecting (used by
  pyshark)

- Added a Github Action job for Packet Verification
2020-08-11 09:26:28 -07:00
Simon Lin d7343c877b [style] change python yapf column_limit to 119 (#5339) 2020-08-06 21:40:24 -07:00
Jonathan Hui e810357adb [cli] support reading individual operational dataset values (#5344) 2020-08-06 11:52:35 -07:00
Jonathan Hui f8a6d52695 [cli] add '::' to end of mesh local prefix output (#5344) 2020-08-06 11:52:35 -07:00
Jonathan Hui 73afdadaa8 [cli] print channel mask with leading '0x' (#5344)
To be conssitent with intput format.
2020-08-06 11:52:35 -07:00
Simon Lin 5c6c798576 [scripts] add live capture for sniffer.py on simulation traffic (#5327)
This commit enhances sniffer.py so that we can use it as a standalone
sniffer for non Virtual Time simulations.
2020-08-03 09:25:14 -07:00
Jonathan Hui 075017bedc [commissioner] add 'state' CLI command (#5317) 2020-08-01 10:50:07 -07:00
Yakun Xu 114a0e7dc7 [posix] add UART flush and clean up (#5312)
This commit mainly implements the otPlatUartFlush().
- fix code because MSG_NOSIGNAL is not a macro.
- set SO_NOSIGPIPE once.
2020-08-01 09:41:58 -07:00
Rongli Sun 82e7e32bb5 [dua] dua registration and re-registration (#5276)
- registration workflow framework
- registration and reregistration
- registration and reregistration on behalf of children
- add pseudo response status for test/certification purpose
- add unit test
2020-07-30 14:10:22 -07:00
Moandor 0ef8f510c5 [test] fix network name capturing in expect scripts (#5284)
This fixes some expect test failures caused by the following scenario:
Sometimes the command prompt > can be put after the echo of the input
command when inputs come too fast, because we are sending the next
command as soon as we see Done, we don't wait for the next > .

This commit adds expect "> " before sending the command to fix this.
2020-07-29 11:36:06 -07:00
Simon Lin 1081b45bec [mlr] Parent send MLR.req on behalf of Children (#5236)
This commit implements parents sending MLR.req on behave of Children.

- Parent sends MLR.req for Children after delaying for a random time <
  PARENT_AGGREGATE_DELAY (5s).
- Update test script to check for proxied MLR.req
- Parent proxy MLR.req for Children after a delay t in [0, 5]
2020-07-27 20:29:08 -07:00
Yakun Xu cbf1a19483 [cli] support joiner discerner (#5298)
This commit adds support joiner discerner in CLI. The format of joiner
discerner is `number/length`. For example `0xabc/12` means the discerner
value is `0xabc` and the length is `12`.
2020-07-27 20:27:21 -07:00
Simon Lin 00f3043a06 [mlr] send MLR.req for local multicast addresses (#5248)
This commit includes:

- Adding compile configurations necessary for MLR features
- Adding source/header files necessary for MLR features
- Send MLR.req for local MAs on ThreadNetif
  - At most one MLR.req is outstanding
  - Reregistration according to PBBR configuration
  - Renewing periods according to PBBR configuration
- BBRs receive MLR.req with minimal processing and send MLR.rsp
- Add a test to verify that MLR.req is sent for local MAs.
2020-07-22 08:38:05 -07:00
Jing Ma e8fe3bd6e7 [thread-cert] deprecate certification test case 5.5.8, 5.6.8, 5.8.1 (#5246)
5.5.8, 5.6.8 and 5.8.1 were deprecated in Thread Certification test plan.
2020-07-20 08:40:04 -07:00
Moandor 6e98f3bb5b [test] move expect timeout settings to _common.exp (#5242)
This moves all settings of timeout to one place. Also changes the
default timeout to 10 seconds, can probably solve the occasional
timeout when dataset commit active.
2020-07-15 20:57:56 -07:00
Simon Lin 51f9d2cb9d [tests] ignore unknown TLV (#5232)
This commit ignores unknown TLVs when parsing a message and continues
to parse the rest parts of the message.

An unknown TLV can cause the simulator to drop the whole packet, which
could lead to packet parsing issues.  For example, if a Child ID
Response message is dropped, the dissector will fail to add the Short
Address and Extended Address to the Device Descriptors, causing
subsequent secure packets unable to be decrypted.
2020-07-14 20:40:34 -07:00
Rongli Sun 32a3bef6dd [test] fix python formatting in v1_2_* tests (#5225)
In some test scripts, %s and format() are used by mistake.
2020-07-13 08:18:51 -07:00
Moandor 4e0dc03e96 [cli] add netstat command (#5202) 2020-07-08 22:26:41 -07:00
Moandor 203774c181 [test] add expect tests for commissioner and udp (#5196) 2020-07-06 08:39:53 -07:00
Moandor f75076078c [test] add missing expect test cases for dataset commands (#5182) 2020-07-06 08:13:14 -07:00
Moandor fbacefe85c [test] add expect tests for coap and coaps (#5172)
Also adds command coaps set to make it consistent with coap set.
2020-07-02 15:40:18 -07:00
Simon Lin b0bff4f8c3 [github-actions] fix expects fail by chance (#5157)
This commit tries to reduce expects fails in GitHub actions:
- wait_for only sends command when it's not empty
- increases the default expect timeout from 1s to 3s.
2020-06-30 11:01:10 -07:00
Moandor 5acad30791 [test] include CLI tests in RCP mode (#5159)
This makes expect run all cli-*.exp and posix-*.exp tests in RCP mode.
New scripts should use the function spawn_node in _common.exp to spawn
new processes. This is compatible with both simulation mode and RCP
mode.
2020-06-30 08:40:46 -07:00
Moandor 1cd9bb3074 [test] add expect tests for dataset and networktime (#5145) 2020-06-24 12:48:03 -07:00
Jonathan Hui 6e80c8b058 [tests] add test for prefix without on-mesh flag set (#5116) 2020-06-23 18:01:20 -07:00
Jonathan Hui 15c3463cec [tests] fix prefix configuration in 5_6_05 and 5_6_06 (#5116)
Prefix 3 should be configured as on-mesh.
2020-06-23 18:01:20 -07:00
Moandor ede592918c [test] add expect tests for sntp, mac, netif, and more (#5140)
Also does some minor enhancements.
2020-06-22 10:11:55 -07:00
Moandor 0cf84da100 [test] add expect tests for channel, coex, and discover (#5123) 2020-06-19 16:53:19 -07:00
Yakun Xu 8248c3d9df [posix] use real time signal for microsecond timer (#5122) 2020-06-19 16:12:55 -07:00
Yakun Xu 3b362071e5 [link-raw] set receive done callback when enabled (#5108) 2020-06-17 14:42:39 -07:00
Moandor 5ec3848005 [test] add expect tests for macfilter, childip, version (#5107) 2020-06-16 08:53:37 -07:00
Simon Lin 44f1a8bf29 [tests] use longer timeouts for simulation tests (#5094)
* use longer duration for pexpect and socket
* use 10s timeouts
2020-06-15 18:11:34 -07:00
Moandor 4910f91e8c [test] add expect tests for ipmaddr, neighbor, leaderdata (#5097) 2020-06-15 10:19:08 -07:00
Simon Lin 8e124e6fac [cert] capitalize python class constants (#5080)
According to PEP8, constants should be written in all capital letters.

This commit capitalizes these constants:
- thread_cert.TestCase.topology
- thread_cert.TestCase.support_ncp
2020-06-10 18:14:59 -07:00
Moandor 4d1197a34a [test] split cli-2-nodes.exp into multiple files (#5066)
This splits cli-2-nodes.exp into multiple files each of which contains
tests for a single command.
2020-06-09 19:05:05 -07:00
Rongli Sun b51d9100e6 [dua] support to specify iid for domain unicast address (#4900) 2020-06-09 10:38:13 -07:00