mirror of
https://github.com/espressif/openthread.git
synced 2026-10-04 14:57:38 +00:00
[test] fix reporting expect failure (#6869)
This commit fixes reporting expect failures by adding fail on error flag to the ot_exec_expect_script function in script/test script. This commit also fixes failing expect tests and removes expect tests on macOS for unstable issues.
This commit is contained in:
@@ -80,8 +80,8 @@ expect "channel: 15"
|
||||
expect "auto: 1"
|
||||
expect "delay: 200"
|
||||
expect "interval: 20000"
|
||||
expect "supported: { 11-26}"
|
||||
expect "favored: { 11-26}"
|
||||
expect "supported: { 11-26 }"
|
||||
expect "favored: { 11-26 }"
|
||||
expect_line "Done"
|
||||
send "channel manager something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
@@ -66,9 +66,6 @@ expect_line "Done"
|
||||
expect "coaps response from $addr_1"
|
||||
send "coaps post test/resource none Testing123\n"
|
||||
expect_line "Done"
|
||||
send "coaps get default\n"
|
||||
expect_line "Done"
|
||||
expect "coaps response from $addr_1"
|
||||
set addr_2 [get_ipaddr mleid]
|
||||
|
||||
switch_node 1
|
||||
|
||||
@@ -32,9 +32,9 @@ source "tests/scripts/expect/_common.exp"
|
||||
spawn_node 1
|
||||
|
||||
send "counters\n"
|
||||
expect "ip"
|
||||
expect "mac"
|
||||
expect "mle"
|
||||
expect "ip"
|
||||
expect_line "Done"
|
||||
send "counters mac\n"
|
||||
expect_line "Done"
|
||||
|
||||
@@ -44,7 +44,7 @@ expect -re {Network Key: [0-9a-f]{32}}
|
||||
expect -re {Network Name: [^\r\n]+}
|
||||
expect -re {PAN ID: 0x[0-9a-f]{4}}
|
||||
expect -re {PSKc: [0-9a-f]{32}}
|
||||
expect -re {Security Policy: \d+, o?n?r?c?b?}
|
||||
expect -re {Security Policy: \d+ o?n?r?c?b?}
|
||||
send "dataset pending\n"
|
||||
expect "Error 23: NotFound"
|
||||
send "dataset init active\n"
|
||||
@@ -135,7 +135,7 @@ expect "Network Key: aabbccddeeff00112233445566778899"
|
||||
expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678, onrcb"
|
||||
expect "Security Policy: 678 onrcb"
|
||||
expect_line "Done"
|
||||
|
||||
sleep 30
|
||||
@@ -157,7 +157,7 @@ expect "Network Key: aabbccddeeff00112233445566778899"
|
||||
expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678, onrcb"
|
||||
expect "Security Policy: 678 onrcb"
|
||||
expect_line "Done"
|
||||
send "dataset clear\n"
|
||||
expect_line "Done"
|
||||
@@ -177,7 +177,7 @@ expect "Network Key: aabbccddeeff00112233445566778899"
|
||||
expect "Network Name: OT-network"
|
||||
expect "PAN ID: 0xface"
|
||||
expect "PSKc: 00112233445566778899aabbccddeeff"
|
||||
expect "Security Policy: 678, onrcb"
|
||||
expect "Security Policy: 678 onrcb"
|
||||
expect_line "Done"
|
||||
send "dataset init pending\n"
|
||||
expect "Error 23: NotFound"
|
||||
|
||||
@@ -51,8 +51,8 @@ expect_line "Done"
|
||||
|
||||
switch_node 2
|
||||
send "ping ff0e::1\n"
|
||||
expect_line "Done"
|
||||
expect "16 bytes from $addr: icmp_seq=1"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 1
|
||||
send "ipmaddr del ff0e::1\n"
|
||||
|
||||
@@ -44,7 +44,7 @@ expect "2"
|
||||
expect_line "Done"
|
||||
|
||||
send "mac\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
expect "Error 35: InvalidCommand"
|
||||
send "mac something_invalid\n"
|
||||
expect "Error 35: InvalidCommand"
|
||||
send "mac retries\n"
|
||||
|
||||
@@ -167,7 +167,7 @@ expect_line "Done"
|
||||
send "route add ::/0 s low\n"
|
||||
expect_line "Done"
|
||||
send "route\n"
|
||||
expect "0:0:0:0::/0 s low"
|
||||
expect "::/0 s low"
|
||||
send "route remove ::/0\n"
|
||||
expect_line "Done"
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ send "ping ::1 1 2 0.12345 1\n"
|
||||
expect_line "Done"
|
||||
send "ping stop\n"
|
||||
expect_line "Done"
|
||||
send "ping ::1 1 2 1 1 1\n"
|
||||
send "ping ::1 1 2 1 1 1 1\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -44,7 +44,7 @@ expect_line "Done"
|
||||
send "promiscuous disable\n"
|
||||
expect_line "Done"
|
||||
send "promiscuous a\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
expect "Error 35: InvalidCommand"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -73,6 +73,7 @@ expect_line "Done"
|
||||
switch_node 1
|
||||
send "ping $addr\n"
|
||||
expect "16 bytes from $addr: icmp_seq=1"
|
||||
expect_line "Done"
|
||||
|
||||
switch_node 3
|
||||
expect -re {============================================\[len = +\d+]============================}
|
||||
|
||||
@@ -42,7 +42,7 @@ send "routereligible\n"
|
||||
expect "Enabled"
|
||||
expect_line "Done"
|
||||
send "routereligible something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
expect "Error 35: InvalidCommand"
|
||||
send "mode r\n"
|
||||
expect_line "Done"
|
||||
send "routereligible\n"
|
||||
|
||||
@@ -89,7 +89,7 @@ send "discover something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
|
||||
switch_node 1
|
||||
expect "version=2,joiner=0"
|
||||
expect -re {version=\d,joiner=0}
|
||||
|
||||
switch_node 3
|
||||
send "joiner start 123456\n"
|
||||
@@ -97,6 +97,6 @@ set timeout 10
|
||||
expect "NotFound"
|
||||
|
||||
switch_node 1
|
||||
expect "version=2,joiner=1"
|
||||
expect -re {version=\d,joiner=1}
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -64,7 +64,7 @@ switch_node 1
|
||||
send "udp help\n"
|
||||
expect_line "Done"
|
||||
send "udp connect something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
expect "Error 6: Parse"
|
||||
send "udp send -x something_invalid\n"
|
||||
expect "Error 7: InvalidArgs"
|
||||
send "udp\n"
|
||||
|
||||
@@ -37,14 +37,14 @@ expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-------------------------------------------------+-------------------------------------------------+"
|
||||
expect "| [0:0:0:0:0:0:0:0]:0 | [0:0:0:0:0:0:0:0]:0 |"
|
||||
expect -ex "| \[0:0:0:0:0:0:0:0]:0 | \[0:0:0:0:0:0:0:0]:0 |"
|
||||
expect_line "Done"
|
||||
send "udp bind :: 10001\n"
|
||||
expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-------------------------------------------------+-------------------------------------------------+"
|
||||
expect "| [0:0:0:0:0:0:0:0]:1001 | [0:0:0:0:0:0:0:0]:0 |"
|
||||
expect -ex "| \[0:0:0:0:0:0:0:0]:10001 | \[0:0:0:0:0:0:0:0]:0 |"
|
||||
expect_line "Done"
|
||||
set addr [get_ipaddr mleid]
|
||||
send "udp connect $addr 10001\n"
|
||||
@@ -52,7 +52,7 @@ expect_line "Done"
|
||||
send "netstat\n"
|
||||
expect "| Local Address | Peer Address |"
|
||||
expect "+-------------------------------------------------+-------------------------------------------------+"
|
||||
expect -re "\\| \\[0:0:0:0:0:0:0:0\\]:10001 +\\| \\[$addr\\]:10001 +\\|"
|
||||
expect -re "\\| \\\[0:0:0:0:0:0:0:0]:10001 +\\| \\\[$addr]:10001 +\\|"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -107,7 +107,7 @@ set mleid4 [get_ipaddr "mleid"]
|
||||
switch_node 1
|
||||
|
||||
send "ping ${mleid4}\n"
|
||||
expect_line "Done"
|
||||
expect "16 bytes from $mleid4: icmp_seq=1"
|
||||
expect_line "Done"
|
||||
|
||||
dispose_all
|
||||
|
||||
@@ -61,7 +61,7 @@ expect_line "Done"
|
||||
send "udp connect $prefix:bb1:ebd6:ad10:f33 1234\n"
|
||||
expect_line "Done"
|
||||
|
||||
send "udp connect :: 1\n"
|
||||
send "udp connect $prefix:1:2:3:4 4321\n"
|
||||
expect_line "Done"
|
||||
|
||||
send "udp close\n"
|
||||
|
||||
Reference in New Issue
Block a user