-
Notifications
You must be signed in to change notification settings - Fork 1
/
boot.robot
74 lines (63 loc) · 2.16 KB
/
boot.robot
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
*** Settings ***
Library SerialLibrary encoding=ascii
Library String
Resource resource.robot
Force Tags boot has-serial
Suite Setup Open Serial Port
Suite Teardown Close Serial Port
*** Variables ***
${LOGIN_STR} raspberrypi login:
${SERIAL_PORT} /dev/ttyUSB0
${PROMPT} pi@raspberrypi:
*** Test cases ***
System Boots
[Timeout] 3m
Check Linux Boots
Login To Linux
Verify RPI IP Address
[Timeout] 30s
Get Host IP
RPI IP Address Is Correct
*** Keywords ***
Open Serial Port
Add Port ${SERIAL_PORT}
... baudrate=115200
... bytesize=8
... parity=N
... stopbits=1
... timeout=999
Close Serial Port
Delete All Ports
Read Until Single
[Arguments] ${expected}
${read} = SerialLibrary.Read Until terminator=${expected}
Should Contain ${read} ${expected}
Log ${read} console=yes
[Return] ${read}
Run Shell Command
[Arguments] ${command}
SerialLibrary.Write Data ${command}\n
SerialLibrary.Read Until terminator=${command}
${result} = SerialLibrary.Read Until terminator=${PROMPT}
@{words} = Split String From Right ${result} \n max_split=1
${stripped} = Strip String ${words}[0]
Log ${stripped} console=yes
[Return] ${stripped}
Check Linux Boots
Read Until Single Booting Linux on physical CPU 0x0
Read Until Single Mounted root
Read Until Single Raspbian
Read Until Single ${LOGIN_STR}
Login To Linux
SerialLibrary.Write Data \n
Read Until Single ${LOGIN_STR}
SerialLibrary.Write Data ${USERNAME}\n
Read Until Single Password:
SerialLibrary.Write Data ${PASSWORD}\n
${read} = Read Until Single ${PROMPT}
Should Contain ${read} ${PROMPT}
Get Host IP
${HOST_IP} = Run Shell Command hostname -I
Set Test Variable ${HOST_IP}
RPI IP Address Is Correct
Should Be Equal ${HOST_IP} ${RPI_IP}