mirror of
https://github.com/espressif/openthread.git
synced 2026-09-02 23:30:07 +00:00
[test] enhance parsing addresses (#6045)
Expect sometimes matches the pattern before a line is fully printed to TTY. As a result, the address returned may not be accurate. This commit fixes this issue by matching line breaks.
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The OpenThread Authors.
|
||||
* 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 "openthread-posix-config.h"
|
||||
#include "platform-posix.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
namespace ot {
|
||||
namespace Posix {
|
||||
namespace Ip6Utils {
|
||||
|
||||
/**
|
||||
* This utility class converts binary IPv6 address to text format.
|
||||
*
|
||||
*/
|
||||
class Ip6AddressString
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* The constructor of this converter.
|
||||
*
|
||||
* @param[in] aAddress A pointer to a buffer holding an IPv6 address.
|
||||
*
|
||||
*/
|
||||
Ip6AddressString(const void *aAddress)
|
||||
{
|
||||
VerifyOrDie(inet_ntop(AF_INET6, aAddress, mBuffer, sizeof(mBuffer)) != nullptr, OT_EXIT_ERROR_ERRNO);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the string as a null-terminated C string.
|
||||
*
|
||||
* @returns The null-terminated C string.
|
||||
*
|
||||
*/
|
||||
const char *AsCString(void) const { return mBuffer; }
|
||||
|
||||
private:
|
||||
char mBuffer[INET6_ADDRSTRLEN];
|
||||
};
|
||||
|
||||
} // namespace Ip6Utils
|
||||
} // namespace Posix
|
||||
} // namespace ot
|
||||
@@ -151,40 +151,9 @@ unsigned int gNetifIndex = 0;
|
||||
char gNetifName[IFNAMSIZ];
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE
|
||||
#include "posix/platform/ip6_utils.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
/**
|
||||
* This utility class converts binary IPv6 address to text format.
|
||||
*
|
||||
*/
|
||||
class Ip6AddressString
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* The constructor of this converter.
|
||||
*
|
||||
* @param[in] aAddress A pointer to a buffer holding an IPv6 address.
|
||||
*
|
||||
*/
|
||||
Ip6AddressString(const void *aAddress)
|
||||
{
|
||||
VerifyOrDie(inet_ntop(AF_INET6, aAddress, mBuffer, sizeof(mBuffer)) != nullptr, OT_EXIT_ERROR_ERRNO);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the string as a null-terminated C string.
|
||||
*
|
||||
* @returns The null-terminated C string.
|
||||
*
|
||||
*/
|
||||
const char *AsCString(void) const { return mBuffer; }
|
||||
|
||||
private:
|
||||
char mBuffer[INET6_ADDRSTRLEN];
|
||||
};
|
||||
|
||||
} // namespace
|
||||
using namespace ot::Posix::Ip6Utils;
|
||||
|
||||
#ifndef OPENTHREAD_POSIX_TUN_DEVICE
|
||||
|
||||
|
||||
+12
-10
@@ -55,6 +55,10 @@
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE
|
||||
|
||||
#include "posix/platform/ip6_utils.hpp"
|
||||
|
||||
using namespace ot::Posix::Ip6Utils;
|
||||
|
||||
static const size_t kMaxUdpSize = 1280;
|
||||
|
||||
static void *FdToHandle(int aFd)
|
||||
@@ -392,26 +396,24 @@ otError otPlatUdpConnect(otUdpSocket *aUdpSocket)
|
||||
if (len > 0 && netifName[0] != '\0')
|
||||
{
|
||||
fd = FdFromHandle(aUdpSocket->mHandle);
|
||||
VerifyOrExit(setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &netifName, len) == 0, error = OT_ERROR_FAILED);
|
||||
VerifyOrExit(setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &netifName, len) == 0, {
|
||||
otLogWarnPlat("Failed to bind to device: %s", strerror(errno));
|
||||
error = OT_ERROR_FAILED;
|
||||
});
|
||||
}
|
||||
|
||||
ExitNow();
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (connect(fd, reinterpret_cast<struct sockaddr *>(&sin6), sizeof(sin6)))
|
||||
if (connect(fd, reinterpret_cast<struct sockaddr *>(&sin6), sizeof(sin6)) != 0)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
#ifdef __APPLE__
|
||||
case EAFNOSUPPORT:
|
||||
VerifyOrExit(isDisconnect, error = OT_ERROR_FAILED);
|
||||
break;
|
||||
VerifyOrExit(errno == EAFNOSUPPORT && isDisconnect);
|
||||
#endif
|
||||
|
||||
default:
|
||||
otLogWarnPlat("Failed to connect to [%s]:%u: %s", Ip6AddressString(&aUdpSocket->mPeerName.mAddress).AsCString(),
|
||||
aUdpSocket->mPeerName.mPort, strerror(errno));
|
||||
error = OT_ERROR_FAILED;
|
||||
break;
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
@@ -55,6 +55,11 @@ proc wait_for {command success {failure {[\r\n]FAILURE_NOT_EXPECTED[\r\n]}}} {
|
||||
}
|
||||
}
|
||||
|
||||
proc expect_line {line} {
|
||||
expect -re "\[\r\n \]($line)(?=\[\r\n>\])"
|
||||
return $expect_out(1,string)
|
||||
}
|
||||
|
||||
proc spawn_node {id {type ""} {radio_url ""}} {
|
||||
global spawn_id
|
||||
global spawn_ids
|
||||
@@ -81,23 +86,23 @@ proc spawn_node {id {type ""} {radio_url ""}} {
|
||||
spawn /usr/bin/env GCOV_PREFIX=$gcov_prefix $::env(OT_POSIX_APPS)/ot-cli $radio_url
|
||||
send "factoryreset\n"
|
||||
wait_for "state" "disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "routerselectionjitter 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
cli {
|
||||
spawn /usr/bin/env GCOV_PREFIX=$gcov_prefix $::env(OT_SIMULATION_APPS)/cli/ot-cli-ftd $id
|
||||
send "factoryreset\n"
|
||||
wait_for "state" "disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "routerselectionjitter 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
mtd {
|
||||
spawn /usr/bin/env GCOV_PREFIX=$gcov_prefix $::env(OT_SIMULATION_APPS)/cli/ot-cli-mtd $id
|
||||
send "factoryreset\n"
|
||||
wait_for "state" "disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,15 +131,17 @@ proc dispose_node {id} {
|
||||
|
||||
proc setup_leader {} {
|
||||
send "dataset init new\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset masterkey 00112233445566778899aabbccddeeff\n"
|
||||
expect_line "Done"
|
||||
send "dataset commit active\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
|
||||
proc dispose_all {} {
|
||||
@@ -149,18 +156,16 @@ proc dispose_all {} {
|
||||
proc get_ipaddr {type} {
|
||||
send "ipaddr $type\n"
|
||||
expect "ipaddr $type"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set rval $expect_out(1,string)
|
||||
expect "Done"
|
||||
set rval [expect_line {([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}}]
|
||||
expect_line "Done"
|
||||
|
||||
return $rval
|
||||
}
|
||||
|
||||
proc get_extaddr {} {
|
||||
send "extaddr\n"
|
||||
expect -re {([0-9a-fA-F]{16})}
|
||||
set rval $expect_out(1,string)
|
||||
expect "Done"
|
||||
set rval [expect_line {[0-9a-fA-F]{16}}]
|
||||
expect_line "Done"
|
||||
|
||||
return $rval
|
||||
}
|
||||
@@ -168,20 +173,19 @@ proc get_extaddr {} {
|
||||
proc get_rloc16 {} {
|
||||
send "rloc16\n"
|
||||
expect "rloc16"
|
||||
expect -re {([0-9a-fA-F]{4})}
|
||||
set rval $expect_out(1,string)
|
||||
expect "Done"
|
||||
set rval [expect_line {[0-9a-fA-F]{4}}]
|
||||
expect_line "Done"
|
||||
|
||||
return $rval
|
||||
}
|
||||
|
||||
proc setup_default_network {} {
|
||||
send "channel 11\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "masterkey 00112233445566778899aabbccddeeff\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
|
||||
set timeout 10
|
||||
|
||||
@@ -51,39 +51,39 @@ proc setup_node {node {mode "r"} {role "child"}} {
|
||||
expect "eui64"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set eui64 $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 1
|
||||
send "commissioner state\n"
|
||||
expect {
|
||||
"disabled" {
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "Commissioner: active"
|
||||
}
|
||||
"active" {
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
}
|
||||
send "commissioner joiner add $eui64 $::JOINER_PSK\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "netdata steeringdata check $eui64" "Done"
|
||||
|
||||
switch_node $node
|
||||
send "mode $mode\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "joiner start $::JOINER_PSK\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "" "Join success"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" $role
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 1
|
||||
send "commissioner joiner remove $eui64\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/usr/bin/expect -f
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# 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.
|
||||
#
|
||||
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
|
||||
set spawn_id [spawn_node 1]
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
|
||||
send "ping fdde:ad00:beef:0:0:ff:fe00:fc00\n"
|
||||
expect "Done"
|
||||
expect "16 bytes from "
|
||||
expect {
|
||||
"fdde:ad00:beef:0:0:ff:fe00:fc00" abort
|
||||
|
||||
-re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})} {}
|
||||
|
||||
timeout abort
|
||||
}
|
||||
|
||||
dispose
|
||||
@@ -41,6 +41,6 @@ for {set i 2} {$i <= $max_node} {incr i} {
|
||||
|
||||
set spawn_id $spawn_ids(1)
|
||||
send "child table\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -32,17 +32,17 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "channel monitor stop\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel monitor\n"
|
||||
expect "enabled: 0"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel monitor start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel monitor\n"
|
||||
expect "enabled: 1"
|
||||
expect -re {interval: \d+}
|
||||
@@ -53,28 +53,28 @@ expect "occupancies:"
|
||||
for {set i 11} {$i <= 26} {incr i} {
|
||||
expect -re "ch $i \\(0x\[0-9a-f\]{4}\\) +\\d+\\.\\d+% busy"
|
||||
}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel monitor something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
send "channel manager change 15\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel manager\n"
|
||||
expect "channel: 15"
|
||||
expect "auto: 0"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel manager select 1\n"
|
||||
expect "Error 13: InvalidState" # Because of insufficient channel monitor samples
|
||||
send "channel manager delay 200\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel manager interval 20000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel manager supported 0x7fff800\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel manager favored 0x7fff800\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel manager auto 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel manager\n"
|
||||
expect "channel: 15"
|
||||
expect "auto: 1"
|
||||
@@ -82,7 +82,7 @@ expect "delay: 200"
|
||||
expect "interval: 20000"
|
||||
expect "supported: { 11-26}"
|
||||
expect "favored: { 11-26}"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel manager something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ setup_two_nodes "-"
|
||||
|
||||
switch_node 1
|
||||
send "childsupervision interval 30\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "childsupervision interval\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "childsupervision checktimeout 30\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "childsupervision checktimeout\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -33,16 +33,8 @@ source "tests/scripts/expect/_multinode.exp"
|
||||
setup_two_nodes
|
||||
|
||||
switch_node 2
|
||||
send "extaddr\n"
|
||||
expect "extaddr"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set extaddr $expect_out(1,string)
|
||||
expect "Done"
|
||||
send "rloc16\n"
|
||||
expect "rloc16"
|
||||
expect -re {([0-9a-f]{4})}
|
||||
set rloc $expect_out(1,string)
|
||||
expect "Done"
|
||||
set extaddr [get_extaddr]
|
||||
set rloc [get_rloc16]
|
||||
|
||||
switch_node 1
|
||||
send "child table\n"
|
||||
@@ -50,13 +42,13 @@ expect "| ID | RLOC16 | Timeout | Age | LQ In | C_VN |R|D|N|Ver|CSL|Q
|
||||
expect "+-----+--------+------------+------------+-------+------+-+-+-+---+---+-------+------------------+"
|
||||
expect -re "\\| +(\\d+) \\| 0x$rloc \\| +\\d+ \\| +\\d+ \\| +\\d+ \\| +\\d+ \\|\\d\\|\\d\\|\\d\\| *\\d+\\| \\d \\| +\\d+ \\| $extaddr \\|"
|
||||
set child_id $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "child list\n"
|
||||
expect "child list"
|
||||
expect $child_id
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "child $child_id\n"
|
||||
expect "Ext Addr: $extaddr"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -33,26 +33,18 @@ source "tests/scripts/expect/_multinode.exp"
|
||||
setup_two_nodes
|
||||
|
||||
switch_node 2
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr $expect_out(1,string)
|
||||
expect "Done"
|
||||
send "rloc16\n"
|
||||
expect "rloc16"
|
||||
expect -re {([0-9a-f]{4})}
|
||||
set rloc $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr [get_ipaddr mleid]
|
||||
set rloc [get_rloc16]
|
||||
|
||||
switch_node 1
|
||||
send "childip\n"
|
||||
expect "$rloc: $addr"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "childip max 2\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "childip max\n"
|
||||
expect "2"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "childip max something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "childip something_invalid\n"
|
||||
|
||||
@@ -34,47 +34,39 @@ setup_two_nodes
|
||||
|
||||
switch_node 1
|
||||
send "coap start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap resource test/resource\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap set Testing123\n"
|
||||
expect "Done"
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_1 $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
set addr_1 [get_ipaddr mleid]
|
||||
|
||||
switch_node 2
|
||||
send "coap start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap parameters request 3000 4 3 5\n"
|
||||
expect "Transmission parameters for request:"
|
||||
expect "ACK_TIMEOUT=3000 ms, ACK_RANDOM_FACTOR=4/3, MAX_RETRANSMIT=5"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap parameters response 2500 4 3 3\n"
|
||||
expect "Transmission parameters for response:"
|
||||
expect "ACK_TIMEOUT=2500 ms, ACK_RANDOM_FACTOR=4/3, MAX_RETRANSMIT=3"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap get $addr_1 test/resource\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coap response from $addr_1 with payload: 54657374696e67313233" # ASCII of "Testing123"
|
||||
send "coap post $addr_1 test/resource con Testing123\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coap response from $addr_1"
|
||||
send "coap put $addr_1 test/resource con Testing123\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coap response from $addr_1"
|
||||
send "coap delete $addr_1 test/resource con\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coap response from $addr_1"
|
||||
send "coap post $addr_1 test/resource none Testing123\n"
|
||||
expect "Done"
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_2 $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
set addr_2 [get_ipaddr mleid]
|
||||
|
||||
switch_node 1
|
||||
expect "coap request from $addr_2 GET"
|
||||
@@ -88,20 +80,20 @@ expect "coap response sent"
|
||||
expect "coap request from $addr_2 POST with payload: 54657374696e67313233"
|
||||
send "coap resource\n"
|
||||
expect "test/resource"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap set\n"
|
||||
expect "Testing123"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap parameters request default\n"
|
||||
expect "Transmission parameters for request:"
|
||||
expect "default"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap parameters response default\n"
|
||||
expect "Transmission parameters for response:"
|
||||
expect "default"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap help\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coap parameters something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "coap get\n"
|
||||
|
||||
@@ -34,49 +34,42 @@ setup_two_nodes
|
||||
|
||||
switch_node 1
|
||||
send "coaps x509\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps resource test/resource\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps set Testing123\n"
|
||||
expect "Done"
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_1 $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
set addr_1 [get_ipaddr mleid]
|
||||
|
||||
switch_node 2
|
||||
send "coaps x509\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps connect $addr_1 5684\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coaps connected"
|
||||
send "coaps get $addr_1 test/resource\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coaps response from $addr_1 with payload: 54657374696e67313233" # ASCII of "Testing123"
|
||||
send "coaps post $addr_1 test/resource con Testing123\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coaps response from $addr_1"
|
||||
send "coaps put $addr_1 test/resource con Testing123\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coaps response from $addr_1"
|
||||
send "coaps delete $addr_1 test/resource con\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coaps response from $addr_1"
|
||||
send "coaps post $addr_1 test/resource none Testing123\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps get $addr_1 default\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "coaps response from $addr_1"
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_2 $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr_2 [get_ipaddr mleid]
|
||||
|
||||
switch_node 1
|
||||
expect "coaps request from $addr_2 GET"
|
||||
@@ -90,12 +83,12 @@ expect "coaps response sent"
|
||||
expect "coaps request from $addr_2 POST with payload: 54657374696e67313233"
|
||||
send "coaps resource\n"
|
||||
expect "test/resource"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps set\n"
|
||||
expect "Testing123"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps help\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coaps get\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "coaps\n"
|
||||
@@ -107,10 +100,10 @@ expect "Error 7: InvalidArgs"
|
||||
|
||||
switch_node 2
|
||||
send "coaps stop\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 1
|
||||
send "coaps stop\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -32,15 +32,15 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "coex disable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coex\n"
|
||||
expect "Disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coex enable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coex\n"
|
||||
expect "Enabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coex metrics\n"
|
||||
expect -re {Stopped: (true|false)}
|
||||
expect -re {Grant Glitch: \d+}
|
||||
@@ -63,7 +63,7 @@ expect -re { Grant Deactivated During Request: \d+}
|
||||
expect -re { Delayed Grant: \d+}
|
||||
expect -re { Average Request To Grant Time: \d+}
|
||||
expect -re { Grant None: \d+}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "coex something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
|
||||
@@ -35,46 +35,46 @@ setup_two_nodes
|
||||
set eui64 "d45e64fa83f81cf7"
|
||||
switch_node 1
|
||||
send "commissioner joiner add $eui64 J01NME\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "netdata steeringdata check $eui64" "Done"
|
||||
send "commissioner joiner remove $eui64\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "netdata steeringdata check $eui64" "NotFound"
|
||||
|
||||
switch_node 2
|
||||
send "commissioner state\n"
|
||||
expect "disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "Commissioner: active"
|
||||
send "commissioner state\n"
|
||||
expect "active"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner provisioningurl openthread.io\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner joiner add * J01NME 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner joiner remove *\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner sessionid\n"
|
||||
expect "commissioner sessionid"
|
||||
expect -re {(\d+)}
|
||||
set sessionid $expect_out(1,string)
|
||||
send "commissioner mgmtset sessionid $sessionid steeringdata ffffffff joinerudpport 10001\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner mgmtset sessionid $sessionid locator 0x0100\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner mgmtget sessionid steeringdata joinerudpport locator binary 0b081209\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner stop\n"
|
||||
expect "Commissioner: disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner state\n"
|
||||
expect "disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner help\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "commissioner joiner something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "commissioner mgmtget something_invalid\n"
|
||||
|
||||
@@ -34,15 +34,15 @@ spawn_node 1
|
||||
send "counters\n"
|
||||
expect "mac"
|
||||
expect "mle"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "counters mac\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "counters mle\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "counters mac reset\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "counters mle reset\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "counters mac 1\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "counters mle 1\n"
|
||||
|
||||
@@ -48,77 +48,77 @@ expect -re {Security Policy: \d+, o?n?r?c?b?}
|
||||
send "dataset pending\n"
|
||||
expect "Error 23: NotFound"
|
||||
send "dataset init active\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset activetimestamp 100\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset activetimestamp\n"
|
||||
expect "100"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
if {$channel == 11} {
|
||||
send "dataset channel 18\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset channel\n"
|
||||
expect "18"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
} else {
|
||||
send "dataset channel 11\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset channel\n"
|
||||
expect "11"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
send "dataset channelmask 0x03fff800\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset channelmask\n"
|
||||
expect "0x03fff800"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset extpanid aabbccddeeff0011\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset extpanid\n"
|
||||
expect "aabbccddeeff0011"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset masterkey aabbccddeeff00112233445566778899\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset masterkey\n"
|
||||
expect "aabbccddeeff00112233445566778899"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset meshlocalprefix fdde:4860::\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset meshlocalprefix\n"
|
||||
expect "fdde:4860:0:0::/64"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset networkname OT-network\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset networkname\n"
|
||||
expect "OT-network"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset panid\n"
|
||||
expect "0xface"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset pskc 00112233445566778899aabbccddeeff\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset pskc\n"
|
||||
expect "00112233445566778899aabbccddeeff"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset securitypolicy 678 onrcb\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset securitypolicy\n"
|
||||
expect "678 onrcb"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset pendingtimestamp 100\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset pendingtimestamp\n"
|
||||
expect "100"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset delay 30000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset delay\n"
|
||||
expect "30000"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset commit pending\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset pending\n"
|
||||
expect "Pending Timestamp: 100"
|
||||
expect "Active Timestamp: 100"
|
||||
@@ -136,13 +136,13 @@ expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678, onrcb"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 30
|
||||
|
||||
switch_node 2
|
||||
wait_for "dataset active" "Active Timestamp: 100"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset active\n"
|
||||
expect "Active Timestamp: 100"
|
||||
if {$channel == 11} {
|
||||
@@ -158,11 +158,11 @@ expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678, onrcb"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset clear\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset init active\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset\n"
|
||||
expect "Active Timestamp: 100"
|
||||
if {$channel == 11} {
|
||||
@@ -178,16 +178,12 @@ expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678, onrcb"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset init pending\n"
|
||||
expect "Error 23: NotFound"
|
||||
|
||||
switch_node 1
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr [get_ipaddr mleid]
|
||||
|
||||
switch_node 2
|
||||
send "dataset mgmtgetcommand active \
|
||||
@@ -195,60 +191,60 @@ activetimestamp pendingtimestamp masterkey networkname extpanid \
|
||||
localprefix delaytimer panid channel \
|
||||
-x 000102030405060708090a0b0e0f0c333435 \
|
||||
address $addr\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset mgmtgetcommand pending \
|
||||
activetimestamp pendingtimestamp masterkey networkname extpanid \
|
||||
localprefix delaytimer panid channel \
|
||||
-x 000102030405060708090a0b0e0f0c333435 \
|
||||
address $addr\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 1
|
||||
send "dataset init active\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset networkname Thread\\ 网络\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset commit active\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset active -x\n"
|
||||
expect "54687265616420e7bd91e7bb9c" ;# UTF-8 of "Thread 网络"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset active -x\n"
|
||||
expect "dataset active -x"
|
||||
expect -re {([0-9a-f]+)[\r\n]+Done}
|
||||
set binary $expect_out(1,string)
|
||||
send "dataset set pending $binary\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset pending -x\n"
|
||||
expect $binary
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset pending\n"
|
||||
expect "Network Name: Thread 网络"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset set active $binary\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset mgmtsetcommand active activetimestamp 200 -x 030d54687265616420e7bd91e7bb9c\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset active\n"
|
||||
expect "Network Name: Thread 网络"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset mgmtsetcommand active activetimestamp 210 -x 0301ff\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset active\n"
|
||||
expect "Active Timestamp: 200"
|
||||
expect "Network Name: Thread 网络"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset set active 03023432\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset active\n"
|
||||
expect "Network Name: 42"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset set active 0301bf\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "dataset help\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset init something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "dataset active something_invalid\n"
|
||||
@@ -266,7 +262,7 @@ expect "Error 7: InvalidArgs"
|
||||
send "dataset mgmtgetcommand active something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "dataset pskc -p 123456\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset securitypolicy 678 something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "dataset set something_invalid 00\n"
|
||||
|
||||
@@ -44,27 +44,27 @@ expect "InvalidArgs"
|
||||
send "netdata steeringdata check $discerner\n"
|
||||
expect "InvalidState"
|
||||
send "commissioner start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "Commissioner: active"
|
||||
send "commissioner joiner add 1/0 $pskd\n"
|
||||
expect "InvalidArgs"
|
||||
send "netdata steeringdata check 0xabc/12\n"
|
||||
expect "NotFound"
|
||||
send "commissioner joiner add $discerner $pskd\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "netdata steeringdata check $discerner" "Done"
|
||||
send "commissioner joiner remove $discerner\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "netdata steeringdata check $discerner" "NotFound"
|
||||
send "commissioner joiner add $discerner $pskd\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
spawn_node 2
|
||||
|
||||
send "mode r\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "joiner discerner\n"
|
||||
expect "NotFound"
|
||||
send "joiner discerner 1/1 2\n"
|
||||
@@ -82,18 +82,18 @@ expect "InvalidArgs"
|
||||
send "joiner discerner invalid/20\n"
|
||||
expect "InvalidArgs"
|
||||
send "joiner discerner clear\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "joiner discerner $discerner\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "joiner discerner\n"
|
||||
expect "$discerner"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "joiner start $pskd\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "" "Join success" "Join failed"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "child"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -32,9 +32,9 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "extaddr 99aabbccddeeff00\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "extaddr 99AABBCCDDEEFF00\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "extaddr\n"
|
||||
expect "99aabbccddeeff00"
|
||||
send "extaddr 1\n"
|
||||
|
||||
@@ -34,35 +34,32 @@ setup_two_nodes
|
||||
|
||||
switch_node 1
|
||||
send "ipmaddr add ff0e::1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ipmaddr\n"
|
||||
expect "ff0e:0:0:0:0:0:0:1"
|
||||
expect "Done"
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr $expect_out(1,string)
|
||||
expect_line "Done"
|
||||
set addr [get_ipaddr mleid]
|
||||
|
||||
switch_node 2
|
||||
send "ping ff0e::1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "16 bytes from $addr: icmp_seq=1"
|
||||
|
||||
switch_node 1
|
||||
send "ipmaddr del ff0e::1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ipmaddr del ff0e::1\n"
|
||||
expect "Error 23: NotFound"
|
||||
send "ipmaddr promiscuous enable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ipmaddr promiscuous\n"
|
||||
expect "Enabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ipmaddr promiscuous disable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ipmaddr promiscuous\n"
|
||||
expect "Disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ipmaddr something_invalid\n"
|
||||
expect "Error 35: InvalidCommand"
|
||||
|
||||
|
||||
@@ -33,12 +33,12 @@ spawn_node 1
|
||||
|
||||
send "log level\n"
|
||||
expect -re {\d}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "log level 5\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "log level\n"
|
||||
expect "5"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "log level -1\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "log level 6\n"
|
||||
|
||||
@@ -32,16 +32,16 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "mac retries direct 5\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "mac retries direct\n"
|
||||
expect "5"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "mac retries indirect 2\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "mac retries indirect\n"
|
||||
expect "2"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "mac\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
@@ -34,108 +34,108 @@ spawn_node 1
|
||||
send "macfilter\n"
|
||||
expect "Address Mode: Disabled"
|
||||
expect "RssIn List:"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr add aabbccddeeff0011\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr\n"
|
||||
expect "Disabled"
|
||||
expect "aabbccddeeff0011"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr allowlist\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr\n"
|
||||
expect "Allowlist"
|
||||
expect "aabbccddeeff0011"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter\n"
|
||||
expect "Address Mode: Allowlist"
|
||||
expect "aabbccddeeff0011"
|
||||
expect "RssIn List:"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr add 2233445566778899\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr remove aabbccddeeff0011\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr denylist\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr\n"
|
||||
expect "Denylist"
|
||||
expect "2233445566778899"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter\n"
|
||||
expect "Address Mode: Denylist"
|
||||
expect "2233445566778899"
|
||||
expect "RssIn List:"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr clear\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr disable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr\n"
|
||||
expect "Disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter\n"
|
||||
expect "Address Mode: Disabled"
|
||||
expect "RssIn List:"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr something_invalid\n"
|
||||
expect "Error 35: InvalidCommand"
|
||||
|
||||
send "macfilter rss\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss add-lqi * 2\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss add-lqi aabbccddeeff0011 3\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss\n"
|
||||
expect -re {aabbccddeeff0011 : rss -?\d+ \(lqi 3\)}
|
||||
expect -re {Default rss: -?\d+ \(lqi 2\)}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter\n"
|
||||
expect "Address Mode: Disabled"
|
||||
expect "RssIn List:"
|
||||
expect -re {aabbccddeeff0011 : rss -?\d+ \(lqi 3\)}
|
||||
expect -re {Default rss : -?\d+ \(lqi 2\)}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss remove *\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss remove aabbccddeeff0011\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss add 2233445566778899 -70\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss add * -80\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss\n"
|
||||
expect -re {2233445566778899 : rss -70 \(lqi \d\)}
|
||||
expect -re {Default rss: -80 \(lqi \d\)}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss clear\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter rss something_invalid\n"
|
||||
expect "Error 35: InvalidCommand"
|
||||
|
||||
@@ -40,129 +40,129 @@ expect -re {Weighting: \d+}
|
||||
expect -re {Data Version: \d+}
|
||||
expect -re {Stable Data Version: \d+}
|
||||
expect -re {Leader Router ID: \d+}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "help\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "bufferinfo\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ccathreshold -62\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ccathreshold\n"
|
||||
expect -- "-62 dBm"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "parent\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "delaytimermin 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "delaytimermin\n"
|
||||
expect "1"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "delaytimermin 1 2\n"
|
||||
send "counters mac 1\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
send "fem lnagain 11\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "fem lnagain\n"
|
||||
expect -- "11"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "fem\n"
|
||||
expect -- "LNA gain 11 dBm"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig down\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig\n"
|
||||
expect "down"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig\n"
|
||||
expect "up"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ipaddr add ::\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ipaddr del ::\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "leaderweight 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "leaderweight\n"
|
||||
expect "1"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "mode rdn\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "mode\n"
|
||||
expect -re "(?=.*r)(?=.*d)(?=.*n)"
|
||||
|
||||
send "parent\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "singleton\n"
|
||||
expect -re "true|false"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "state\n"
|
||||
expect "disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "txpower -10\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "txpower\n"
|
||||
expect -- "-10 dBm"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread version\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "version\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "version api\n"
|
||||
expect -re {\d+}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "version something_invalid\n"
|
||||
expect "Error 35: InvalidCommand"
|
||||
|
||||
send "joinerport 10001\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "joinerport\n"
|
||||
expect "10001"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "parentpriority 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "parentpriority\n"
|
||||
expect "1"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "pollperiod 100000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "pollperiod\n"
|
||||
expect "100000"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "prefix add ::/64 low pdcrosn\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "prefix\n"
|
||||
expect "0:0:0:0::/64 pdcrosn low"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "preferrouterid 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "route add ::/64 s low\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "route\n"
|
||||
expect "0:0:0:0::/64 s low"
|
||||
send "route remove ::/64\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "diag start\n"
|
||||
expect ": InvalidState"
|
||||
|
||||
@@ -42,16 +42,16 @@ setup_default_network
|
||||
set timeout 1
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
set extaddr1 [get_extaddr]
|
||||
|
||||
@@ -61,16 +61,16 @@ spawn_node 2 cli
|
||||
setup_default_network
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "router"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
sleep 3
|
||||
|
||||
get_rloc16
|
||||
@@ -79,22 +79,22 @@ spawn_node 3 cli
|
||||
setup_default_network
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr add ${extaddr1}\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr denylist\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "router"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
sleep 4
|
||||
|
||||
set extaddr3 [get_extaddr]
|
||||
@@ -105,25 +105,25 @@ spawn_node 4 cli
|
||||
setup_default_network
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "mode rn\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr add ${extaddr3}\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr allowlist\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "child"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
get_rloc16
|
||||
|
||||
@@ -133,7 +133,7 @@ set rloc(1) [get_ipaddr "rloc"]
|
||||
|
||||
send "networkdiagnostic get ff03::2 5 16\n"
|
||||
expect "DIAG_GET.rsp/ans from $rloc(1)"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 5
|
||||
|
||||
|
||||
@@ -33,26 +33,18 @@ source "tests/scripts/expect/_multinode.exp"
|
||||
setup_two_nodes
|
||||
|
||||
switch_node 2
|
||||
send "rloc16\n"
|
||||
expect "rloc16"
|
||||
expect -re {([0-9a-f]{4})}
|
||||
set rloc $expect_out(1,string)
|
||||
expect "Done"
|
||||
send "extaddr\n"
|
||||
expect "extaddr"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set extaddr $expect_out(1,string)
|
||||
expect "Done"
|
||||
set rloc [get_rloc16]
|
||||
set extaddr [get_extaddr]
|
||||
|
||||
switch_node 1
|
||||
send "neighbor table\n"
|
||||
expect "| Role | RLOC16 | Age | Avg RSSI | Last RSSI |R|D|N| Extended MAC |"
|
||||
expect "+------+--------+-----+----------+-----------+-+-+-+------------------+"
|
||||
expect -re "\\| +C +\\| 0x$rloc \\| +\\d+ \\| +-?\\d+ \\| +-?\\d+ \\|1\\|0\\|0\\| $extaddr \\|"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "neighbor list\n"
|
||||
expect "0x$rloc"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "neighbor something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
|
||||
@@ -35,15 +35,15 @@ setup_two_nodes
|
||||
switch_node 1
|
||||
|
||||
send "netdata help\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "netdata register\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "netdata show\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "netdata show -x\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -34,47 +34,47 @@ spawn_node 2
|
||||
|
||||
switch_node 1
|
||||
send "networkname Thread\\ Network\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "scan\n"
|
||||
expect "Thread Network"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 1
|
||||
send "thread stop\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "networkname Thread\\ 网络\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "scan\n"
|
||||
expect "Thread 网络"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 1
|
||||
send "thread stop\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "networkname スレッド\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "scan\n"
|
||||
expect "スレッド"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
Regular → Executable
+3
-3
@@ -32,14 +32,14 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "partitionid preferred 12345678\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "partitionid preferred\n"
|
||||
expect "12345678"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "partitionid invalid\n"
|
||||
expect "Error 35: InvalidCommand"
|
||||
send "partitionid\n"
|
||||
expect "0"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -34,13 +34,13 @@ source "tests/scripts/expect/_multinode.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "ping ::1 1 2 1 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ping stop\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ping ::1 1 2 0.12345 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ping stop\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ping ::1 1 2 1 1 1\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
@@ -50,11 +50,7 @@ dispose_all
|
||||
setup_two_nodes
|
||||
|
||||
switch_node 2
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr [get_ipaddr mleid]
|
||||
|
||||
switch_node 1
|
||||
send "ping $addr\n"
|
||||
|
||||
@@ -35,14 +35,14 @@ spawn_node 1
|
||||
|
||||
send "promiscuous\n"
|
||||
expect "Disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "promiscuous enable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "promiscuous\n"
|
||||
expect "Enabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "promiscuous disable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "promiscuous a\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
@@ -56,19 +56,19 @@ send "channel\n"
|
||||
expect "channel"
|
||||
expect -re {(\d+)}
|
||||
set channel $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
spawn_node 3
|
||||
send "channel $channel\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "promiscuous enable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "ipaddr\n"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 1
|
||||
send "ping $addr\n"
|
||||
@@ -79,6 +79,6 @@ expect -re {============================================\[len = +\d+]===========
|
||||
expect -re {\|( ([0-9A-Z]{2}|\.\.)){16}\|( .){16}\|}
|
||||
expect -- "-----------------------------------------------------------------------------------"
|
||||
send "promiscuous disable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -32,21 +32,21 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "pskc 00112233445566778899aabbccddeeff\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "pskc\n"
|
||||
expect "00112233445566778899aabbccddeeff"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "factoryreset\n"
|
||||
sleep 0.1
|
||||
send "networkname Test\\ Network\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "extpanid 0001020304050607\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "pskc -p 12SECRETPASSWORD34\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "pskc\n"
|
||||
expect "c3f59368445a1b6106be420a706d4cc9"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "factoryreset\n"
|
||||
sleep 0.1
|
||||
send "pskc -x\n"
|
||||
|
||||
@@ -32,9 +32,9 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "region\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "region US\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "region\n"
|
||||
expect "US"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
@@ -32,11 +32,11 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "panid 0xabcd\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 3
|
||||
|
||||
@@ -45,24 +45,24 @@ sleep 3
|
||||
|
||||
send "ifconfig\n"
|
||||
expect "down"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "panid\n"
|
||||
expect "0xabcd"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "factoryreset\n"
|
||||
sleep 3
|
||||
|
||||
send "ifconfig\n"
|
||||
expect "down"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "panid\n"
|
||||
expect "0xffff"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -33,37 +33,33 @@ source "tests/scripts/expect/_multinode.exp"
|
||||
setup_two_nodes
|
||||
|
||||
switch_node 1
|
||||
send "extaddr\n"
|
||||
expect "extaddr"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set extaddr $expect_out(1,string)
|
||||
expect "Done"
|
||||
set extaddr [get_extaddr]
|
||||
send "router list\n"
|
||||
expect "router list"
|
||||
expect -re {(\d+)}
|
||||
set router_id $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "router $router_id\n"
|
||||
expect -re {Rloc: ([0-9a-f]{4})}
|
||||
set rloc $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "router table\n"
|
||||
expect "| ID | RLOC16 | Next Hop | Path Cost | LQ In | LQ Out | Age | Extended MAC |"
|
||||
expect "+----+--------+----------+-----------+-------+--------+-----+------------------+"
|
||||
expect -re "\\| +$router_id \\| 0x$rloc \\| +\\d+ \\| +\\d+ \\| +\\d+ \\| +\\d+ \\| +\\d+ \\| $extaddr \\|"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "mode rdn\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "state router\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "router list" $router_id
|
||||
send "router $router_id\n"
|
||||
expect "Router ID: $router_id"
|
||||
expect "Rloc: $rloc"
|
||||
expect -re {Next Hop: [0-9a-f]{4}}
|
||||
expect -re {Link: [01]}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -32,22 +32,22 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "routereligible disable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "routereligible\n"
|
||||
expect "Disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "routereligible enable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "routereligible\n"
|
||||
expect "Enabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "routereligible something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "mode r\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "routereligible\n"
|
||||
expect "Disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "routereligible enable\n"
|
||||
expect "Error 27: NotCapable"
|
||||
|
||||
|
||||
@@ -35,32 +35,28 @@ setup_two_nodes
|
||||
spawn_node 3
|
||||
|
||||
switch_node 1
|
||||
send "extaddr\n"
|
||||
expect "extaddr"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set extaddr $expect_out(1,string)
|
||||
expect "Done"
|
||||
set extaddr [get_extaddr]
|
||||
send "panid\n"
|
||||
expect "panid"
|
||||
expect -re {([0-9a-f]{4})}
|
||||
set pan $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "extpanid\n"
|
||||
expect "extpanid"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set extpan $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "> "
|
||||
send "networkname\n"
|
||||
expect "networkname"
|
||||
expect -re {[\r\n]([^\r\n]+?)[\r\n]}
|
||||
set network $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel\n"
|
||||
expect "channel"
|
||||
expect -re {(\d+)}
|
||||
set channel $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 3
|
||||
send "scan $channel\n"
|
||||
@@ -74,16 +70,16 @@ expect "+----+------+"
|
||||
for {set i 11} {$i <= 26} {incr i} {
|
||||
expect -re "\\| +$i \\| +-?\\d+ \\|"
|
||||
}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "scan energy 100 $channel\n"
|
||||
expect "| Ch | RSSI |"
|
||||
expect "+----+------+"
|
||||
expect -re "\\| +$channel \\| +-?\\d+ \\|"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 3
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "discover $channel\n"
|
||||
expect "| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI |"
|
||||
expect "+---+------------------+------------------+------+------------------+----+-----+-----+"
|
||||
|
||||
@@ -34,31 +34,25 @@ setup_two_nodes
|
||||
|
||||
switch_node 2
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 11001\n"
|
||||
expect "Done"
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_2 $expect_out(1,string)
|
||||
expect_line "Done"
|
||||
set addr_2 [get_ipaddr mleid]
|
||||
|
||||
switch_node 1
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_1 $expect_out(1,string)
|
||||
set addr_1 [get_ipaddr mleid]
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 11002\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp connect $addr_2 11001\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp send -s 10\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp send -x a68656c6c6f\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp send -t there\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
expect "10 bytes from $addr_1 11002 0123456789"
|
||||
@@ -68,7 +62,7 @@ expect "5 bytes from $addr_1 11002 there"
|
||||
|
||||
switch_node 1
|
||||
send "udp help\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp connect something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "udp send -x something_invalid\n"
|
||||
@@ -78,17 +72,17 @@ expect "Error 7: InvalidArgs"
|
||||
|
||||
send "udp linksecurity\n"
|
||||
expect "Enabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp linksecurity disable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp linksecurity\n"
|
||||
expect "Disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp linksecurity enable\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp linksecurity\n"
|
||||
expect "Enabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "udp linksecurity something_invalid\n"
|
||||
expect "Error 35: InvalidCommand"
|
||||
|
||||
@@ -32,33 +32,33 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "unsecureport remove all\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport get\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport add 123\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport add 456\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport get\n"
|
||||
expect "123 456"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport remove 123\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport get\n"
|
||||
expect "456"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport remove all\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport get\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "unsecureport invalid_command\n"
|
||||
expect "Error 35: InvalidCommand"
|
||||
|
||||
@@ -27,13 +27,15 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
spawn $env(OT_POSIX_APPS)/ot-cli "spinel+hdlc+uart://$env(OT_SIMULATION_APPS)/ncp/ot-rcp?forkpty-arg=1&cca-threshold=-100"
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
}
|
||||
send "ccathreshold\n"
|
||||
expect -- "-100"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "\x04"
|
||||
expect eof
|
||||
|
||||
@@ -43,7 +45,7 @@ expect_after {
|
||||
}
|
||||
send "ccathreshold\n"
|
||||
expect -- "-128"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "\x04"
|
||||
expect eof
|
||||
|
||||
@@ -53,7 +55,7 @@ expect_after {
|
||||
}
|
||||
send "ccathreshold\n"
|
||||
expect "127"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "\x04"
|
||||
expect eof
|
||||
|
||||
|
||||
@@ -33,25 +33,25 @@ spawn_node 1
|
||||
|
||||
send "diag rcp\n"
|
||||
expect "diagnostics mode is disabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "diag start\n"
|
||||
expect "start diagnostics mode"
|
||||
expect "status 0x00"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "diag rcp\n"
|
||||
expect "diagnostics mode is enabled"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "diag rcp channel\n"
|
||||
expect "failed"
|
||||
expect "status 0x7"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "diag rcp channel 11\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "diag rcp power\n"
|
||||
expect "failed"
|
||||
expect "status 0x7"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "diag rcp power 10\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -27,13 +27,15 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
spawn $env(OT_POSIX_APPS)/ot-cli "spinel+hdlc+uart://$env(OT_SIMULATION_APPS)/ncp/ot-rcp?forkpty-arg=1&fem-lnagain=10"
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
}
|
||||
send "fem lnagain\n"
|
||||
expect "10"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "\x04"
|
||||
expect eof
|
||||
|
||||
@@ -43,7 +45,7 @@ expect_after {
|
||||
}
|
||||
send "fem lnagain\n"
|
||||
expect -- "-128"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "\x04"
|
||||
expect eof
|
||||
|
||||
|
||||
@@ -33,24 +33,24 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1 "rcp" "spinel+hdlc+uart://$env(OT_SIMULATION_APPS)/ncp/ot-rcp?max-power-table=11,12,13,14,15,16,17,18,19,20,21,22,23,24,-1,0x7f&forkpty-arg=1"
|
||||
send "channel supported\n"
|
||||
expect "0x3fff800"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel preferred\n"
|
||||
expect "0x3fff800"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "txpower 20\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "txpower\n"
|
||||
expect "11 dBm"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "\x04"
|
||||
expect eof
|
||||
# allows all channels by default
|
||||
spawn_node 1 "rcp" "spinel+hdlc+uart://$env(OT_SIMULATION_APPS)/ncp/ot-rcp?forkpty-arg=1"
|
||||
send "channel supported\n"
|
||||
expect "0x7fff800"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel preferred\n"
|
||||
expect "0x7fff800"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "\x04"
|
||||
expect eof
|
||||
|
||||
@@ -70,36 +70,28 @@ try {
|
||||
setup_two_nodes "-" false
|
||||
|
||||
switch_node 2
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_2 $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr_2 [get_ipaddr mleid]
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 11003\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "pollperiod 100000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 1
|
||||
|
||||
switch_node 1
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_1 $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr_1 [get_ipaddr mleid]
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 11004\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp connect $addr_2 11003\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp send hello\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp send there\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 1
|
||||
|
||||
@@ -113,7 +105,7 @@ try {
|
||||
|
||||
switch_node 2
|
||||
send "pollperiod 1000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "5 bytes from $addr_1 11004 hello"
|
||||
expect "5 bytes from $addr_1 11004 there"
|
||||
|
||||
@@ -134,34 +126,26 @@ try {
|
||||
setup_two_nodes "-" false
|
||||
|
||||
switch_node 2
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_2 $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr_2 [get_ipaddr mleid]
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 11003\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "pollperiod 100000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 1
|
||||
|
||||
switch_node 1
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr_1 $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr_1 [get_ipaddr mleid]
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 11004\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp connect $addr_2 11003\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp send hello\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 1
|
||||
|
||||
@@ -175,7 +159,7 @@ try {
|
||||
|
||||
switch_node 2
|
||||
send "pollperiod 1000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "5 bytes from $addr_1 11004 hello"
|
||||
|
||||
dispose_all
|
||||
@@ -191,32 +175,24 @@ try {
|
||||
|
||||
spawn_node 1 "rcp" "spinel+hdlc_uart://$host_pty"
|
||||
setup_leader
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr(1) $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr(1) [get_ipaddr mleid]
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 11004\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
set max_children 15
|
||||
set max_children 10
|
||||
for {set i 2} {$i <= $max_children + 1} {incr i} {
|
||||
spawn_node $i
|
||||
setup_node $i "-"
|
||||
switch_node $i
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr($i) $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr($i) [get_ipaddr mleid]
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 11003\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "pollperiod 100000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
|
||||
sleep 1
|
||||
@@ -224,7 +200,7 @@ try {
|
||||
switch_node 1
|
||||
for {set i 2} {$i <= $max_children + 1} {incr i} {
|
||||
send "udp send $addr($i) 11003 hello\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
}
|
||||
|
||||
sleep 1
|
||||
@@ -240,13 +216,13 @@ try {
|
||||
for {set i 7} {$i <= 9} {incr i} {
|
||||
switch_node $i
|
||||
send "pollperiod 1000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "5 bytes from $addr(1) 11004 hello"
|
||||
}
|
||||
|
||||
switch_node 4
|
||||
send "udp send $addr(5) 11003 hello_from_node_4\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
if {$::env(THREAD_VERSION) != "1.1"} {
|
||||
expect "5 bytes from $addr(1) 11004 hello"
|
||||
}
|
||||
@@ -263,7 +239,7 @@ try {
|
||||
|
||||
switch_node 5
|
||||
send "pollperiod 1000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "17 bytes from $addr(4) 11003 hello_from_node_4"
|
||||
|
||||
dispose_all
|
||||
@@ -273,11 +249,11 @@ try {
|
||||
|
||||
spawn_node 1 "rcp" "spinel+hdlc_uart://$host_pty"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "scan energy 100\n"
|
||||
expect "| Ch | RSSI |"
|
||||
@@ -296,7 +272,7 @@ try {
|
||||
for {set i 11} {$i <= 26} {incr i} {
|
||||
expect -re "\\| +$i \\| +-?\\d+ \\|"
|
||||
}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
} finally {
|
||||
|
||||
@@ -32,7 +32,7 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "rcp version\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "rcp something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
|
||||
@@ -31,44 +31,40 @@ source "tests/scripts/expect/_common.exp"
|
||||
|
||||
spawn_node 1 "rcp" "spinel+hdlc+uart://$env(OT_SIMULATION_APPS)/ncp/ot-rcp?forkpty-arg=--sleep-to-tx&forkpty-arg=1"
|
||||
send "dataset init new\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "dataset commit active\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "extaddr\n"
|
||||
expect "extaddr"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set extaddr $expect_out(1,string)
|
||||
expect "Done"
|
||||
set extaddr [get_extaddr]
|
||||
send "panid\n"
|
||||
expect "panid"
|
||||
expect -re {([0-9a-f]{4})}
|
||||
set pan $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "extpanid\n"
|
||||
expect "extpanid"
|
||||
expect -re {([0-9a-f]{16})}
|
||||
set extpan $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "> "
|
||||
send "networkname\n"
|
||||
expect "networkname"
|
||||
expect -re {[\r\n]([^\r\n]+)[\r\n]}
|
||||
set network $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "channel\n"
|
||||
expect "channel"
|
||||
expect -re {(\d+)}
|
||||
set channel $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
spawn_node 2 "rcp" "spinel+hdlc+uart://$env(OT_SIMULATION_APPS)/ncp/ot-rcp?forkpty-arg=--sleep-to-tx&forkpty-arg=2"
|
||||
send "scan\n"
|
||||
|
||||
@@ -32,12 +32,12 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "networktime 20 200\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "networktime\n"
|
||||
expect -re {Network Time: \d+us \((unsynchronized|resync needed|synchronized)\)}
|
||||
expect "Time Sync Period: 20s"
|
||||
expect "XTAL Threshold: 200ppm"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "networktime something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
|
||||
@@ -32,16 +32,16 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "dns resolve ipv6.google.com ::1 53\n"
|
||||
expect "DNS response for ipv6.google.com"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -33,6 +33,6 @@ spawn_node 1
|
||||
|
||||
send "netif\n"
|
||||
expect -re {[\r\n][^\r\n:]+?:\d+}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -30,33 +30,29 @@
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
spawn_node 1
|
||||
setup_leader
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-----------------------------------------------+-----------------------------------------------+"
|
||||
expect "| 0:0:0:0:0:0:0:0:* | 0:0:0:0:0:0:0:0:* |"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 10001\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-----------------------------------------------+-----------------------------------------------+"
|
||||
expect "| 0:0:0:0:0:0:0:0:10001 | 0:0:0:0:0:0:0:0:* |"
|
||||
expect "Done"
|
||||
send "ipaddr mleid\n"
|
||||
expect "ipaddr mleid"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr $expect_out(1,string)
|
||||
expect_line "Done"
|
||||
set addr [get_ipaddr mleid]
|
||||
send "udp connect $addr 10001\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-----------------------------------------------+-----------------------------------------------+"
|
||||
expect -re "\\| 0:0:0:0:0:0:0:0:10001 +\\| $addr:10001 +\\|"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -40,13 +40,13 @@ spawn_node 1
|
||||
setup_default_network
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
set extaddr1 [get_extaddr]
|
||||
|
||||
@@ -54,10 +54,10 @@ spawn_node 2 cli
|
||||
setup_default_network
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "router"
|
||||
sleep 3
|
||||
@@ -66,16 +66,16 @@ spawn_node 3 cli
|
||||
setup_default_network
|
||||
|
||||
send "macfilter addr add ${extaddr1}\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr denylist\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "router"
|
||||
sleep 4
|
||||
@@ -86,19 +86,19 @@ spawn_node 4 cli
|
||||
setup_default_network
|
||||
|
||||
send "mode rn\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr add ${extaddr3}\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr allowlist\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "child"
|
||||
|
||||
@@ -107,7 +107,7 @@ set mleid4 [get_ipaddr "mleid"]
|
||||
switch_node 1
|
||||
|
||||
send "ping ${mleid4}\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
expect "16 bytes from $mleid4: icmp_seq=1"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -38,16 +38,16 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "sntp query ::1 123\n"
|
||||
expect -re {SNTP response - Unix time: \d+ \(era: \d+\)}
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -36,35 +36,35 @@ spawn_node 1
|
||||
set timeout 1
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "thread start\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
wait_for "state" "leader"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "udp open\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "udp bind :: 1234\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "dataset active\n"
|
||||
expect -re {Mesh Local Prefix: ([0-9a-f:]*)::\/64}
|
||||
set prefix $expect_out(1,string)
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "udp connect $prefix:bb1:ebd6:ad10:f33 1234\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "udp connect :: 1\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
send "udp close\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
Regular → Executable
@@ -34,15 +34,12 @@ spawn_node 1
|
||||
|
||||
spawn_node 2 mtd
|
||||
send "csl period 5000\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
setup_two_nodes "-" false
|
||||
|
||||
switch_node 1
|
||||
send "ipaddr mleid\n"
|
||||
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
|
||||
set addr $expect_out(1,string)
|
||||
expect "Done"
|
||||
set addr [get_ipaddr "mleid"]
|
||||
|
||||
switch_node 2
|
||||
send "ping $addr\n"
|
||||
|
||||
@@ -34,8 +34,8 @@ setup_two_nodes "-"
|
||||
|
||||
switch_node 2
|
||||
send "mac send emptydata\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
send "mac send datarequest\n"
|
||||
expect "Done"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
Reference in New Issue
Block a user