THCI (Thread Host Controller Interface) is an implementation of the Python abstract class template
IThci, which is used by the Thread Test Harness Software to control OpenThread-based reference devices according to each test scenario.
SI (Sniffer Interface) is an implementation of the sniffer abstract class template
ISniffer, which is used by the Thread Test Harness Software to sniff all packets sent by devices.
Both OpenThread simulation and sniffer simulation are required to run on a POSIX environment. However, Harness has to be run on Windows, which is a non-POSIX environment. So two systems are needed, and their setup procedures in detail are listed in the following sections. Either two machines or one machine running two (sub)systems (for example, VM, WSL) is feasible.
Platform developers should modify the THCI implementation and/or the SI implementation directly to match their platform (for example, the path of the OpenThread repository).
Open the JSON format configuration file
ot_pathto the absolute path where the top directory of the OpenThread repository is located. For example, change the value of
ot_build.ot, update the value of
numberto be the number of OT FTD simulations needed with the corresponding version.
ot_build.otbr, update the value of
numberto be the number of OTBR simulations needed with the corresponding version.
ssh.usernameto the username to be used for connecting to the remote POSIX environment.
ssh.passwordto the password corresponding to the username above.
discovery_ifnameto the network interface that the Harness will connect to.
Note that it may be time-consuming to build all versions of
ot-cli-ftds and OTBR Docker images especially on devices such as Raspberry Pis.
Run the installation script.
Copy the directory
tools/harness-simulation from the POSIX machine to the Windows machine, and then switch to that directory.
Double click the file
harness\install.bat on Windows.
On the POSIX machine, change directory to the top of the OpenThread repository, and run the following commands.
$ cd tools/harness-simulation/posix $ ./launch_testbed.py -c config.yml
This example starts several OT FTD simulations, OTBR simulations, and sniffer simulations and can be discovered on
eth0. The number of each type of simulation is specified in the configuration file
Run the Test Harness. The information field of the device is encoded as
<tag>_<node_id>@<ip_addr>. Choose the desired device as the DUT.
Select one or more test cases to start the test.