1*** Variables ***
2${URL}                        https://dl.antmicro.com/projects/renode
3${UART}                       sysbus.usart0
4${PROMPT}                     >
5
6*** Keywords ***
7Prepare Machine
8    Execute Command           mach create
9    Execute Command           machine LoadPlatformDescription @platforms/boards/sltb004a.repl
10
11    Create Terminal Tester    ${UART}
12
13*** Test Cases ***
14Should Run Baremetal CLI
15    Prepare Machine
16    Execute Command           sysbus LoadELF @${URL}/sltb004a--gecko_sdk-cli_baremetal.out-s_705812-380134bce0235a1277d0568d55b3be97d91daf02
17
18    Start Emulation
19
20    Wait For Line On Uart     Started CLI Bare-metal Example
21
22    Wait For Prompt On Uart   ${PROMPT}
23    Write Line To Uart        help
24    Wait For Line On Uart     echo_str
25
26    Wait For Prompt On Uart   ${PROMPT}
27    Write Line To Uart        echo_str test
28    Wait For Line On Uart     <<echo_str command>>
29    Wait For Line On Uart     test
30
31# Adapted from https://github.com/openthread/openthread/blob/255a326b10972097916e1bdc56e98851d625b271/tests/toranj/cli/test-001-get-set.py
32Should Pass 001 Get Set Test
33    Prepare Machine
34    Execute Command           sysbus LoadELF @${URL}/efr32mg12--ot-cli-ftd.out-s_42829512-3b09a2a9e6b0794e1612e14119760ca1ff671e8b
35
36    Start Emulation
37
38    Wait For Prompt On Uart   ${PROMPT}
39
40    Write Line To Uart        channel 21
41    Wait For Line On Uart     Done
42    Write Line To Uart        channel
43    Wait For Line On Uart     21
44    Wait For Line On Uart     Done
45
46    Write Line To Uart        extaddr 1122334455667788
47    Wait For Line On Uart     Done
48    Write Line To Uart        extaddr
49    Wait For Line On Uart     1122334455667788
50    Wait For Line On Uart     Done
51
52    Write Line To Uart        extpanid 1020031510006016
53    Wait For Line On Uart     Done
54    Write Line To Uart        extpanid
55    Wait For Line On Uart     1020031510006016
56    Wait For Line On Uart     Done
57
58    Write Line To Uart        networkkey 0123456789abcdeffecdba9876543210
59    Wait For Line On Uart     Done
60    Write Line To Uart        networkkey
61    Wait For Line On Uart     0123456789abcdeffecdba9876543210
62    Wait For Line On Uart     Done
63
64    Write Line To Uart        panid 0xabba
65    Wait For Line On Uart     Done
66    Write Line To Uart        panid
67    Wait For Line On Uart     0xabba
68    Wait For Line On Uart     Done
69
70    Write Line To Uart        mode rd
71    Wait For Line On Uart     Done
72    Write Line To Uart        mode
73    Wait For Line On Uart     rd
74    Wait For Line On Uart     Done
75
76    Write Line To Uart        routerupgradethreshold 1
77    Wait For Line On Uart     Done
78    Write Line To Uart        routerupgradethreshold
79    Wait For Line On Uart     1
80    Wait For Line On Uart     Done
81
82    Write Line To Uart        routerselectionjitter 100
83    Wait For Line On Uart     Done
84    Write Line To Uart        routerselectionjitter
85    Wait For Line On Uart     100
86    Wait For Line On Uart     Done
87
88    Write Line To Uart        ifconfig
89    Wait For Line On Uart     down
90    Wait For Line On Uart     Done
91
92    Write Line To Uart        state
93    Wait For Line On Uart     disabled
94    Wait For Line On Uart     Done
95