[diag] remove redundant messages output by the diag module (#11118)

This commit is contained in:
Zhanglong Xia
2025-01-06 21:36:57 -08:00
committed by GitHub
parent b6a7f076c2
commit 3470934f74
8 changed files with 60 additions and 119 deletions
-23
View File
@@ -35,33 +35,26 @@ spawn_node 2
switch_node 1
send "diag start\n"
expect "start diagnostics mode"
expect_line "Done"
send "diag channel 11\n"
expect "set channel to 11"
expect_line "Done"
send "diag stats clear\n"
expect "stats cleared"
expect_line "Done"
switch_node 2
send "diag start\n"
expect "start diagnostics mode"
expect_line "Done"
send "diag channel 11\n"
expect "set channel to 11"
expect_line "Done"
send "diag stats clear\n"
expect "stats cleared"
expect_line "Done"
send "diag send 10 100\n"
expect "sending 0xa packet(s), length 0x64"
expect_line "Done"
sleep 2
@@ -89,17 +82,14 @@ expect "last received packet: rssi=-20, lqi=0"
expect_line "Done"
send "diag stats clear\n"
expect "stats cleared"
expect_line "Done"
switch_node 2
send "diag repeat 20 100\n"
expect "sending packets of length 0x64 at the delay of 0x14 ms"
expect_line "Done"
sleep 1
send "diag repeat stop\n"
expect "repeated packet transmission is stopped"
expect_line "Done"
switch_node 1
@@ -115,7 +105,6 @@ expect "last received packet: rssi=-20, lqi=0"
expect_line "Done"
send "diag stats clear\n"
expect "stats cleared"
expect_line "Done"
dispose_all
@@ -124,7 +113,6 @@ dispose_all
spawn_node 1
send "diag start\n"
expect "start diagnostics mode"
expect_line "Done"
send_user "input too short test\n"
@@ -143,50 +131,42 @@ send_user "shortest frame test\n"
send "diag frame 112233\n"
expect "Done"
send "diag send 1\n"
expect "length 0x3"
expect "Done"
send_user "longest frame test\n"
send "diag frame 11223344556677889900112233445566778899001122334455667788990011223344556677889900112233445566778899001122334455667788990011223344556677889900112233445566778899001122334455667788990011223344556677889900112233445566778899001122334455667788990011223344556677\n"
expect "Done"
send "diag repeat 1\n"
expect "length 0x7f"
expect "Done"
send_user "send frame with security processed\n"
send "diag frame -s 112233\n"
expect "Done"
send "diag send 1\n"
expect "length 0x3"
expect "Done"
send_user "send frame with CSMA/CA enabled\n"
send "diag frame -c 112233\n"
expect "Done"
send "diag send 1\n"
expect "length 0x3"
expect "Done"
send_user "send frame with tx power\n"
send "diag frame -p 11 112233\n"
expect "Done"
send "diag send 1\n"
expect "length 0x3"
expect "Done"
send "diag repeat stop\n"
expect "Done"
send "diag channel 11\n"
expect "set channel to 11"
expect_line "Done"
send "diag power 10\n"
expect "set tx power to 10 dBm"
expect_line "Done"
send "diag radio sleep\n"
expect "set radio from receive to sleep"
expect_line "Done"
send "diag radio state\n"
@@ -194,7 +174,6 @@ expect "sleep"
expect_line "Done"
send "diag radio receive\n"
expect "set radio from sleep to receive on channel 11"
expect_line "Done"
send "diag radio state\n"
@@ -254,8 +233,6 @@ send "diag stop\n"
expect_line "Done"
send "diag channel\n"
expect "failed"
expect "status 0xd"
expect "Error 13: InvalidState"
dispose_all
-3
View File
@@ -33,11 +33,8 @@ spawn_node 1
send "diag rcp\n"
expect "diagnostics mode is disabled"
expect_line "failed"
expect_line "status 0xd"
expect_line "Error 13: InvalidState"
send "diag start\n"
expect "start diagnostics mode"
expect_line "Done"
send "diag rcp\n"
expect "diagnostics mode is enabled"
@@ -32,12 +32,9 @@ source "tests/scripts/expect/_common.exp"
spawn_node 1
send "diag start\n"
expect "start diagnostics mode"
expect_line "Done"
send "diag powersettings 11\n"
expect "failed"
expect "status 0x17"
expect_line "Error 23: NotFound"
send "diag powersettings\n"
@@ -52,7 +49,6 @@ send "region US\n"
expect_line "Done"
send "diag start\n"
expect "start diagnostics mode"
expect_line "Done"
send "diag powersettings 11\n"
+11 -33
View File
@@ -47,11 +47,11 @@ class TestDiag(thread_cert.TestCase):
('diag start', 'Done\r\n'),
('diag invalid test\n', 'diag feature \'invalid\' is not supported'),
('diag', 'diagnostics mode is enabled\r\n'),
('diag channel 10', 'failed\r\nstatus 0x7\r\n'),
('diag channel 11', 'set channel to 11\r\n'),
('diag channel', 'channel: 11\r\n'),
('diag power -10', 'set tx power to -10 dBm\r\n'),
('diag power', 'tx power: -10 dBm\r\n'),
('diag channel 10', 'Error 7: InvalidArgs\r\n'),
('diag channel 11', 'Done\r\n'),
('diag channel', '11\r\n'),
('diag power -10', 'Done\r\n'),
('diag power', '-10\r\n'),
(
'diag stats',
'received packets: 0\r\n'
@@ -62,37 +62,15 @@ class TestDiag(thread_cert.TestCase):
'first received packet: rssi=0, lqi=0\r\n'
'last received packet: rssi=0, lqi=0\r\n',
),
(
'diag send 20 100',
r'sending 0x14 packet\(s\), length 0x64\r\n',
),
(
' diag \t send \t 20\t100',
r'sending 0x14 packet\(s\), length 0x64\r\n',
),
(
'diag repeat 100 100',
'sending packets of length 0x64 at the delay of 0x64 ms\r\n',
),
(
'diag repeat stop',
'repeated packet transmission is stopped\r\n',
),
(
'diag stop',
'received packets: 0\r\n'
r'sent success packets: ([1-9]\d*)\r\n'
r'sent error cca packets: ([0-9]\d*)\r\n'
r'sent error abort packets: ([0-9]\d*)\r\n'
r'sent error others packets: ([0-9]\d*)\r\n'
'first received packet: rssi=0, lqi=0\r\n'
'last received packet: rssi=0, lqi=0\r\n\n'
r'stop diagnostics mode\r\n',
),
('diag send 20 100', 'Done\r\n'),
(' diag \t send \t 20\t100', 'Done\r\n'),
('diag repeat 100 100', 'Done\r\n'),
('diag repeat stop', 'Done\r\n'),
('diag stop', 'Done\r\n'),
('diag', 'diagnostics mode is disabled\r\n'),
(
'diag 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32',
r'Error 7: InvalidArgs\r\n',
'Error 7: InvalidArgs\r\n',
),
]