Skip to content

Commit

Permalink
unify Enter Setup Menu kwd for uefi and seabios
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Król <[email protected]>
  • Loading branch information
pietrushnic committed Nov 29, 2024
1 parent 237bb18 commit 77e2b9a
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 74 deletions.
20 changes: 10 additions & 10 deletions dasharo-compatibility/cpu-cores-count.robot
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ CCC002.001 Check core count with HT enabled
CCC003.001 Check core count (HT Enabled, P: All, E: 0) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option ActiveECores 0
Expand All @@ -72,7 +72,7 @@ CCC003.001 Check core count (HT Enabled, P: All, E: 0) (Ubuntu)
CCC004.001 Check core count (HT Enabled, P: All, E: All) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option ActiveECores All active
Expand All @@ -89,7 +89,7 @@ CCC004.001 Check core count (HT Enabled, P: All, E: All) (Ubuntu)
CCC005.001 Check core count (HT Disabled, P: All, E: 0) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option HyperThreading ${FALSE}
Expand All @@ -106,7 +106,7 @@ CCC005.001 Check core count (HT Disabled, P: All, E: 0) (Ubuntu)
CCC006.001 Check core count (HT Disabled, P: All, E: 0) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option ActiveECores 0
Expand All @@ -123,7 +123,7 @@ CCC006.001 Check core count (HT Disabled, P: All, E: 0) (Ubuntu)
CCC007.001 Check core count (HT Enabled, P: 1, E: A) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option ActivePCores 1
Expand All @@ -140,7 +140,7 @@ CCC007.001 Check core count (HT Enabled, P: 1, E: A) (Ubuntu)
CCC008.001 Check core count (HT Disabled, P: 1, E: A) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option HyperThreading ${FALSE}
Expand All @@ -157,7 +157,7 @@ CCC008.001 Check core count (HT Disabled, P: 1, E: A) (Ubuntu)
CCC009.001 Check core count (HT Enabled, P: 1, E: 1) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option HyperThreading ${TRUE}
Expand All @@ -176,7 +176,7 @@ CCC009.001 Check core count (HT Enabled, P: 1, E: 1) (Ubuntu)
CCC010.001 Check core count (HT Disabled, P: 1, E: 1) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option HyperThreading ${FALSE}
Expand All @@ -194,7 +194,7 @@ CCC010.001 Check core count (HT Disabled, P: 1, E: 1) (Ubuntu)
CCC011.001 Check core count (HT Enabled, P: A, E: 1) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option HyperThreading ${TRUE}
Expand All @@ -212,7 +212,7 @@ CCC011.001 Check core count (HT Enabled, P: A, E: 1) (Ubuntu)
CCC012.001 Check core count (HT Disabled, P: A, E: 1) (Ubuntu)
Depends On ${INTEL_HYBRID_ARCH_SUPPORT}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset
Set UEFI Option HyperThreading ${FALSE}
Expand Down
2 changes: 1 addition & 1 deletion dasharo-compatibility/custom-boot-menu-key.robot
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ CBK002.001 Custom setup menu key
Skip If not ${CUSTOM_SETUP_MENU_KEY_SUPPORT} CBK002.001 not supported
Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} CBK002.001 not supported
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Read From Terminal Until ${SETUP_MENU_STRING}
4 changes: 2 additions & 2 deletions dasharo-compatibility/dasharo-tools-suite.robot
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ DTS003.001 DTS option reboot DUT works correctly
Write Into Terminal R
# Switch back to serial on PiKVM devices
Restore Initial DUT Connection Method
Enter Setup Menu Tianocore
Enter Setup Menu

