Skip to content

Commit a65b588

Browse files
committed
WiP
Signed-off-by: Mateusz Maciejewski <[email protected]>
1 parent 6d8895a commit a65b588

File tree

3 files changed

+97
-57
lines changed

3 files changed

+97
-57
lines changed

dasharo-compatibility/os-bsd-anysense.robot

Lines changed: 61 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ Resource ../keys.robot
1212
# Log Out And Close Connection - elementary teardown keyword for all tests.
1313
Suite Setup Run Keywords
1414
... Prepare Test Suite
15-
#... AND
16-
#... Restore Secure Boot Defaults
1715
Suite Teardown Run Keywords
18-
... Run Keyword If ${SECURE_BOOT_SUPPORT} and ${TESTS_IN_FIRMWARE_SUPPORT} Set Secure Boot State To Disabled
19-
... AND
2016
... Log Out And Close Connection
2117
Test Setup Run Keyword
2218
... Restore Initial DUT Connection Method
@@ -30,40 +26,67 @@ ${PFSENSE_PROMPT}= [2.7.2-RELEASE][[email protected]]/root
3026
PFS001.502 Boot pfSense LTS CE (serial output) from disk after cold-boot
3127
[Documentation] Boot pfSense LTS CE (serial output) from disk after cold-boot
3228
Power On
29+
# TBD
30+
31+
OPN001.503 Boot OPNsense (serial output) from disk after cold-boot
32+
[Documentation] Boot OPNsense (serial output) from disk after cold-boot
33+
Power On
34+
Boot OPN
35+
# TBD
3336

3437
PFS002.502 Boot pfSense LTS CE (serial output) from disk after warm-boot
38+
[Documentation] Boot pfSense LTS CE (serial output) from disk after warm-boot
39+
... does not use rtcwake!!!
40+
Power On
41+
Boot PfSense
42+
Enter Pf Sense Shell
43+
Write Into Terminal poweroff
3544
Power On
45+
Boot PfSense
3646

3747
PFS003.502 Boot pfSense LTS CE (serial output) from disk after reboot
48+
[Documentation] Boot pfSense LTS CE (serial output) from disk after reboot
3849
Power On
50+
Boot PfSense
51+
Enter Pf Sense Shell
52+
Write Into Terminal reboot
53+
Boot PfSense
3954

4055
PFS004.502 Boot pfSense LTS CE (serial output) Installer into rescue shell
4156
Power On
4257
Boot PfSense Installer
43-
Enter pfSense Rescue Shell
44-
45-
OPN001.503 OPNsense stable (serial output) installation on Hard Disk
46-
Power On
47-
Boot OPNsense Installer
58+
Enter PfSense Rescue Shell
59+
${output}= Execute Command In Terminal ls
60+
Should Contain ${output} COPYRIGHT
61+
Should Contain ${output} .profile
4862

49-
OPN001.503 Boot OPNsense stable (serial output) from Hard Disk
63+
PFS005.502 Preseed pfSense Installer
5064
Power On
51-
52-
PFS001.502 pfSense stable (serial output) installation on Hard Disk
65+
Boot PfSense Installer
66+
Enter PfSense Rescue Shell
67+
Execute Command In Terminal
68+
... awk -v sq="'" -v dq='"' -v ROOT_LABEL=PFBOOT '/^NEWFS_ESP=/ { print "NEWFS_ESP=" sq "newfs_msdos -L " ROOT_LABEL " " dq "%s" dq sq; next; }; { print; }' /usr/libexec/bsdinstall/zfsboot > /tmp/zfsboot
69+
Execute Command In Terminal mount -u /
70+
Execute Command In Terminal mv /tmp/zfsboot /usr/libexec/bsdinstall/zfsboot
71+
Execute Command In Terminal chmod +x /usr/libexec/bsdinstall/zfsboot
72+
Execute Command In Terminal sync
73+
${output}= Execute Command In Terminal grep PFBOOT /usr/libexec/bsdinstall/zfsboot
74+
Should Contain ${output} PFBOOT
75+
76+
# There's no OPN005.503, preseed requires another FreeBSD system
77+
78+
PFS006.502 Boot pfSense Installer
5379
Power On
5480
Boot PfSense Installer
55-
# Enter pfSense Rescue Shell
56-
Install PsSense On Sata Drive
81+
Execute Manual Step Click OK to PASS, after test ends, connect to DUT via serial and continue.
5782

