Skip to content

Commit 558188e

Browse files
committed
lib/bios/menus.robot: support for scrolling if boot menu list is > 11
Signed-off-by: Maciej Pijanowski <[email protected]>
1 parent 3ef2c62 commit 558188e

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

lib/bios/menus.robot

+31
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,37 @@ Get Boot Menu Construction
2828
# ENTER to select boot device
2929
# ESC to exit
3030
${construction}= Parse Menu Snapshot Into Construction ${menu} 1 3
31+
# The maximum number of entries in boot menu is 11 right now. When we have
32+
# more, the list can be scrolled.
33+
# TODO: Is there a better way of checking if the list can be scrolled?
34+
# The UP/DOWN arrows are not drawn on serial on the first readout of
35+
# the menu, it seems.
36+
${no_entries}= Get Length ${construction}
37+
IF ${no_entries} == 11
38+
# 1. Remember first and last entries (last entry in the first screen)
39+
${first_entry}= Get From List ${construction} 0
40+
41+
# 2. Go down by 10 entries
42+
Press Key N Times 10 ${ARROW_DOWN}
43+
Sleep 1s
44+
Read From Terminal
45+
# 3. Keep going down one by one, until we reach the first_entry again
46+
FOR ${iter} IN RANGE 0 100
47+
Press Key N Times 1 ${ARROW_DOWN}
48+
${out}= Read From Terminal Until Regexp > .*
49+
Log ${out}
50+
${lines}= Split To Lines ${out}
51+
${entry}= Get From List ${lines} -1
52+
${entry}= Strip String ${entry}
53+
${entry}= Strip String ${entry} characters=>
54+
${entry}= Strip String ${entry}
55+
IF '${entry}' != '${first_entry}'
56+
Append To List ${construction} ${entry}
57+
ELSE
58+
BREAK
59+
END
60+
END
61+
END
3162
RETURN ${construction}
3263

3364
Enter Boot Menu Tianocore And Return Construction
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
*** Settings ***
2+
Documentation This suite verifies the correct operation of keywords
3+
... reading out the boot manager when populated with multiple
4+
... entries and must be scroleld through
5+
6+
Library Collections
7+
Library OperatingSystem
8+
Library Process
9+
Library String
10+
Library Telnet timeout=30 seconds connection_timeout=120 seconds
11+
Library SSHLibrary timeout=90 seconds
12+
Library RequestsLibrary
13+
# TODO: maybe have a single file to include if we need to include the same
14+
# stuff in all test cases
15+
Resource ../sonoff-rest-api/sonoff-api.robot
16+
Resource ../rtectrl-rest-api/rtectrl.robot
17+
Resource ../variables.robot
18+
Resource ../keywords.robot
19+
Resource ../keys.robot
20+
Resource ../pikvm-rest-api/pikvm_comm.robot
21+
22+
# TODO:
23+
# - document which setup/teardown keywords to use and what are they doing
24+
# - go threough them and make sure they are doing what the name suggest (not
25+
# exactly the case right now)
26+
Suite Setup Run Keyword
27+
... Prepare Test Suite
28+
Suite Teardown Run Keyword
29+
... Log Out And Close Connection
30+
31+
32+
*** Test Cases ***
33+
Enter Boot Menu Tianocore
34+
[Documentation] Test Enter Boot Menu kwd
35+
Prepare EFI Partition With System Files
36+
Power On
37+
${boot_menu}= Enter Boot Menu Tianocore And Return Construction
38+
${no_entries}= Get Length ${boot_menu}
39+
Should Be True ${no_entries} > 11

0 commit comments

Comments
 (0)