DTS004.001 DTS accessing shell works correctly
[Documentation] This test aims to verify that shell can be accessed in
Expand Down Expand Up @@ -128,5 +128,5 @@ DTS008.001 DTS option power-off DUT works correctly
Boot Dasharo Tools Suite iPXE
Write Into Terminal P
Set DUT Response Timeout 30s
${status}= Run Keyword And Return Status Enter Setup Menu Tianocore
${status}= Run Keyword And Return Status Enter Setup Menu
Should Not Be True ${status}
8 changes: 4 additions & 4 deletions dasharo-compatibility/memory-profile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ MPS001.001 Switching to XMP profile
Telnet.Set Timeout 5 min
# Boot and remember current memory speed
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${old_speed}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.*
Should Not Be Empty ${old_speed}
Expand All @@ -54,7 +54,7 @@ MPS001.001 Switching to XMP profile
Set Option State ${memory_menu} Memory SPD Profile XMP#1 (predefined
Save Changes And Reset
# Verify that frequency has changed
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${new_speed}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.*
Should Not Be Empty ${new_speed}
Expand All @@ -66,7 +66,7 @@ MPS002.001 Switching back to JEDEC profile
Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} MPS002.001 not supported
# Boot and remember current memory speed
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${old_speed}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.*
Should Not Be Empty ${old_speed}
Expand All @@ -80,7 +80,7 @@ MPS002.001 Switching back to JEDEC profile
Set Option State ${memory_menu} Memory SPD Profile JEDEC (safe
Save Changes And Reset
# Verify that frequency has changed
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${new_speed}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.*
Should Not Be Empty ${new_speed}
Expand Down
14 changes: 7 additions & 7 deletions dasharo-compatibility/power-after-fail.robot
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PSF002.001 Powered Off State Restoration Test
${pwr_menu}= Enter Dasharo Submenu ${dasharo_menu} Power Management Options
Set Option State ${pwr_menu} Power state after Powered Off
Save Changes And Reset
Enter Setup Menu Tianocore
Enter Setup Menu
Simulate Power Failure
${output}= Run Keyword And Return Status
... Enter Setup Menu Tianocore And Return Construction
Expand All @@ -64,9 +64,9 @@ PSF003.001 Powered On State Restoration Test
${pwr_menu}= Enter Dasharo Submenu ${dasharo_menu} Power Management Options
Set Option State ${pwr_menu} Power state after Powered On
Save Changes And Reset
Enter Setup Menu Tianocore
Enter Setup Menu
Simulate Power Failure
Enter Setup Menu Tianocore
Enter Setup Menu

PSF004.001 Previous Power State Restoration Test - Powered Off
[Documentation] This test ensures that the feature is able to correctly
Expand All @@ -79,12 +79,12 @@ PSF004.001 Previous Power State Restoration Test - Powered Off
${pwr_menu}= Enter Dasharo Submenu ${dasharo_menu} Power Management Options
Set Option State ${pwr_menu} Power state after The state at the moment of power failure
Save Changes And Reset
Enter Setup Menu Tianocore
Enter Setup Menu
# Power button press to power off the machine
Rte Power On
Simulate Power Failure
${output}= Run Keyword And Return Status
... Enter Setup Menu Tianocore
... Enter Setup Menu
Should Not Be True ${output}

PSF004.002 Previous Power State Restoration Test - Powered On
Expand All @@ -98,6 +98,6 @@ PSF004.002 Previous Power State Restoration Test - Powered On
${pwr_menu}= Enter Dasharo Submenu ${dasharo_menu} Power Management Options
Set Option State ${pwr_menu} Power state after The state at the moment of power failure
Save Changes And Reset
Enter Setup Menu Tianocore
Enter Setup Menu
Simulate Power Failure
Enter Setup Menu Tianocore
Enter Setup Menu
12 changes: 6 additions & 6 deletions dasharo-compatibility/setup-menu-information.robot
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SET001.001 CPU clock speed displayed in setup menu
... correctly indicated in setup menu.
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${cpu_line}= Get Lines Matching Regexp ${out} .*GHz
Should Not Be Empty ${cpu_line} CPU clock speed not found
Expand All @@ -45,7 +45,7 @@ SET002.001 RAM speed displayed in setup menu
... indicated in setup menu.
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${ram_line}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.*
Should Not Be Empty ${ram_line} RAM speed not found
Expand All @@ -58,7 +58,7 @@ SET003.001 RAM size displayed in setup menu
... indicated in setup menu.
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${ram_line}= Get Lines Matching Regexp ${out} .*MB RAM.*
Should Not Be Empty ${ram_line} RAM size not found
Expand All @@ -72,7 +72,7 @@ SET004.001 Expected CPU clock speed displayed in setup menu
Depends On Variable \${PLATFORM_CPU_SPEED}

Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${cpu_line}= Get Lines Matching Regexp ${out} .*GHz
Should Not Be Empty ${cpu_line} CPU clock speed not found
Expand All @@ -86,7 +86,7 @@ SET005.001 Expected RAM speed displayed in setup menu
Depends On Variable \${PLATFORM_RAM_SPEED}

Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${ram_line}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.*
Should Not Be Empty ${ram_line} RAM speed not found
Expand All @@ -100,7 +100,7 @@ SET006.001 Expected RAM size displayed in setup menu
Depends On Variable \${PLATFORM_RAM_SIZE}

Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${out}= Read From Terminal Until <Enter>=Select Entry
${ram_line}= Get Lines Matching Regexp ${out} .*MB RAM.*
Should Not Be Empty ${ram_line} RAM size not found
Expand Down
12 changes: 6 additions & 6 deletions dasharo-security/uefi-password.robot
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PSW002.001 Password setting mechanism correctness checking
Power On
Set Password 5 Times
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
${output}= Read From Terminal Until password
Should Contain ${output} Please input admin password

Expand All @@ -69,7 +69,7 @@ PSW003.001 Attempt to log in with a correct password
Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PSW003.001 not supported
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} PSW003.001 not supported
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Read From Terminal Until password
Type In The Password ${DEFAULT_PASSWORD}
# "ontinue" is a string that appears both in correct password screen
Expand All @@ -84,7 +84,7 @@ PSW004.001 Attempt to log in with an incorrect password
Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PSW004.001 not supported
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} PSW004.001 not supported
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Read From Terminal Until password
Type In The Password ${WRONG_PASSWORD}
# "ontinue" is a string that appears both in correct password screen
Expand All @@ -99,7 +99,7 @@ PSW005.001 Attempt to log in with an incorrect password 3 times
Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PSW005.001 not supported
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} PSW005.001 not supported
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Read From Terminal Until password
FOR ${counter} IN RANGE 0 2
Type In The Password ${WRONG_PASSWORD}
Expand All @@ -118,7 +118,7 @@ PSW006.001 Attempt to turn off setup password functionality
Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PSW006.001 not supported
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} PSW006.001 not supported
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Read From Terminal Until password
Type In The Password ${DEFAULT_PASSWORD}
${setup_menu}= Get Setup Menu Construction
Expand All @@ -137,7 +137,7 @@ PSW006.001 Attempt to turn off setup password functionality
Should Contain ${result} New password is updated successfully
Press Key N Times 1 ${ENTER}
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Sleep 1s
${output}= Read From Terminal
Should Not Contain ${output} Please input admin password
Expand Down
13 changes: 13 additions & 0 deletions lib/bios/common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ Enter Boot Menu And Return Construction
${menu}= Get Boot Menu Construction
RETURN ${menu}

