mirror of
https://github.com/espressif/openthread.git
synced 2026-09-17 22:50:07 +00:00
[test] set default paths of expect scripts (#10530)
This commit adds default paths for expect scripts to make it easier for running expect scripts. With this change, we can run expect tests as follows: ```bash ./script/cmake-build simulation ./script/cmake-build posix ./tests/scripts/expect/cli-ping.exp OT_NODE_TYPE=rcp ./tests/scripts/expect/cli-ping.exp ``` This commit also updates an existing test to cover the change.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
set -euxo pipefail
|
||||
|
||||
IFACE_NAME="dummy116"
|
||||
EXPECT_TEST=tests/scripts/expect/cli-ping.exp
|
||||
EXPECT_TEST=./tests/scripts/expect/cli-ping.exp
|
||||
|
||||
cleanup()
|
||||
{
|
||||
@@ -59,24 +59,27 @@ setup_dummy116()
|
||||
test_ipv6()
|
||||
{
|
||||
setup_dummy116
|
||||
OT_SIMULATION_LOCAL_HOST=$IFACE_NAME ./script/test build expect $EXPECT_TEST
|
||||
OT_SIMULATION_LOCAL_HOST=$IP6ADDR ./script/test build expect $EXPECT_TEST
|
||||
OT_SIMULATION_LOCAL_HOST=$IFACE_NAME $EXPECT_TEST
|
||||
OT_SIMULATION_LOCAL_HOST=$IP6ADDR $EXPECT_TEST
|
||||
|
||||
OT_NODE_TYPE=rcp OT_SIMULATION_LOCAL_HOST=$IFACE_NAME ./script/test build expect $EXPECT_TEST
|
||||
OT_NODE_TYPE=rcp OT_SIMULATION_LOCAL_HOST=$IP6ADDR ./script/test build expect $EXPECT_TEST
|
||||
OT_NODE_TYPE=rcp OT_SIMULATION_LOCAL_HOST=$IFACE_NAME $EXPECT_TEST
|
||||
OT_NODE_TYPE=rcp OT_SIMULATION_LOCAL_HOST=$IP6ADDR $EXPECT_TEST
|
||||
}
|
||||
|
||||
test_ipv4()
|
||||
{
|
||||
OT_SIMULATION_LOCAL_HOST=lo ./script/test build expect $EXPECT_TEST
|
||||
OT_SIMULATION_LOCAL_HOST=127.0.0.1 ./script/test build expect $EXPECT_TEST
|
||||
OT_SIMULATION_LOCAL_HOST=lo $EXPECT_TEST
|
||||
OT_SIMULATION_LOCAL_HOST=127.0.0.1 $EXPECT_TEST
|
||||
|
||||
OT_NODE_TYPE=rcp OT_SIMULATION_LOCAL_HOST=lo ./script/test build expect $EXPECT_TEST
|
||||
OT_NODE_TYPE=rcp OT_SIMULATION_LOCAL_HOST=127.0.0.1 ./script/test build expect $EXPECT_TEST
|
||||
OT_NODE_TYPE=rcp OT_SIMULATION_LOCAL_HOST=lo $EXPECT_TEST
|
||||
OT_NODE_TYPE=rcp OT_SIMULATION_LOCAL_HOST=127.0.0.1 $EXPECT_TEST
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
./script/cmake-build posix
|
||||
./script/cmake-build simulation
|
||||
|
||||
test_ipv4
|
||||
test_ipv6
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user