1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

tests/shell: Test cancelling a line with ctrl-C.

Send garbage, cancel it and issue a valid command. No errors should
ocurr.
This commit is contained in:
Juan Carrano 2019-01-16 17:45:25 +01:00
parent 3f46863426
commit 2946f4b192

View File

@ -27,6 +27,18 @@ EXPECTED_PS = (
'\t 2 | running Q | 7'
)
# In native we are directly executing the binary (no terminal program). We must
# therefore use Ctrl-V (DLE or "data link escape") before Ctrl-C to send a
# literal ETX instead of SIGINT.
# When using a board it is also a problem because we are using a "user friendly"
# terminal that interprets Ctrl-C. So until we have rawterm we must also use
# ctrl-v in boards.
DLE = '\x16'
CONTROL_C = DLE+'\x03'
CONTROL_D = DLE+'\x04'
CMDS = (
('start_test', ('[TEST_START]')),
('end_test', ('[TEST_END]')),
@ -38,6 +50,8 @@ CMDS = (
('help', EXPECTED_HELP),
('echo a string', ('\"echo\"\"a\"\"string\"')),
('ps', EXPECTED_PS),
('garbage1234'+CONTROL_C, ('>')), # test cancelling a line
('help', EXPECTED_HELP),
('reboot', ('test_shell.'))
)