Commit Graph

53 Commits

Author SHA1 Message Date
Irving-cl a637cdccf4 [tests] add test case Cert_9_2_02 (#3589)
1. Add new test case **Cert_9_2_02**. Since the test case contains 2
topologies, added 2 new files:
- `Cert_9_2_02A_MGMTCommissionerSet.py`,
- `Cert_9_2_02B_MGMTCommissionerSet.py`.

2. Add mesh_cop tlvs parsing. The corresponding file is
`mesh_cop.py`. The mesh_cop tlvs are used in many cases. For example,
`CommissionerSessionId` is used in both the parsing of **Commissioning
Data**(in mle) and the parsing of **CoAP**. Collected all mesh_cop
tlvs refered in Thread into this file with some unused tlvs
unimplemented.

3. Reuse `SubTlvsFactory` in `network_data.py`. `SubTlvsFactory` are
used to choose the corresponding factory of specific tlv and do the
parsing of it. The `NetworkLayerTlvsFactory` in `network_layer.py` had
exactly the same function with it (almost the same code). Moved the
`SubTlvsFactory` into a new file `tlvs_parsing.py` and change the
usage in `network_data.py` and `network_layer.py`. This helps us
remove some redundant code.

4. Some format issues. Remove some trailing spaces.
2019-03-19 21:17:15 -07:00
Jonathan Hui 1ba69deb30 [coaps] add functional tests for psk and x509 (#3096) 2018-09-27 15:15:08 -07:00
Yakun Xu bdffbe5671 [posix-app] enhance virtual time for posix app (#3016) 2018-09-05 18:08:36 -07:00
Yakun Xu af2bfc1cc4 [test] save packets as pcap file in thread-cert tests (#2965) 2018-08-20 09:27:04 -07:00
Jonathan Hui d426d7cfbd [posix] implement virtual time and update tests to utilize virtual time (#2508)
This commit adds the following features:

- Example posix drivers to support virtual time simulation, allowing tests
  to run faster than real time.

- A python-based simulation driver that coordinates the virtual time
  simulations.  Each alarm event and message transmission across all nodes
  are scheduled in a single discrete time event queue.  As a result, only
  a single node is making forward progress at a time.

- Updated tests to utilize new virtual-time simulator, allowing them to run
  faster than real time.

- To enable virtual time feature, define VIRTUAL_TIME=1 env var and set
  CPPFLAGS=-DOPENTHREAD_POSIX_VIRTUAL_TIME=1.
2018-01-29 19:30:46 +00:00
Zhanglong Xia 9d4f367e6d [tests] add traffic analysis for Cert_5_3_10 as TestPlan (#2502) 2018-01-25 17:31:03 +00:00
Zhanglong Xia 2636df1952 [tests] add traffic analysis for Cert_5_3_08 as TestPlan (#2484)
This commit adds the method set_lowpan_context to set the lowpan context of sniffer.
2018-01-22 16:48:00 +00:00
hjian2017 4dc9f8edf0 [tests] add traffic for Cert_5_3_06_RouterIdMask.py (#2295) 2017-11-10 08:47:54 -08:00
Jonathan Hui 74b3160f9d [meshcop] use IEEE EUI-64 rather than Joiner ID on user input (#2311) 2017-11-07 09:41:46 -08:00
Kamil Burzynski 005781d066 [network-data] add Service/Server TLV support (#2256) 2017-10-26 12:27:19 -07:00
hjian2017 d6a3519036 [tests] add traffic analysis for Cert_5_2_05_AddressQuery.py (#2173)
Add a fuction in node.py node_cli.py to node's address.
Add a module command to verify commands.
Spinel-cli.py doesn't request address for dhcp prefix now, so put
Cert_5_2_05_AddressQuery.py in XFAIL on ncp.
2017-09-13 01:44:56 -07:00
Buke Po 6060448140 [tests] change to test mtd apps (#2140)
* [mle] fix mtd child not reattach after partition
2017-09-10 21:14:14 -07:00
Jonathan Hui a768eaf55e Update test scripts to actually perform reset. (#1909) 2017-06-20 00:33:33 -07:00
Giuseppe Andreello 6d8d42e9bf Fixed python interpreter directives (#1667)
Changed the interpreter directives from '#!/usr/bin/python' to
'#!/usr/bin/env python' so the OpenThread tests can be run
inside a python virtualenv.
2017-04-26 21:23:02 -07:00
Vitalii Kozhukhivskyi 83918bc76f Add timeout parameter to NodeAPI's ping function (#1440)
* Added timeout variable to API's ping function (WIN only).
2017-03-09 14:33:27 -08:00
Nick Banks 24b98dbb85 Windows Cert Testing (#943)
* PR for cert test interface for Windows driver model.
2016-11-29 12:10:34 -08:00
Jonathan Hui 257e418b21 Add Minimal Thread Device to build. (#973) 2016-11-17 01:02:40 +08:00
Shu Chen b6adaaf758 Delay a little longer after starting sim node (#879)
- To make travis check more stable
2016-10-25 10:50:10 -07:00
Nick Banks ad39a59ff9 Support Different Number of Max Children (#872)
* Add support for setting child max, for platforms that define a different maximum number of supported children.
2016-10-24 10:43:10 -07:00
Jonathan Hui 4538dafd3d Add Thread Certification 9.2.4 to automated test. (#823) 2016-10-17 17:26:58 -07:00
rongli aaf5a57ea2 Cli: update 'keysequence' to make keyswithguardtime configurable (#815)
* Cli: update 'keysequence' to make keyswithguardtime configurable
2016-10-16 22:49:31 -07:00
Jonathan Hui c28042ce97 Add Thread Certification 9.2.17 to automated test. (#786) 2016-10-12 20:41:11 -07:00
Jonathan Hui 0bafb5a08f Add Thread Certification 9.2.18 to automated test. (#785) 2016-10-12 11:28:29 -07:00
Jonathan Hui a15a1ba687 Add Thread Certification 9.2.16 to automated test. (#770) 2016-10-10 10:42:21 -07:00
Jonathan Hui 7b0280bbde Add Thread Certification 9.2.15 to automated test. (#769) 2016-10-10 09:46:07 -07:00
Jonathan Hui 176325b5a6 Add Thread Certification 9.2.11 to automated test. (#764) 2016-10-07 15:50:09 -07:00
Jonathan Hui c24b7cfaed Add Thread Certification 9.2.7 to automated test. (#750) 2016-10-05 10:02:08 -07:00
Jonathan Hui 671964c2d4 MLE Announce. (#736) 2016-10-04 10:26:30 -07:00
Jonathan Hui cb04fe8391 Commissioner joiner list. (#729) 2016-10-03 08:54:54 -07:00
Xiao Ma a74e0496b8 Delay a random jitter period prior to request a Router ID for REED. (#554)
* Delay a random jitter period prior to request a Router ID for REED.

* Update Cert_5_1_09_REEDAttachConnectivity.py to pass Travis check.

* Add CLI to set/get the ROUTER_SELECTION_JITTER and update Certification scripts.

  - add 'posix-ncp' to allow failure list in .travis.yml.
2016-09-26 10:03:09 -07:00
Jonathan Hui 8d6923fe8b Add initial thread-cert tests for commissioning. (#680) 2016-09-23 15:45:07 -07:00
Martin Turon ad0efaf72d spinel-cli: Add timestamp to ping. (#658)
Now calculates real round-trip times for ping6 reply:

    12 bytes from fdde:ad00:beef::3388:cc1e:5e44:6150: icmp_seq=0 hlim=63 time=891ms

Increased pexpect timeout for ncp-sim to 4 sec to handle ping responses >2 sec.
Makes Cert_5_3_10_AddressQuery pass reliably, even on low memory Travis VMs.
Added initial stub for commissioner command.
Add env variable control of ncp-sim DEBUG output.
2016-09-21 15:30:36 -07:00
Nick Banks c063ec1477 Refactor Python Node ping function (#643)
* Refactor ping command to remove pexpect dependency on each cert test
2016-09-20 18:13:57 -07:00
Jonathan Hui 03fea69c1b Energy scan. (#606) 2016-09-16 16:04:01 -07:00
Martin Turon 84079beb3a spinel-cli: Clean exit (#585)
* spinel-cli: Use new clean eof termination of ot-ncp rather than CTRL+C.

* Add coverage to NCP.
2016-09-13 18:47:57 -07:00
Jonathan Hui 44350178ad Change copyright to The OpenThread Authors. (#583)
- Add a top-level file named AUTHORS which identifies the copyright
holders of the project.
2016-09-13 15:57:11 -07:00
Jonathan Hui c44c20ef66 Implement PAN ID Query/Conflict. (#556) 2016-09-13 09:18:05 -07:00
Jonathan Hui 56f3239c44 Add commissioning code to codecov. (#555) 2016-09-12 11:31:13 -07:00
Jonathan Hui 563685e187 travis: enable code coverage reporting. (#516) 2016-09-08 14:14:25 -07:00
Martin Turon 73060ae8e1 spinel-cli: Add NCP build to TravisCI (#364)
* ncp: Added spinel-cli and initial travis CI test suite integration.

This PR adds a command line tool, named spinel-cli, that converts ot-cli shell commands (as documented in https://github.com/openthread/openthread/blob/master/src/cli/README.md) to spinel NCP commands (as documented in https://github.com/openthread/openthread/blob/master/src/ncp/PROTOCOL.md).

Also added is a patch to node.py that provides a way to run the existing continuous integration certification test suite against an NCP build rather than a CLI build (by prefacing the command to start the test with the environment variable setting NODE_TYPE=ncp-sim):

cd tests/scripts/thread-cert
NODE_TYPE=ncp-sim top_builddir=../../.. python Cert_5_1_02_ChildAddressTimeout.py
The power of this tool is three fold:

1) As a path to add testing of the NCP in simulation to continuous integration
2) As a path to automated testing of testbeds running NCP firmware on hardware
3) As a simple debugging tool for NCP builds of OpenThread

openthread$ cd tools/spinel-cli/
spinel-cli$ ./spinel-cli.py
Opening pipe to ../../examples/apps/ncp/ot-ncp 1
spinel-cli > help

Available commands (type help <name> for more information):
============================================================
channel            extaddr       mode              route
child              extpanid      netdataregister   router
childtimeout       h             networkidtimeout  routerupgradethreshold
clear              help          networkname       scan
contextreusedelay  history       panid             state
counter            ifconfig      ping              thread
debug              ipaddr        prefix            v
debug-term         keysequence   q                 version
eidcache           leaderdata    quit              whitelist
enabled            leaderweight  releaserouterid
exit               masterkey     rloc16

spinel-cli > version
OPENTHREAD/gd4d4e9d-dirty; Aug 11 2016 14:40:44
Done
spinel-cli > thread start
Done
spinel-cli > state
leader
Done
spinel-cli >

The tool provides three ways to connect to an NCP image:

1) pipe to stdin/stdout of a command line tool (default): -p ./ot-ncp
2) serial connection to a hardware device: -u /dev/ttyUSB0
3) socket connection to the port of a helper tool such as ncp-spi-driver: -s 1234

spinel-cli$ ./spinel-cli.py --help
Options:
  -h, --help            show this help message and exit
  -u UART, --uart=UART
  -p PIPE, --pipe=PIPE
  -s SOCKET, --socket=SOCKET
  -n NODEID, --nodeid=NODEID
  -q, --quiet
  -v, --verbose
2016-09-02 15:32:17 -07:00
Marcin K Szczodrak d83fea07c3 add time delay after a simulated node starts (#327) 2016-08-03 13:16:45 -07:00
Marcin K Szczodrak c7b6bc93c5 add OT_CLI_PATH sys environment variable to node.py test suite (#321) 2016-08-01 15:00:31 -07:00
Jonathan Hui 8c39011d9c Separate out interface up/down from Thread start/stop. (#278)
* Redefine otEnable/otDisable to just initialize/uninitialize the OpenThread stack.
* Remove otInit API since it is replaced by otEnable.
* Add otInterfaceUp/otInterfaceDown APIs to bring up/down IPv6 interface.
* Add otThreadStart/otThreadStop APIs to start/stop Thread protocol operation.
* Updated NCP implementation to utilize new APIs.
2016-07-25 17:52:47 -07:00
Jonathan Hui 9754e72496 Add python3 support. (#270) 2016-07-21 06:31:34 -07:00
Jonathan Hui db436d91ae Unify example apps across all example platforms. (#215) 2016-06-27 17:19:37 -07:00
Jonathan Hui 7ecccade06 Change executable names for examples to ot-cli and ot-ncp. (#173) 2016-06-20 08:44:12 -07:00
Marcin K Szczodrak ef9de65117 reorg apps and platforms (#89) 2016-06-01 16:01:22 -07:00
Marcin K Szczodrak cc2e961f4b node id and compilation fixes (#85) 2016-05-27 13:30:35 -07:00
Jonathan Hui e3f0e69ea6 Replace CLI response buffer with direct output via CLI server. (#75)
* Added new Output method that allows format strings.
* Added an output FIFO to the CLI serial server.
2016-05-26 13:30:34 -07:00
Jonathan Hui 961fea2c59 Remove exit() call, it is no longer needed by the test scripts. (#73) 2016-05-26 11:53:32 -07:00