Enter Setup Menu
[Documentation] Enter Setup Menu with key specified in platform-configs.
Read From Terminal Until ${FW_STRING}
IF '${DUT_CONNECTION_METHOD}' == 'pikvm'
Single Key PiKVM ${SETUP_MENU_KEY}
ELSE
Write Bare Into Terminal ${SETUP_MENU_KEY}
IF '${BIOS_LIB}' == 'seabios'
${menu}= Get Boot Menu Construction
Enter Menu From Snapshot ${menu} \[setup\]
END
END

Parse Menu Snapshot Into Construction
[Documentation] Breaks grabbed menu data into lines.
[Arguments] ${menu} ${lines_top} ${lines_bot}
Expand Down
13 changes: 2 additions & 11 deletions lib/bios/edk2.robot
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ Get Boot Menu Construction
END
RETURN ${construction}

Enter Setup Menu Tianocore
[Documentation] Enter Setup Menu with key specified in platform-configs.
Read From Terminal Until ${FW_STRING}
IF '${DUT_CONNECTION_METHOD}' == 'pikvm'
Single Key PiKVM ${SETUP_MENU_KEY}
ELSE
Write Bare Into Terminal ${SETUP_MENU_KEY}
END

Get Setup Menu Construction
[Documentation] Keyword allows to get and return setup menu construction.
[Arguments] ${checkpoint}=Select Entry
Expand All @@ -84,7 +75,7 @@ Get Menu Construction

