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.
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.
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.
* 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.
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.
* 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
* 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.