[test] verify realm-local multicast on POSIX (#5738)

This commit is contained in:
Yakun Xu
2020-10-29 10:37:51 -07:00
committed by GitHub
parent 4ac6e5509c
commit 0603ed1c14
9 changed files with 194 additions and 54 deletions
+38 -21
View File
@@ -55,34 +55,32 @@ proc wait_for {command success {failure {[\r\n]FAILURE_NOT_EXPECTED[\r\n]}}} {
}
}
proc spawn_node_mtd {id} {
proc spawn_node {id {type ""}} {
global spawn_id
global spawn_ids
send_user "\n# ${id}\n"
spawn $::env(MTD_COMMAND) $id
expect_after {
timeout { exit 1 }
if {${type} == ""} {
set type $::env(OT_NODE_TYPE)
}
set spawn_ids($id) $spawn_id
send_user "\n# ${id} ${type}\n"
return $spawn_id
}
proc spawn_node {id} {
global spawn_id
global spawn_ids
send_user "\n# ${id}\n"
if {[info exists ::env(RCP_COMMAND)] && $::env(RCP_COMMAND) != ""} {
spawn $::env(OT_COMMAND) "spinel+hdlc+uart://$::env(RCP_COMMAND)?forkpty-arg=$id"
} else {
spawn $::env(OT_COMMAND) $id
switch ${type} {
rcp {
spawn $::env(OT_POSIX_APPS)/ot-cli "spinel+hdlc+uart://$::env(OT_SIMULATION_APPS)/ncp/ot-rcp?forkpty-arg=$id"
send "routerselectionjitter 1\n"
expect "Done"
}
cli {
spawn $::env(OT_SIMULATION_APPS)/cli/ot-cli-ftd $id
send "routerselectionjitter 1\n"
expect "Done"
}
mtd {
spawn $::env(OT_SIMULATION_APPS)/cli/ot-cli-mtd $id
}
}
expect_after {
timeout { exit 1 }
}
@@ -127,4 +125,23 @@ proc dispose_all {} {
}
}
proc get_mleid {} {
send "ipaddr mleid\n"
expect "ipaddr mleid"
expect -re {(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4})}
set rval $expect_out(1,string)
expect "Done"
return $rval
}
proc get_extaddr {} {
send "extaddr\n"
expect -re {([0-9a-fA-F]{16})}
set rval $expect_out(1,string)
expect "Done"
return $rval
}
set timeout 10