Enter Setup Menu Tianocore And Return Construction
[Documentation] Enters Setup Menu and returns Setup Menu construction
Enter Setup Menu Tianocore
Enter Setup Menu
${menu}= Get Setup Menu Construction
RETURN ${menu}

Expand Down Expand Up @@ -580,7 +571,7 @@ Make Sure That Network Boot Is Enabled
Get Firmware Version From Tianocore Setup Menu
[Documentation] Keyword allows to read firmware version from Tianocore
... Setup menu header.
Enter Setup Menu Tianocore
Enter Setup Menu
${output}= Read From Terminal Until Select Entry
${firmware_line}= Get Lines Containing String ${output} Dasharo (coreboot+UEFI)
${firmware_version}= Get Regexp Matches ${firmware_line} v\\d{1,}\.\\d{1,}\.\\d{1,}
Expand Down
14 changes: 1 addition & 13 deletions lib/bios/seabios.robot
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ Get Boot Menu Construction
${construction}= Parse Menu Snapshot Into Construction ${menu} 1 0
RETURN ${construction}

Enter Sortbootorder
[Documentation] Enter sortbootorder with Boot Menu Construction.
Enter Boot Menu
${menu}= Get Boot Menu Construction
Enter Menu From Snapshot ${menu} \[setup\]

Get Sortbootorder Menu Construction
[Documentation] Keyword allows to get and return sortbootorder menu construction.
[Arguments] ${checkpoint}=Save configuration and exit
Expand All @@ -40,12 +34,6 @@ Get Sortbootorder Menu Construction
${menu}= Parse Menu Snapshot Into Construction ${out} 7 0
RETURN ${menu}

Enter Setup Menu SeaBIOS And Return Construction
[Documentation] Enters Setup Menu and returns Setup Menu construction
Enter Setup Menu SeaBIOS
${menu}= Get Setup Menu Construction
RETURN ${menu}

Get Option State
[Documentation] Gets menu construction and option name as arguments.
... Returns option state, which can be: True or False.
Expand Down Expand Up @@ -185,7 +173,7 @@ Save Sortbootorder Changes

Enable Network/PXE Boot
[Documentation] Enable Network/PXE Boot and save.
Enter Sortbootorder
Enter Setup Menu
${menu}= Get Sortbootorder Menu Construction
${menu}= Set Option State And Return Construction ${menu} Network/PXE boot Enabled
List Should Contain Value ${menu} n Network/PXE boot - Currently Enabled
Expand Down
2 changes: 1 addition & 1 deletion lib/options/uefi-setup-menu.robot
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Get UEFI Option
Reset UEFI Options To Defaults
[Documentation] Resets all UEFI options to defaults
Power On
Enter Setup Menu Tianocore
Enter Setup Menu
Reset To Defaults Tianocore
Save Changes And Reset

Expand Down
Loading

0 comments on commit 77e2b9a

Please sign in to comment.