diff --git a/.travis/before_install.sh b/.travis/before_install.sh index 173f9ffb7..296750db9 100755 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -72,7 +72,6 @@ cd /tmp || die } [ $BUILD_TARGET != posix-ncp ] || { - pip install blessed || die pip install ipaddress || die pip install scapy || die pip install pyserial || die diff --git a/tests/scripts/Makefile.am b/tests/scripts/Makefile.am index c3fe2a2ab..825b6da40 100644 --- a/tests/scripts/Makefile.am +++ b/tests/scripts/Makefile.am @@ -236,7 +236,6 @@ TESTS = \ $(NULL) XFAIL_NCP_TESTS = \ - thread-cert/Cert_5_3_10_AddressQuery.py \ thread-cert/Cert_5_6_06_NetworkDataExpiration.py \ thread-cert/Cert_5_6_08_ContextManagement.py \ thread-cert/Cert_9_2_13_EnergyScan.py \ diff --git a/tests/scripts/thread-cert/Cert_5_3_10_AddressQuery.py b/tests/scripts/thread-cert/Cert_5_3_10_AddressQuery.py index 157d4d3e6..221f98766 100755 --- a/tests/scripts/thread-cert/Cert_5_3_10_AddressQuery.py +++ b/tests/scripts/thread-cert/Cert_5_3_10_AddressQuery.py @@ -38,7 +38,7 @@ ROUTER2 = 3 ROUTER3 = 4 SED2 = 5 -class Cert_5_3_9_AddressQuery(unittest.TestCase): +class Cert_5_3_10_AddressQuery(unittest.TestCase): def setUp(self): self.nodes = {} for i in range(1,6): diff --git a/tests/scripts/thread-cert/node.py b/tests/scripts/thread-cert/node.py index 2001606ef..0c2290043 100755 --- a/tests/scripts/thread-cert/node.py +++ b/tests/scripts/thread-cert/node.py @@ -86,9 +86,10 @@ class Node: cmd += ' %d' % nodeid print ("%s" % cmd) - self.pexpect = pexpect.spawn(cmd, timeout=2) + self.pexpect = pexpect.spawn(cmd, timeout=4) time.sleep(0.1) self.pexpect.expect('spinel-cli >') + self.debug(int(os.getenv('DEBUG', '0'))) def __init_soc(self, nodeid): """ Initialize a System-on-a-chip node connected via UART. """ diff --git a/tools/spinel-cli/spinel-cli.py b/tools/spinel-cli/spinel-cli.py index 9a060f736..ca539a8e8 100644 --- a/tools/spinel-cli/spinel-cli.py +++ b/tools/spinel-cli/spinel-cli.py @@ -1322,8 +1322,10 @@ class WpanApi(SpinelCodec): if (prop == SPINEL_PROP_STREAM_NET): pkt = IPv6(value[2:]) if ICMPv6EchoReply in pkt: + timenow = int(round(time.time() * 1000)) & 0xFFFFFFFF + timedelta = (timenow - unpack('>I', pkt.data)[0]) print "\n%d bytes from %s: icmp_seq=%d hlim=%d time=%dms" % ( - pkt.plen, pkt.src, pkt.seq, pkt.hlim, 80) + pkt.plen, pkt.src, pkt.seq, pkt.hlim, timedelta) return if (tid != self.tid_filter) or (prop != self.prop_filter): return @@ -1484,6 +1486,7 @@ class WpanDiagsCmd(Cmd, SpinelCodec): 'channel', 'child', 'childtimeout', + 'commissioner', 'contextreusedelay', 'counter', 'discover', @@ -1817,6 +1820,44 @@ class WpanDiagsCmd(Cmd, SpinelCodec): """ self.handle_property(line, SPINEL_PROP_THREAD_CHILD_TIMEOUT, 'L') + def do_commissioner(self, line): + """ + These commands are enabled when configuring with --enable-commissioner. + + \033[1m + commissioner start + \033[0m + Start the Commissioner role on this node. + \033[2m + > commissioner start + Done + \033[0m\033[1m + commissioner stop + \033[0m + Stop the Commissioner role on this node. + \033[2m + > commissioner stop + Done + \033[0m\033[1m + commissioner panid + \033[0m + Perform panid query. + \033[2m + > commissioner panid 57005 4294967295 ff33:0040:fdde:ad00:beef:0:0:1 + Conflict: dead, 00000800 + Done + \033[0m\033[1m + commissioner energy + \033[0m + Perform energy scan. + \033[2m + > commissioner energy 327680 2 32 1000 fdde:ad00:beef:0:0:ff:fe00:c00 + Energy: 00050000 0 0 0 0 + Done + \033[0m + """ + pass + def do_contextreusedelay(self, line): """ contextreusedelay @@ -2297,7 +2338,9 @@ class WpanDiagsCmd(Cmd, SpinelCodec): # Generate local ping packet and send directly via spinel. ML64 = self.prop_get_value(SPINEL_PROP_IPV6_ML_ADDR) ML64 = str(ipaddress.IPv6Address(ML64)) - ping_req = str(IPv6(src=ML64, dst=addr)/ICMPv6EchoRequest()) + timenow = int(round(time.time() * 1000)) & 0xFFFFFFFF + timenow = pack('>I', timenow) + ping_req = str(IPv6(src=ML64, dst=addr)/ICMPv6EchoRequest()/timenow) self.wpanApi.ip_send(ping_req) # Let handler print result except: