mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 12:47:47 +00:00
Add OpenThread THCI python script for Thread Certification testing. (#374)
This commit is contained in:
@@ -639,6 +639,7 @@ examples/platforms/cc2538/Makefile
|
||||
examples/platforms/posix/Makefile
|
||||
tools/Makefile
|
||||
tools/harness-automation/Makefile
|
||||
tools/harness-thci/Makefile
|
||||
tools/spi-hdlc-adapter/Makefile
|
||||
tests/Makefile
|
||||
tests/scripts/Makefile
|
||||
|
||||
@@ -32,6 +32,7 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
|
||||
DIST_SUBDIRS = \
|
||||
harness-automation \
|
||||
harness-thci \
|
||||
spi-hdlc-adapter \
|
||||
$(NULL)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# Copyright (c) 2016, Nest Labs, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
|
||||
EXTRA_DIST = \
|
||||
ARM.py \
|
||||
README.md \
|
||||
$(NULL)
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
@@ -0,0 +1,58 @@
|
||||
OpenThread THCI
|
||||
===============
|
||||
|
||||
OpenThread THCI(Thread Host Controller Interface) is implemented according
|
||||
to the python abstract class template-"IThci" that is provided by GRL. It's
|
||||
intented to be called by Thread Test Harness Software to control the reference
|
||||
unit behavior.
|
||||
|
||||
## Restriction ##
|
||||
|
||||
Currently Test Harness Software only supports three kinds of reference unit
|
||||
officially: ARM, NXP(Freescale) and SiLabs. We make OpenThread THCI be able
|
||||
to interact with Test Harness Software with the aid of the official THCI class
|
||||
name of our partner ARM. And We are using TI CC2538DK as a target hardware platform
|
||||
for reference unit.
|
||||
|
||||
OpenThread THCI works along with Thread Test Harness Software on Windows OS.
|
||||
|
||||
## Environment Setup ##
|
||||
|
||||
1. install or update essential module `pexpect_serial` with pip command.
|
||||
Used pexpect_serial module version is 0.4.4
|
||||
|
||||
> pip install pexpect_serial
|
||||
|
||||
If there is already `pexpect_serial` installed, just need to upgrade it.
|
||||
|
||||
> pip install pexpect_serial --upgrade
|
||||
|
||||
If there is no 'pip' command installed before, please follow the below instructions to install 'pip' on
|
||||
Windows OS first.
|
||||
|
||||
1). Download the pip python source code from "https://pypi.python.org/pypi/pip#downloads"
|
||||
|
||||
2). Unzip the source package and go to the pip directory then install.
|
||||
|
||||
> python setup.py install
|
||||
|
||||
3). Add "pip" executable file path in the Environment Variables.
|
||||
|
||||
# add "C\:Python27\Scripts" to environment variable "Path".
|
||||
|
||||
2. Copy the new installed or upgraded `pexpect_serial` packages to Harness' Python2.7 directory.
|
||||
|
||||
> copy C:\Python27\Lib\site-packages\pexpect_serial C:\GRL\Thread1.1\Python27\Lib\site-packages\
|
||||
> copy C:\Python27\Lib\site-packages\pexpect_serial-0.4.4-py2.7.egg-info C:\GRL\Thread1.1\Python27\Lib\site-packages\
|
||||
|
||||
3. Replace the origin "ARM.py" in Harness THCI directory with OpenThread THCI python script in /tools/harness-thci
|
||||
(the same name "ARM.py").
|
||||
|
||||
4. Connect sniffer and CC2538DK as reference unit to Host PC.
|
||||
|
||||
5. Launch Thread Test Harness Software and modify the default configuration if needed then click "Start".
|
||||
|
||||
6. Drag ARM:NXP FRDM-K64F with FireFly 6LoWPAN SHIELD reference unit to Test Bed list with desired number.
|
||||
|
||||
7. Select one or multiple test cases to execute.
|
||||
|
||||
Reference in New Issue
Block a user