58-
PFS001.002 Boot pfSense stable (serial output) from Hard Disk
83+
OPN006.503 Boot OPNsense Installer
5984
Power On
60-
Boot Pf Sense
85+
Boot OPNsense Installer
86+
Execute Manual Step Click OK to PASS, after test ends, connect to DUT via serial and continue.
6187

6288

6389
*** Keywords ***
64-
# Relabel pfSense ESP
65-
#
66-
6790
Boot PfSense Installer
6891
[Documentation] Run /EFI/BOOT/bootx64.efi file from PFEFI-labeled partition;
6992
... Select console type vt100 and accept the license
@@ -87,13 +110,20 @@ Boot OPNsense Installer
87110
Read From Terminal Until FreeBSD/amd64 (OPNsense.localdomain) (ttyu0)
88111
Read From Terminal Until login:
89112

113+
Enter PfSense Shell
114+
Write Into Terminal 8
115+
Read From Terminal Until ${PFSENSE_PROMPT}
116+
Set Prompt For Terminal ${PFSENSE_PROMPT}
117+
90118
Enter PfSense Rescue Shell
91-
${menu}= Read From Terminal Until OK
119+
${menu}= Read From Terminal Until <Cancel>
92120
# end would be 5 but it's 3 due to two empty lines
93121
${construction}= Parse Menu Snapshot Into Construction ${menu} 5 3
94-
Enter Submenu From Snapshot ${construction} Rescue Shell${SPACE * 8}Launch a shell for rescue operations
95-
Write Into Terminal root
96-
Write Into Terminal root
122+
Enter Submenu From Snapshot
123+
... ${construction}
124+
... Rescue Shell${SPACE_*_8}Launch a shell for rescue operations
125+
... "APP"
126+
Set Prompt For Terminal \#
97127

98128
Enter OPN Sense Rescue Shell:
99129
Read From Terminal FreeBSD/amd64 (OPNsense.localdomain) (ttyu0)
@@ -104,17 +134,18 @@ Enter OPN Sense Rescue Shell:
104134
Read From Terminal Until Enter an option:
105135
Write Into Terminal 8
106136

107-
Boot Pf Sense
108-
[Documentation] PFBOOT -> /efi/freebsd/loader.efi
137+
Boot PfSense
138+
[Documentation] PFBOOT -> /efi/boot/bootx64.efi
109139
Enter Boot From File
110140
Enter Volume In File Explorer PFBOOT
111141
Execute File In File Explorer efi
112-
Execute File In File Explorer freebsd
113-
Execute File In File Explorer loader.efi
142+
Execute File In File Explorer boot
143+
Execute File In File Explorer bootx64.efi
114144
Read From Terminal Until Enter an option:
115-
Write Into Terminal 8
116-
Read From Terminal Until ${PFSENSE_PROMPT}
117145

118146
Boot OPN Sense
119147
Enter Boot From File
120-
148+
Enter Volume In File Explorer OPNBOOT
149+
Execute File In File Explorer efi
150+
Execute File In File Explorer boot
151+
Execute File In File Explorer bootx64.efi

