mirror of
https://github.com/espressif/openthread.git
synced 2026-09-13 04:30:08 +00:00
[expect] refactor common functions (#5634)
* unify node creating and destroying * simplify switching between nodes
This commit is contained in:
@@ -30,8 +30,7 @@
|
||||
source "tests/scripts/expect/_common.exp"
|
||||
|
||||
set max_node 15
|
||||
set spawn_ids(1) [spawn_node 1]
|
||||
set spawn_id $spawn_ids(1)
|
||||
spawn_node 1
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
}
|
||||
@@ -45,8 +44,7 @@ wait_for "state" "leader"
|
||||
expect "Done"
|
||||
|
||||
for {set i 2} {$i <= $max_node} {incr i} {
|
||||
set spawn_ids($i) [spawn_node $i]
|
||||
set spawn_id $spawn_ids($i)
|
||||
spawn_node $i
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
}
|
||||
@@ -69,10 +67,4 @@ expect_after {
|
||||
send "child table\n"
|
||||
expect "Done"
|
||||
|
||||
for {set i 1} {$i <= $max_node} {incr i} {
|
||||
set spawn_id $spawn_ids($i)
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
}
|
||||
dispose
|
||||
}
|
||||
dispose_all
|
||||
|
||||
Reference in New Issue
Block a user