mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[expect] properly configure operational dataset (#9183)
This commit is contained in:
@@ -213,11 +213,23 @@ proc get_rloc16 {} {
|
||||
}
|
||||
|
||||
proc setup_default_network {} {
|
||||
send "channel 11\n"
|
||||
send "dataset init new\n"
|
||||
expect_line "Done"
|
||||
send "panid 0xface\n"
|
||||
send "dataset channel 11\n"
|
||||
expect_line "Done"
|
||||
send "networkkey 00112233445566778899aabbccddeeff\n"
|
||||
send "dataset extpanid 000db80000000000\n"
|
||||
expect_line "Done"
|
||||
send "dataset meshlocalprefix fd00:db8::\n"
|
||||
expect_line "Done"
|
||||
send "dataset networkkey 00112233445566778899aabbccddeeff\n"
|
||||
expect_line "Done"
|
||||
send "dataset networkname OpenThread-face\n"
|
||||
expect_line "Done"
|
||||
send "dataset panid 0xface\n"
|
||||
expect_line "Done"
|
||||
send "dataset pskc c23a76e98f1a6483639b1ac1271e2e27\n"
|
||||
expect_line "Done"
|
||||
send "dataset commit active\n"
|
||||
expect_line "Done"
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,6 @@ setup_default_network
|
||||
|
||||
set timeout 1
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect_line "Done"
|
||||
|
||||
attach
|
||||
|
||||
set extaddr1 [get_extaddr]
|
||||
@@ -53,9 +50,6 @@ get_rloc16
|
||||
spawn_node 2 cli
|
||||
setup_default_network
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect_line "Done"
|
||||
|
||||
attach "router"
|
||||
|
||||
sleep 3
|
||||
@@ -65,9 +59,6 @@ get_rloc16
|
||||
spawn_node 3 cli
|
||||
setup_default_network
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect_line "Done"
|
||||
|
||||
send "macfilter addr add ${extaddr1}\n"
|
||||
expect_line "Done"
|
||||
|
||||
@@ -85,9 +76,6 @@ get_rloc16
|
||||
spawn_node 4 cli
|
||||
setup_default_network
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect_line "Done"
|
||||
|
||||
send "mode rn\n"
|
||||
expect_line "Done"
|
||||
|
||||
|
||||
@@ -30,10 +30,15 @@
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
spawn_node 1
|
||||
setup_default_network
|
||||
spawn_node 2
|
||||
|
||||
switch_node 1
|
||||
send "networkname Thread\\ Network\n"
|
||||
send "dataset init active\n"
|
||||
expect_line "Done"
|
||||
send "dataset networkname Thread\\ Network\n"
|
||||
expect_line "Done"
|
||||
send "dataset commit active\n"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect_line "Done"
|
||||
@@ -52,7 +57,11 @@ expect_line "Done"
|
||||
switch_node 1
|
||||
send "thread stop\n"
|
||||
expect_line "Done"
|
||||
send "networkname Thread\\ 网络\n"
|
||||
send "dataset init active\n"
|
||||
expect_line "Done"
|
||||
send "dataset networkname Thread\\ 网络\n"
|
||||
expect_line "Done"
|
||||
send "dataset commit active\n"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect_line "Done"
|
||||
@@ -67,7 +76,11 @@ expect_line "Done"
|
||||
switch_node 1
|
||||
send "thread stop\n"
|
||||
expect_line "Done"
|
||||
send "networkname スレッド\n"
|
||||
send "dataset init active\n"
|
||||
expect_line "Done"
|
||||
send "dataset networkname スレッド\n"
|
||||
expect_line "Done"
|
||||
send "dataset commit active\n"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect_line "Done"
|
||||
|
||||
@@ -30,11 +30,17 @@
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
spawn_node 1
|
||||
setup_default_network
|
||||
|
||||
send "dataset init active\n"
|
||||
expect_line "Done"
|
||||
send "dataset panid 0xabcd\n"
|
||||
expect_line "Done"
|
||||
send "dataset commit active\n"
|
||||
expect_line "Done"
|
||||
|
||||
send "ifconfig up\n"
|
||||
expect_line "Done"
|
||||
send "panid 0xabcd\n"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
expect_line "Done"
|
||||
|
||||
|
||||
@@ -251,6 +251,7 @@ try {
|
||||
puts "While energy scanning"
|
||||
|
||||
spawn_node 1 "rcp" "spinel+hdlc_uart://$host_pty"
|
||||
setup_default_network
|
||||
attach
|
||||
|
||||
send "scan energy 100\n"
|
||||
|
||||
@@ -30,9 +30,8 @@
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
spawn_node 1
|
||||
setup_default_network
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect_line "Done"
|
||||
send "ifconfig up\n"
|
||||
expect_line "Done"
|
||||
send "thread start\n"
|
||||
|
||||
@@ -32,9 +32,8 @@ source "tests/scripts/expect/_common.exp"
|
||||
skip_on_macos
|
||||
|
||||
spawn_node 1
|
||||
setup_default_network
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect_line "Done"
|
||||
attach
|
||||
|
||||
send "sntp query ::1 123\n"
|
||||
|
||||
@@ -32,12 +32,10 @@
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
spawn_node 1
|
||||
setup_default_network
|
||||
|
||||
set timeout 1
|
||||
|
||||
send "panid 0xface\n"
|
||||
expect_line "Done"
|
||||
|
||||
attach
|
||||
|
||||
send "udp open\n"
|
||||
|
||||
Reference in New Issue
Block a user