keys.robot

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
*** Variables ***
2-
${ARROW_UP}= \x1b\x5b\x41
3-
${ARROW_DOWN}= \x1b\x5b\x42
4-
${ARROW_RIGHT}= \x1b\x5b\x43
5-
${ARROW_LEFT}= \x1b\x5b\x44
6-
${F1}= \x1b\x4f\x50
7-
${F2}= \x1b\x4f\x51
8-
${F3}= \x1b\x4f\x52
9-
${F4}= \x1b\x4f\x53
10-
${F5}= \x1b\x5b\x31\x35\x7e
11-
${F6}= \x1b\x5b\x31\x37\x7e
12-
${F7}= \x1b\x5b\x31\x38\x7e
13-
${F8}= \x1b\x5b\x31\x39\x7e
14-
${F9}= \x1b\x5b\x32\x30\x7e
15-
${F10}= \x1b\x5b\x32\x31\x7e
16-
${F11}= \x1b\x5b\x32\x33\x7e
17-
${F12}= \x1b\x5b\x32\x34\x7e
18-
${CTRL_B}= \x02
19-
${CTRL_C}= \x03
20-
${CTRL_D}= \x04
21-
${ESC}= \x1b
22-
${ENTER}= \x0d
23-
${BACKSPACE}= \x08
24-
${KEY_SPACE}= \x20
25-
${DELETE}= \x1b\x5b\x33\x7e
26-
${KEY_PLUS}= \x2b
2+
${ARROW_UP}= \x1b\x5b\x41
3+
${ARROW_DOWN}= \x1b\x5b\x42
4+
${ARROW_RIGHT}= \x1b\x5b\x43
5+
${ARROW_LEFT}= \x1b\x5b\x44
6+
${ARROW_UP_APP}= \x1b\x4f\x41
7+
${ARROW_DOWN_APP}= \x1b\x4f\x42
8+
${ARROW_RIGHT_APP}= \x1b\x4f\x43
9+
${ARROW_LEFT_APP}= \x1b\x4f\x44
10+
${F1}= \x1b\x4f\x50
11+
${F2}= \x1b\x4f\x51
12+
${F3}= \x1b\x4f\x52
13+
${F4}= \x1b\x4f\x53
14+
${F5}= \x1b\x5b\x31\x35\x7e
15+
${F6}= \x1b\x5b\x31\x37\x7e
16+
${F7}= \x1b\x5b\x31\x38\x7e
17+
${F8}= \x1b\x5b\x31\x39\x7e
18+
${F9}= \x1b\x5b\x32\x30\x7e
19+
${F10}= \x1b\x5b\x32\x31\x7e
20+
${F11}= \x1b\x5b\x32\x33\x7e
21+
${F12}= \x1b\x5b\x32\x34\x7e
22+
${CTRL_B}= \x02
23+
${CTRL_C}= \x03
24+
${CTRL_D}= \x04
25+
${ESC}= \x1b
26+
${ENTER}= \x0d
27+
${BACKSPACE}= \x08
28+
${KEY_SPACE}= \x20
29+
${DELETE}= \x1b\x5b\x33\x7e
30+
${KEY_PLUS}= \x2b

lib/bios/menus.robot

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,17 +423,22 @@ Enter Submenu From Snapshot
423423
... === Arguments ===
424424
... - ``${menu}``: ``string`` - the submenu construction or snapshot
425425
... - ``${option}``: ``string`` - the name of the submenu to enter
426+
... - ``${cursor_key_mode}``: ``string`` - VT100 cursor key mode, APP for BSD
426427
...
427428
... === Return Value ===
428429
... None
429430
...
430431
... === Effects ===
431432
... - A setup submenu is entered
432-
[Arguments] ${menu} ${option}
433+
[Arguments] ${menu} ${option} ${cursor_key_mode}="ST"
433434

434435
${index}= Get Index Of Matching Option In Menu ${menu} ${option}
435436
Should Not Be Equal As Integers ${index} -1 msg=Option ${option} not found in menu
436-
Press Key N Times And Enter ${index} ${ARROW_DOWN}
437+
IF ${cursor_key_mode} == "APP"
438+
Press Key N Times And Enter ${index} ${ARROW_DOWN_APP}
439+
ELSE
440+
Press Key N Times And Enter ${index} ${ARROW_DOWN}
441+
END
437442

438443
Enter Submenu From Snapshot And Return Construction
439444
[Documentation] Enter given Setup Menu Tianocore option after entering

0 commit comments

Comments
 (0)