[test] fix network name capturing in expect scripts (#5284)

This fixes some expect test failures caused by the following scenario:
Sometimes the command prompt > can be put after the echo of the input
command when inputs come too fast, because we are sending the next
command as soon as we see Done, we don't wait for the next > .

This commit adds expect "> " before sending the command to fix this.
This commit is contained in:
Moandor
2020-07-29 11:36:06 -07:00
committed by GitHub
parent 7fe1d29ab4
commit 0ef8f510c5
2 changed files with 2 additions and 0 deletions
@@ -51,6 +51,7 @@ expect "extpanid"
expect -re {([0-9a-f]{16})}
set extpan $expect_out(1,string)
expect "Done"
expect "> "
send "networkname\n"
expect "networkname"
expect -re {[\r\n]([^\r\n]+?)[\r\n]}
@@ -63,6 +63,7 @@ expect "extpanid"
expect -re {([0-9a-f]{16})}
set extpan $expect_out(1,string)
expect "Done"
expect "> "
send "networkname\n"
expect "networkname"
expect -re {[\r\n]([^\r\n]+)[\r\n]}