diff --git a/.github/workflows/qemu-self-test-seabios.yml b/.github/workflows/qemu-self-test-seabios.yml new file mode 100644 index 0000000000..18355ac25e --- /dev/null +++ b/.github/workflows/qemu-self-test-seabios.yml @@ -0,0 +1,53 @@ +name: Keywords self-tests for Dasharo (coreboot+SeaBIOS) on QEMU Q35 + +on: [push, pull_request] + +jobs: + qemu: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Set up QEMU + run: | + sudo apt-get update + sudo apt-get install qemu-system-x86-64 swtpm + + # Based on: https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ + # It mentiones enteprise large-runners, let's see if it works + # on regular public runners as well + - name: Enable KVM group perms + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Start QEMU in background + run: | + ./scripts/ci/qemu-run.sh nographic seabios & + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Start keywords self-tests with QEMU + run: | + ./scripts/ci/qemu-self-test-seabios.sh + + - name: Save artifacts + uses: actions/upload-artifact@v4 + with: + name: "qemu-logs" + path: | + ./logs/ + retention-days: 30 diff --git a/.github/workflows/qemu-self-test.yml b/.github/workflows/qemu-self-test.yml index d53ee6fca1..06140390bd 100644 --- a/.github/workflows/qemu-self-test.yml +++ b/.github/workflows/qemu-self-test.yml @@ -1,4 +1,4 @@ -name: Keywords self-tests with QEMU +name: Keywords self-tests for Dasharo (coreboot+UEFI) on QEMU Q35 on: [push, pull_request] @@ -28,7 +28,7 @@ jobs: - name: Start QEMU in background run: | - ./scripts/ci/qemu-run.sh nographic firmware & + ./scripts/ci/qemu-run.sh nographic uefi & - name: Set up Python uses: actions/setup-python@v2 diff --git a/dasharo-compatibility/apu-configuration-menu.robot b/dasharo-compatibility/apu-configuration-menu.robot index e2e2fe0bb9..09a9e75590 100644 --- a/dasharo-compatibility/apu-configuration-menu.robot +++ b/dasharo-compatibility/apu-configuration-menu.robot @@ -8,7 +8,7 @@ Library SSHLibrary timeout=90 seconds Library RequestsLibrary # TODO: maybe have a single file to include if we need to include the same # stuff in all test cases -Resource ../lib/bios/menus.robot +Resource ../lib/bios/edk2.robot Resource ../variables.robot Resource ../keywords.robot Resource ../keys.robot @@ -46,7 +46,7 @@ APU002.001 Enable apu2 watchdog # We're in the setup menu. Now just wait until the platform resets. Wait a # bit longer than the timeout to give the platform to actually reset. Set DUT Response Timeout 70s - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} APU003.001 Disable apu2 watchdog [Documentation] Disable the watchdog after enabling it to verify it does @@ -62,7 +62,7 @@ APU003.001 Disable apu2 watchdog ${platform_has_reset}= Set Variable ${TRUE} Set DUT Response Timeout 70s TRY - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} EXCEPT ${platform_has_reset}= Set Variable ${FALSE} END @@ -85,14 +85,14 @@ APU004.001 Change apu2 watchdog timeout ${platform_has_reset}= Set Variable ${TRUE} Set DUT Response Timeout 60s TRY - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} EXCEPT ${platform_has_reset}= Set Variable ${FALSE} END Should Be Equal ${platform_has_reset} ${FALSE} # Now wait another 70s to make sure the platform resets within 120s of boot. Set DUT Response Timeout 70s - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} [Teardown] Flash Firmware ${FW_FILE} APU005.001 Check if disabling CPB decreases performance diff --git a/dasharo-compatibility/cpu-cores-count.robot b/dasharo-compatibility/cpu-cores-count.robot index 1e508d618f..d92ccf0a14 100644 --- a/dasharo-compatibility/cpu-cores-count.robot +++ b/dasharo-compatibility/cpu-cores-count.robot @@ -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 @@ -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 @@ -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} @@ -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 @@ -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 @@ -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} @@ -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} @@ -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} @@ -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} @@ -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} diff --git a/dasharo-compatibility/custom-boot-menu-key.robot b/dasharo-compatibility/custom-boot-menu-key.robot index 402b8b076a..9c29a72557 100644 --- a/dasharo-compatibility/custom-boot-menu-key.robot +++ b/dasharo-compatibility/custom-boot-menu-key.robot @@ -30,7 +30,7 @@ CBK001.001 Custom boot menu key Skip If not ${CUSTOM_BOOT_MENU_KEY_SUPPORT} CBK001.001 not supported Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} CBK001.001 not supported Power On - Enter Boot Menu Tianocore + Enter Boot Menu Read From Terminal Until ${BOOT_MENU_STRING} CBK002.001 Custom setup menu key @@ -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} diff --git a/dasharo-compatibility/dasharo-tools-suite.robot b/dasharo-compatibility/dasharo-tools-suite.robot index 1a009d73e5..c8177adb1e 100644 --- a/dasharo-compatibility/dasharo-tools-suite.robot +++ b/dasharo-compatibility/dasharo-tools-suite.robot @@ -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 @@ -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} diff --git a/dasharo-compatibility/ec-and-super-IO.robot b/dasharo-compatibility/ec-and-super-IO.robot index 0ad922685e..95267b89e4 100644 --- a/dasharo-compatibility/ec-and-super-IO.robot +++ b/dasharo-compatibility/ec-and-super-IO.robot @@ -321,7 +321,7 @@ ECR022.001 EC sync update with power adapter connected works correctly # Make sure EC isn't flashed second time after restart Write Into Terminal reboot - ${out}= Read From Terminal Until ${TIANOCORE_STRING} + ${out}= Read From Terminal Until ${FW_STRING} ECR023.001 EC sync doesn't update with power adapter disconnected [Documentation] This test aims to verify whether coreboot update diff --git a/dasharo-compatibility/esp-scanning.robot b/dasharo-compatibility/esp-scanning.robot index 25007989cb..f62de834fb 100644 --- a/dasharo-compatibility/esp-scanning.robot +++ b/dasharo-compatibility/esp-scanning.robot @@ -37,7 +37,7 @@ ESP001.001 ESP Scan with OS-specific .efi files added ... files will have boot menu entries created for them. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} ESP001.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction FOR ${system} IN @{SYSTEMS_FOR_ESP_TESTING} Should Contain Match ${boot_menu} ${system}* END @@ -55,7 +55,7 @@ ESP003.001 ESP Scan ignores OSes on removable media ... ${TINYCORE_URL} ... 5c0c5c7c835070f0adcaeafad540252e9dd2935c02e57de6112fb92fb5d6f9c5 Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Should Not Contain Match ${boot_menu} *CorePlus* ESP004.001 ESP Scan does not create duplicate entries @@ -64,7 +64,7 @@ ESP004.001 ESP Scan does not create duplicate entries ... are present for a single OS. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} ESP004.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction # In general, boot entries may be duplicated if created by other means. # Here we only want to test the duplicates created by the ESP scanning features. @@ -85,7 +85,7 @@ ESP005.001 ESP Scan detects Dasharo Tools Suite ... ${DTS_URL} ... f42b59633dbcc16ecbd7c98a880c582c5235c22626d7204202c922f3a7fa231b Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Should Contain Match ${boot_menu} Dasharo Tools Suite on (* ESP006.001 ESP Scan does not find non-block boot devices @@ -93,7 +93,7 @@ ESP006.001 ESP Scan does not find non-block boot devices ... find non-block boot devices Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} ESP004.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction FOR ${boot_option} IN @{boot_menu} Should Not Contain ${boot_option} on Non-Block Boot Device END @@ -107,7 +107,7 @@ ESP002.001 ESP Scan after deleting additional .efi files Power On Clear Out EFI Partition Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction FOR ${system} IN @{SYSTEMS_FOR_ESP_TESTING} Should Not Contain Match ${boot_menu} ${system}* END diff --git a/dasharo-compatibility/memory-profile.robot b/dasharo-compatibility/memory-profile.robot index afa543149a..c9fa732c08 100644 --- a/dasharo-compatibility/memory-profile.robot +++ b/dasharo-compatibility/memory-profile.robot @@ -8,7 +8,7 @@ Library SSHLibrary timeout=90 seconds Library RequestsLibrary # TODO: maybe have a single file to include if we need to include the same # stuff in all test cases -Resource ../lib/bios/menus.robot +Resource ../lib/bios/edk2.robot Resource ../variables.robot Resource ../keywords.robot Resource ../keys.robot @@ -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 =Select Entry ${old_speed}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.* Should Not Be Empty ${old_speed} @@ -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 =Select Entry ${new_speed}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.* Should Not Be Empty ${new_speed} @@ -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 =Select Entry ${old_speed}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.* Should Not Be Empty ${old_speed} @@ -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 =Select Entry ${new_speed}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.* Should Not Be Empty ${new_speed} diff --git a/dasharo-compatibility/network-boot-utilities.robot b/dasharo-compatibility/network-boot-utilities.robot index 57b6af857a..f164c22bb1 100644 --- a/dasharo-compatibility/network-boot-utilities.robot +++ b/dasharo-compatibility/network-boot-utilities.robot @@ -36,7 +36,7 @@ NBT001.001 Netboot is available Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} NBT001.001 not supported Power On Set DUT Response Timeout 60s - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} Network Boot and Utilities Set DUT Response Timeout 20s Read From Terminal Until Network Boot and Utilities @@ -48,7 +48,7 @@ NBT002.001 OS selection & utilities is available Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} NBT002.001 not supported Power On Set DUT Response Timeout 120s - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} Network Boot and Utilities ${ipxe_menu}= Get IPXE Boot Menu Construction lines_top=2 Enter Submenu From Snapshot ${ipxe_menu} OS Selection & Utilities @@ -59,7 +59,7 @@ NBT003.001 iPXE boot is available ... selection iPXE menu appears. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} NBT003.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} Network Boot and Utilities ${ipxe_menu}= Get IPXE Boot Menu Construction lines_top=2 Enter Submenu From Snapshot ${ipxe_menu} iPXE Boot @@ -72,7 +72,7 @@ NBT004.001 iPXE shell is available Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} NBT004.001 not supported Power On Set DUT Response Timeout 60s - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} Network Boot and Utilities ${ipxe_menu}= Get IPXE Boot Menu Construction lines_top=2 Enter Submenu From Snapshot ${ipxe_menu} iPXE Shell @@ -85,7 +85,7 @@ NBT005.001 iPXE shell works correctly Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} NBT005.001 not supported Power On Set DUT Response Timeout 60s - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} Network Boot and Utilities ${ipxe_menu}= Get IPXE Boot Menu Construction lines_top=2 Enter Submenu From Snapshot ${ipxe_menu} iPXE Shell @@ -105,7 +105,7 @@ NBT006.001 Advanced option is available Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} NBT006.001 not supported Power On Set DUT Response Timeout 60s - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} Network Boot and Utilities ${ipxe_menu}= Get IPXE Boot Menu Construction lines_top=2 Enter Submenu From Snapshot ${ipxe_menu} Advanced @@ -118,7 +118,7 @@ NBT007.001 Change netboot URL option works correctly Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} NBT007.001 not supported Power On Set DUT Response Timeout 60s - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} Network Boot and Utilities ${ipxe_menu}= Get IPXE Boot Menu Construction lines_top=2 Enter Submenu From Snapshot ${ipxe_menu} Advanced diff --git a/dasharo-compatibility/network-boot.robot b/dasharo-compatibility/network-boot.robot index ca82b3885a..c3e54bea45 100644 --- a/dasharo-compatibility/network-boot.robot +++ b/dasharo-compatibility/network-boot.robot @@ -34,7 +34,7 @@ PXE001.001 Dasharo Network Boot is available ... option, Dasharo Network Boot Menu is displayed. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PXE001.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${IPXE_BOOT_ENTRY} ${out}= Read From Terminal Until ${EDK2_IPXE_CHECKPOINT} Should Contain ${out} Dasharo Network Boot Menu @@ -44,7 +44,7 @@ PXE002.001 Dasharo network boot menu boot options order is correct ... contains all of the needed options which are in the correct order. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PXE002.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${IPXE_BOOT_ENTRY} ${ipxe_menu}= Get IPXE Boot Menu Construction Should Contain ${ipxe_menu}[0] Autoboot (DHCP) @@ -57,7 +57,7 @@ PXE003.001 Autoboot option is available and works correctly ... Dasharo Network Boot Menu works correctly. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PXE003.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${IPXE_BOOT_ENTRY} ${ipxe_menu}= Get IPXE Boot Menu Construction Enter Submenu From Snapshot ${ipxe_menu} Autoboot (DHCP) @@ -70,7 +70,7 @@ PXE004.001 DTS option is available and works correctly [Tags] minimal-regression Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PXE004.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${IPXE_BOOT_ENTRY} ${ipxe_menu}= Get IPXE Boot Menu Construction Enter Submenu From Snapshot ${ipxe_menu} Dasharo Tools Suite @@ -88,7 +88,7 @@ PXE005.001 OS installation option is available and works correctly ... in Dasharo Network Boot Menu allows booting into netboot.xyz server. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PXE005.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${IPXE_BOOT_ENTRY} ${ipxe_menu}= Get IPXE Boot Menu Construction Enter Submenu From Snapshot ${ipxe_menu} OS installation @@ -105,7 +105,7 @@ PXE006.001 iPXE shell option is available and works correctly ... Dasharo Network Boot Menu works correctly. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PXE006.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${IPXE_BOOT_ENTRY} ${ipxe_menu}= Get IPXE Boot Menu Construction Enter Submenu From Snapshot ${ipxe_menu} iPXE Shell @@ -117,7 +117,7 @@ PXE007.001 Dasharo Network Boot over https not http Skip If not ${IPXE_BOOT_SUPPORT} PXE007.001 not supported Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} PXE007.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${IPXE_BOOT_ENTRY} ${ipxe_menu}= Get IPXE Boot Menu Construction Enter Submenu From Snapshot ${ipxe_menu} Dasharo Tools Suite diff --git a/dasharo-compatibility/nvme-support.robot b/dasharo-compatibility/nvme-support.robot index fa9a22821c..7359a3dfde 100644 --- a/dasharo-compatibility/nvme-support.robot +++ b/dasharo-compatibility/nvme-support.robot @@ -30,7 +30,7 @@ NVM001.001 NVMe support in firmware ... NVMe disk in M.2 slot. Skip If not ${NVME_DISK_SUPPORT} NVM001.001 not supported Power On - ${out}= Enter Boot Menu Tianocore And Return Construction + ${out}= Enter Boot Menu And Return Construction Should Contain ${out} ${CLEVO_DISK} NVM001.002 NVMe support in OS (Ubuntu) diff --git a/dasharo-compatibility/power-after-fail.robot b/dasharo-compatibility/power-after-fail.robot index 7935c88d41..e71fc9e7bc 100644 --- a/dasharo-compatibility/power-after-fail.robot +++ b/dasharo-compatibility/power-after-fail.robot @@ -11,7 +11,7 @@ Library RequestsLibrary Resource ../variables.robot Resource ../keywords.robot Resource ../keys.robot -Resource ../lib/bios/menus.robot +Resource ../lib/bios/edk2.robot Resource ../lib/power-after-fail-lib.robot # TODO: @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/dasharo-compatibility/setup-menu-information.robot b/dasharo-compatibility/setup-menu-information.robot index 488ae63e33..bd23138e24 100644 --- a/dasharo-compatibility/setup-menu-information.robot +++ b/dasharo-compatibility/setup-menu-information.robot @@ -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 =Select Entry ${cpu_line}= Get Lines Matching Regexp ${out} .*GHz Should Not Be Empty ${cpu_line} CPU clock speed not found @@ -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 =Select Entry ${ram_line}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.* Should Not Be Empty ${ram_line} RAM speed not found @@ -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 =Select Entry ${ram_line}= Get Lines Matching Regexp ${out} .*MB RAM.* Should Not Be Empty ${ram_line} RAM size not found @@ -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 =Select Entry ${cpu_line}= Get Lines Matching Regexp ${out} .*GHz Should Not Be Empty ${cpu_line} CPU clock speed not found @@ -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 =Select Entry ${ram_line}= Get Lines Matching Regexp ${out} .*RAM @ \\d+ MHz.* Should Not Be Empty ${ram_line} RAM speed not found @@ -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 =Select Entry ${ram_line}= Get Lines Matching Regexp ${out} .*MB RAM.* Should Not Be Empty ${ram_line} RAM size not found diff --git a/dasharo-compatibility/uefi-shell.robot b/dasharo-compatibility/uefi-shell.robot index e0b3bb4e3d..770372016e 100644 --- a/dasharo-compatibility/uefi-shell.robot +++ b/dasharo-compatibility/uefi-shell.robot @@ -30,6 +30,6 @@ USH001.001 UEFI Shell Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} USH001.001 not supported Skip If not ${UEFI_SHELL_SUPPORT} USH001.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} UEFI Shell Read From Terminal Until UEFI Interactive Shell diff --git a/dasharo-compatibility/usb-detect.robot b/dasharo-compatibility/usb-detect.robot index 1e63ae753a..533349df1b 100644 --- a/dasharo-compatibility/usb-detect.robot +++ b/dasharo-compatibility/usb-detect.robot @@ -40,7 +40,7 @@ UDT001.001 USB detection after coldboot ${usb}= Evaluate 0 Power Cycle On IF '${PAYLOAD}' == 'tianocore' - Enter Boot Menu Tianocore + Enter Boot Menu ${menu}= Read From Terminal Until ESC to exit ELSE IF '${PAYLOAD}' == 'seabios' ${menu}= Enter SeaBIOS And Return Menu diff --git a/dasharo-compatibility/usb-hid-and-msc-support.robot b/dasharo-compatibility/usb-hid-and-msc-support.robot index fdc3d3671a..3f95585a54 100644 --- a/dasharo-compatibility/usb-hid-and-msc-support.robot +++ b/dasharo-compatibility/usb-hid-and-msc-support.robot @@ -31,7 +31,7 @@ USB001.001 USB devices detected in FW Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} Upload And Mount DTS Flash Iso Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Check That USB Devices Are Detected ${boot_menu} USB001.002 USB devices detected by OS (Ubuntu) diff --git a/dasharo-compatibility/watchdog.robot b/dasharo-compatibility/watchdog.robot index f22f8428ca..f524198fe2 100644 --- a/dasharo-compatibility/watchdog.robot +++ b/dasharo-compatibility/watchdog.robot @@ -8,7 +8,7 @@ Library SSHLibrary timeout=90 seconds Library RequestsLibrary # TODO: maybe have a single file to include if we need to include the same # stuff in all test cases -Resource ../lib/bios/menus.robot +Resource ../lib/bios/edk2.robot Resource ../variables.robot Resource ../keywords.robot Resource ../keys.robot @@ -50,7 +50,7 @@ WDT002.001 Enable watchdog # We're in the setup menu. Now just wait until the platform resets. Wait a # little longer than the timeout to give the platform time to reset. Set DUT Response Timeout 320s - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} WDT003.001 Disable watchdog [Documentation] Disable the watchdog after enabling it to verify it does @@ -69,7 +69,7 @@ WDT003.001 Disable watchdog ${platform_has_reset}= Set Variable ${TRUE} Set DUT Response Timeout 360s TRY - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} EXCEPT ${platform_has_reset}= Set Variable ${FALSE} END @@ -95,7 +95,7 @@ WDT004.001 Change watchdog timeout ${platform_has_reset}= Set Variable ${TRUE} Set DUT Response Timeout 320s TRY - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} EXCEPT ${platform_has_reset}= Set Variable ${FALSE} END @@ -103,7 +103,7 @@ WDT004.001 Change watchdog timeout # Now wait another 60s to make sure the platform resets within ~360s of # boot. Set DUT Response Timeout 60s - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} WDT005.001 Watchdog is detected by OS (Ubuntu) [Documentation] Boot into an OS with the watchdog enabled and verify @@ -128,7 +128,7 @@ WDT005.001 Watchdog is detected by OS (Ubuntu) ${platform_has_reset}= Set Variable ${TRUE} Set DUT Response Timeout 300s TRY - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} EXCEPT ${platform_has_reset}= Set Variable ${FALSE} END @@ -160,7 +160,7 @@ WTD006.001 Watchdog resets platform on kernel crash (Ubuntu 22.04) ${platform_has_reset}= Set Variable ${TRUE} Set DUT Response Timeout 300s TRY - Read From Terminal Until ${TIANOCORE_STRING} + Read From Terminal Until ${FW_STRING} EXCEPT ${platform_has_reset}= Set Variable ${FALSE} END diff --git a/dasharo-performance/platform-stability.robot b/dasharo-performance/platform-stability.robot index 104e221b6f..3b5cda8d63 100644 --- a/dasharo-performance/platform-stability.robot +++ b/dasharo-performance/platform-stability.robot @@ -32,7 +32,7 @@ STB001.001 Verify if no reboot occurs in the firmware ... a defined time an attempt to read the same menu is repeated. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} STB001.001 not supported Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} UEFI Shell Read From Terminal Until other key to continue Set Prompt For Terminal Shell> diff --git a/dasharo-security/network-stack.robot b/dasharo-security/network-stack.robot index d6db6802af..3646d75a17 100644 --- a/dasharo-security/network-stack.robot +++ b/dasharo-security/network-stack.robot @@ -34,7 +34,7 @@ NBA001.001 Enable Network Boot (firmware) IF '${DUT_CONNECTION_METHOD}' == 'pikvm' Remap Keys Variables To PiKVM Set UEFI Option NetworkBoot ${TRUE} - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Should Contain ${boot_menu} ${IPXE_BOOT_ENTRY} NBA002.001 Disable Network Boot (firmware) @@ -46,5 +46,5 @@ NBA002.001 Disable Network Boot (firmware) IF '${DUT_CONNECTION_METHOD}' == 'pikvm' Remap Keys Variables To PiKVM Set UEFI Option NetworkBoot ${FALSE} - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Should Not Contain ${boot_menu} ${IPXE_BOOT_ENTRY} diff --git a/dasharo-security/option-rom.robot b/dasharo-security/option-rom.robot index e426d2da84..57eaad723a 100644 --- a/dasharo-security/option-rom.robot +++ b/dasharo-security/option-rom.robot @@ -3,7 +3,7 @@ Library Telnet timeout=20 seconds connection_timeout=120 secon Library SSHLibrary timeout=90 seconds Library RequestsLibrary Resource ../keywords.robot -Resource ../lib/bios/menus.robot +Resource ../lib/bios/edk2.robot Resource ../variables.robot Resource ../keys.robot diff --git a/dasharo-security/rebar.robot b/dasharo-security/rebar.robot index c7fc0da2c3..3b3c1e2f77 100644 --- a/dasharo-security/rebar.robot +++ b/dasharo-security/rebar.robot @@ -3,7 +3,7 @@ Library Telnet timeout=20 seconds connection_timeout=120 secon Library SSHLibrary timeout=90 seconds Library RequestsLibrary Resource ../keywords.robot -Resource ../lib/bios/menus.robot +Resource ../lib/bios/edk2.robot Resource ../variables.robot Resource ../keys.robot diff --git a/dasharo-security/uefi-password.robot b/dasharo-security/uefi-password.robot index fd1b19ac04..6af2831d40 100644 --- a/dasharo-security/uefi-password.robot +++ b/dasharo-security/uefi-password.robot @@ -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 @@ -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 @@ -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 @@ -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} @@ -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 @@ -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 diff --git a/dasharo-security/usb-stack.robot b/dasharo-security/usb-stack.robot index d46ed3c103..84dac438ea 100644 --- a/dasharo-security/usb-stack.robot +++ b/dasharo-security/usb-stack.robot @@ -34,7 +34,7 @@ USS001.001 Enable USB stack (firmware) Skip If "${OPTIONS_LIB}" == "dcu" Set UEFI Option UsbDriverStack ${TRUE} Set UEFI Option UsbMassStorage ${TRUE} - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Check That USB Devices Are Detected ${boot_menu} USS002.001 Disable USB stack (firmware) @@ -46,7 +46,7 @@ USS002.001 Disable USB stack (firmware) Skip If "${OPTIONS_LIB}" == "dcu" Set UEFI Option UsbMassStorage ${FALSE} Set UEFI Option UsbDriverStack ${FALSE} - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction # Check That USB Devices Are Not Detected ${boot_menu} USS003.001 Enable USB Mass Storage (firmware) @@ -70,7 +70,7 @@ USS003.001 Enable USB Mass Storage (firmware) END Set Option State ${usb_menu} Enable USB Mass Storage ${TRUE} Save Changes And Reset - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Check That USB Devices Are Detected ${boot_menu} USS004.001 Disable USB Mass Storage (firmware) @@ -95,5 +95,5 @@ USS004.001 Disable USB Mass Storage (firmware) END Set Option State ${usb_menu} Enable USB Mass Storage ${FALSE} Save Changes And Reset - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction # Check That USB Devices Are Not Detected ${boot_menu} diff --git a/dasharo-stability/capsule-update.robot b/dasharo-stability/capsule-update.robot index c7ca494422..7cd4d42a52 100644 --- a/dasharo-stability/capsule-update.robot +++ b/dasharo-stability/capsule-update.robot @@ -230,7 +230,7 @@ Get Key To Press RETURN ${digit} Select UEFI Shell Boot Option - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} UEFI Shell Read From Terminal Until Shell> diff --git a/docs/qemu.md b/docs/qemu.md index 5baf4e105f..3158d7771b 100644 --- a/docs/qemu.md +++ b/docs/qemu.md @@ -26,16 +26,28 @@ You may also decide to not use graphics user interface for QEMU. In that case choose mode `nographic`. If you run QEMU on a remote machine you may consider to use mode `vnc` with default port for graphical output being `5900`. -Dasharo (UEFI) in QEMU can be started with: +Dasharo (coreboot+UEFI) in QEMU can be started with: ```bash -./scripts/ci/qemu-run.sh graphic firmware +./scripts/ci/qemu-run.sh graphic uefi ``` In this mode, a graphical QEMU window would popup, so you can observe the test -flow, or control it manually. The actual testing will happen over -serial, which is exposed via telnet. For more modes and options, please refer -to the script's help text. +flow, or control it manually. The actual testing will happen over serial, which +is exposed via telnet. For more modes and options, please refer to the script's +help text. + +Please note `uefi` is a machine with lower resources assigned and no disk will +be connected; suitable for Dasharo (coreboot+UEFI) validation, but not for OS +booting. The `firmware` option is the same as `uefi` and is kept for backward +compatibility. + +Instead of `uefi` you can use `seabios` option, which is a machine with lower +resources assigned and no disk will be connected; suitable for Dasharo +(coreboot+SeaBIOS) validation, but not for OS booting. + +There are some more intrinsic difference between `uefi` and `seabios` for +details please inspect the script. You may also build customized Dasharo firmware for QEMU (e.g. with some Dasharo options enabled or disabled). In such a case, please refer to: diff --git a/keywords.robot b/keywords.robot index d0d81aef6c..322c42aa50 100644 --- a/keywords.robot +++ b/keywords.robot @@ -2,7 +2,6 @@ Library Collections Library OperatingSystem Resource pikvm-rest-api/pikvm_comm.robot -Resource lib/bios/menus.robot Resource lib/secure-boot-lib.robot Resource lib/usb-hid-msc-lib.robot Resource lib/dts-lib.robot @@ -321,7 +320,7 @@ Get Firmware Version IF '${FLASH_VERIFY_METHOD}'=='iPXE-boot' Boot Debian From IPXE ${PXE_IP} ${HTTP_PORT} ${FILENAME} ${DEBIAN_STABLE_VER} ELSE IF '${FLASH_VERIFY_METHOD}'=='tianocore-shell' - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${FLASH_VERIFY_OPTION} ELSE IF '${FLASH_VERIFY_METHOD}'=='none' No Operation @@ -551,6 +550,18 @@ Prepare Test Suite FAIL Unknown connection method: ${DUT_CONNECTION_METHOD} for config: ${CONFIG} END IF '${CONFIG}' == 'rpi-3b' Verify Number Of Connected SD Wire Devices + Import BIOS Libraries + +Import BIOS Libraries + [Documentation] Import BIOS libraries based on config and command + ... line variables + IF '${BIOS_LIB}' == 'uefi' + Import Resource ${CURDIR}/lib/options/${OPTIONS_LIB}.robot + ELSE IF '${BIOS_LIB}' == 'seabios' + Import Resource ${CURDIR}/lib/bios/seabios.robot + ELSE + FAIL Unknown BIOS library: ${BIOS_LIB} + END Import Osfv Libraries [Documentation] Import osfv_cli libraries based on config and command @@ -1347,7 +1358,7 @@ Reboot Via OS Boot By Petitboot Reboot Via Ubuntu By Tianocore [Documentation] Reboot system with Ubuntu installed on the DUT while ... already logged into Tianocore. - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ubuntu Login To Linux Switch To Root User @@ -1440,7 +1451,7 @@ Boot Operating System [Arguments] ${operating_system} IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN Set Local Variable ${is_system_installed} ${FALSE} - Enter Boot Menu Tianocore + Enter Boot Menu ${menu_construction}= Get Boot Menu Construction ${is_system_installed}= Evaluate "${operating_system}" in """${menu_construction}""" IF not ${is_system_installed} diff --git a/lib/bios/common.robot b/lib/bios/common.robot new file mode 100644 index 0000000000..48adcdf48e --- /dev/null +++ b/lib/bios/common.robot @@ -0,0 +1,169 @@ +*** Settings *** +Documentation Collection of keywords related to common firmware operations. + +Library Collections +Library String + + +*** Keywords *** +Enter Boot Menu + [Documentation] Enter Boot Menu with tianocore boot menu key mapped in + ... keys list. + Read From Terminal Until ${FW_STRING} + IF '${DUT_CONNECTION_METHOD}' == 'pikvm' + Single Key PiKVM ${BOOT_MENU_KEY} + ELSE + Write Bare Into Terminal ${BOOT_MENU_KEY} + END + IF ${LAPTOP_EC_SERIAL_WORKAROUND} == ${TRUE} + # FIXME: Laptop EC serial workaround + Press Key N Times 1 ${ARROW_DOWN} + Press Key N Times 1 ${ARROW_UP} + END + +Enter Boot Menu And Return Construction + [Documentation] Enters boot menu, returning menu construction + Enter Boot Menu + ${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} + ${slice_start}= Set Variable ${lines_top} + IF ${lines_bot} == 0 + ${slice_end}= Set Variable None + ELSE + ${slice_end}= Evaluate ${lines_bot} * -1 + END + ${menu}= Remove String ${menu} \r + @{menu_lines}= Split To Lines ${menu} + @{construction}= Create List + FOR ${line} IN @{menu_lines} + # Replace multiple spaces with a single one + ${line}= Replace String Using Regexp ${line} ${SPACE}+ ${SPACE} + # Remove leading and trailing spaces + ${line}= Strip String ${line} + # Drop leading and trailing pipes (e.g. in One Time Boot Menu) + ${line}= Strip String ${line} characters=| + # Remove leading and trailing spaces + ${line}= Strip String ${line} + # Drop all remaining borders + ${line}= Remove String Using Regexp ${line} ^[\\|\\s/\\\\-]+$ + # If the resulting line is not empty, add it as a menu entry + ${length}= Get Length ${line} + IF ${length} > 0 Append To List ${construction} ${line} + END + Log ${construction} + ${construction}= Get Slice From List ${construction} ${slice_start} ${slice_end} + # TODO: Improve parsing of the menu into construction. It can probably be + # simplified, but at least we have this only in one kewyrod not in multiple + # ones. + # Make sure to remove control help text appearing in the screen if somehow + # they are still there. + Remove Values From List + ... ${construction} + ... Esc\=Exit + ... ^v\=Move High + ... \=Select Entry + ... F9\=Reset to Defaults F10\=Save + ... LCtrl+LAlt+F12\=Save screenshot + ... Toggle Checkbox + ... one adjusts to change + ... Select boot device: + ... , N for PXE boot + RETURN ${construction} + +Get Menu Construction + [Documentation] Keyword allows to get and return setup menu construction. + [Arguments] ${checkpoint}=ESC=exit ${lines_top}=1 ${lines_bot}=0 + Sleep 1s + ${out}= Read From Terminal Until ${checkpoint} + ${menu}= Parse Menu Snapshot Into Construction ${out} ${lines_top} ${lines_bot} + RETURN ${menu} + +Get Index Of Matching Option In Menu + [Documentation] This keyword returns the index of element that matches + ... one in given menu + [Arguments] ${menu_construction} ${option} ${ignore_not_found_error}=${FALSE} + FOR ${element} IN @{menu_construction} + ${matches}= Run Keyword And Return Status + ... Should Match ${element} *${option}* + IF ${matches} + ${option}= Set Variable ${element} + BREAK + END + END + ${index}= Get Index From List ${menu_construction} ${option} + IF ${ignore_not_found_error} == ${FALSE} + Should Be True ${index} >= 0 Option ${option} not found in the list + END + RETURN ${index} + +Boot System Or From Connected Disk # robocop: disable=too-long-keyword + [Documentation] Tries to boot ${system_name}. If it is not possible then it tries + ... to boot from connected disk set up in config + [Arguments] ${system_name} + IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN + + IF '''${SEABIOS_BOOT_DEVICE}''' != '' + Read From Terminal Until for boot menu + Write Bare Into Terminal ${BOOT_MENU_KEY} + Read From Terminal Until Select boot device + Write Bare Into Terminal ${SEABIOS_BOOT_DEVICE} + RETURN + END + ${menu_construction}= Enter Boot Menu And Return Construction + # With ESP scanning feature boot entries are named differently: + IF ${ESP_SCANNING_SUPPORT} == ${TRUE} + IF "${system_name}" == "ubuntu" + ${system_name}= Set Variable Ubuntu + END + IF "${system_name}" == "trenchboot" and "${MANUFACTURER}" == "QEMU" + ${system_name}= Set Variable QEMU HARDDISK + END + END + ${is_system_present}= Evaluate "${system_name}" in """${menu_construction}""" + IF not ${is_system_present} + ${ssd_list}= Get Current CONFIG List Param Storage_SSD boot_name + ${ssd_list_length}= Get Length ${ssd_list} + IF ${ssd_list_length} == 0 + ${hdd_list}= Get Current CONFIG List Param HDD_Storage boot_name + ${hdd_list_length}= Get Length ${hdd_list} + IF ${hdd_list_length} == 0 + ${mmc_list}= Get Current CONFIG List Param MMC_Storage boot_name + ${mmc_list_length}= Get Length ${mmc_list} + IF ${mmc_list_length} == 0 + FAIL "System was not found and there are no disk connected" + END + ${disk_name}= Set Variable ${mmc_list[0]} + ELSE + ${disk_name}= Set Variable ${hdd_list[0]} + END + ELSE + ${disk_name}= Set Variable ${ssd_list[0]} + END + # Search the menu for disk name occurrence + ${system_index}= Set Variable -1 + ${system_index}= Evaluate + ... next((i for i, entry in enumerate(${menu_construction}) if "${disk_name}" in entry), -1) + IF ${system_index} == -1 + Fail Disk: ${disk_name} not found in Boot Menu + END + ELSE + ${system_index}= Get Index Of Matching Option In Menu ${menu_construction} ${system_name} + END + Select Boot Menu Option ${system_index} ${ARROW_DOWN} diff --git a/lib/bios/menus.robot b/lib/bios/edk2.robot similarity index 74% rename from lib/bios/menus.robot rename to lib/bios/edk2.robot index 31531bd561..158906943e 100644 --- a/lib/bios/menus.robot +++ b/lib/bios/edk2.robot @@ -4,24 +4,10 @@ Documentation Collection of keywords related to EDK2 menus Library Collections Library String Library ./menus.py +Resource common.robot *** Keywords *** -Enter Boot Menu Tianocore - [Documentation] Enter Boot Menu with tianocore boot menu key mapped in - ... keys list. - Read From Terminal Until ${TIANOCORE_STRING} - IF '${DUT_CONNECTION_METHOD}' == 'pikvm' - Single Key PiKVM ${BOOT_MENU_KEY} - ELSE - Write Bare Into Terminal ${BOOT_MENU_KEY} - END - IF ${LAPTOP_EC_SERIAL_WORKAROUND} == ${TRUE} - # FIXME: Laptop EC serial workaround - Press Key N Times 1 ${ARROW_DOWN} - Press Key N Times 1 ${ARROW_UP} - END - Get Boot Menu Construction [Documentation] Keyword allows to get and return boot menu construction. ${menu}= Read From Terminal Until exit @@ -66,21 +52,6 @@ Get Boot Menu Construction END RETURN ${construction} -Enter Boot Menu Tianocore And Return Construction - [Documentation] Enters boot menu, returning menu construction - Enter Boot Menu Tianocore - ${menu}= Get Boot Menu Construction - RETURN ${menu} - -Enter Setup Menu Tianocore - [Documentation] Enter Setup Menu with key specified in platform-configs. - Read From Terminal Until ${TIANOCORE_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 @@ -94,62 +65,9 @@ Get Setup Menu Construction ${menu}= Get Menu Construction ${checkpoint} 3 1 RETURN ${menu} -Get Menu Construction - [Documentation] Keyword allows to get and return setup menu construction. - [Arguments] ${checkpoint}=ESC=exit ${lines_top}=1 ${lines_bot}=0 - Sleep 1s - ${out}= Read From Terminal Until ${checkpoint} - ${menu}= Parse Menu Snapshot Into Construction ${out} ${lines_top} ${lines_bot} - RETURN ${menu} - -Parse Menu Snapshot Into Construction - [Documentation] Breaks grabbed menu data into lines. - [Arguments] ${menu} ${lines_top} ${lines_bot} - ${slice_start}= Set Variable ${lines_top} - IF ${lines_bot} == 0 - ${slice_end}= Set Variable None - ELSE - ${slice_end}= Evaluate ${lines_bot} * -1 - END - ${menu}= Remove String ${menu} \r - @{menu_lines}= Split To Lines ${menu} - @{construction}= Create List - FOR ${line} IN @{menu_lines} - # Replace multiple spaces with a single one - ${line}= Replace String Using Regexp ${line} ${SPACE}+ ${SPACE} - # Remove leading and trailing spaces - ${line}= Strip String ${line} - # Drop leading and trailing pipes (e.g. in One Time Boot Menu) - ${line}= Strip String ${line} characters=| - # Remove leading and trailing spaces - ${line}= Strip String ${line} - # Drop all remaining borders - ${line}= Remove String Using Regexp ${line} ^[\\|\\s/\\\\-]+$ - # If the resulting line is not empty, add it as a menu entry - ${length}= Get Length ${line} - IF ${length} > 0 Append To List ${construction} ${line} - END - Log ${construction} - ${construction}= Get Slice From List ${construction} ${slice_start} ${slice_end} - # TODO: Improve parsing of the menu into construction. It can probably be - # simplified, but at least we have this only in one kewyrod not in multiple - # ones. - # Make sure to remove control help text appearing in the screen if somehow - # they are still there. - Remove Values From List - ... ${construction} - ... Esc\=Exit - ... ^v\=Move High - ... \=Select Entry - ... F9\=Reset to Defaults F10\=Save - ... LCtrl+LAlt+F12\=Save screenshot - ... Toggle Checkbox - ... one adjusts to change - RETURN ${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} @@ -222,24 +140,6 @@ Enter Dasharo Submenu ... opt_only=${TRUE} RETURN ${submenu} -Get Index Of Matching Option In Menu - [Documentation] This keyword returns the index of element that matches - ... one in given menu - [Arguments] ${menu_construction} ${option} ${ignore_not_found_error}=${FALSE} - FOR ${element} IN @{menu_construction} - ${matches}= Run Keyword And Return Status - ... Should Match ${element} *${option}* - IF ${matches} - ${option}= Set Variable ${element} - BREAK - END - END - ${index}= Get Index From List ${menu_construction} ${option} - IF ${ignore_not_found_error} == ${FALSE} - Should Be True ${index} >= 0 Option ${option} not found in the list - END - RETURN ${index} - Press Key N Times And Enter [Documentation] Enter specified in the first argument times the specified ... in the second argument key and then press Enter. @@ -442,7 +342,7 @@ Reset To Defaults Tianocore Enter IPXE [Documentation] Enter iPXE after device power cutoff. # TODO: problem with iPXE string (e.g. when 3 network interfaces are available) - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} ${IPXE_BOOT_ENTRY} IF ${NETBOOT_UTILITIES_SUPPORT} == ${TRUE} ${ipxe_menu}= Get IPXE Boot Menu Construction lines_top=2 @@ -581,58 +481,6 @@ Save Changes And Reset Save Changes Tianocore Reset System -Boot System Or From Connected Disk # robocop: disable=too-long-keyword - [Documentation] Tries to boot ${system_name}. If it is not possible then it tries - ... to boot from connected disk set up in config - [Arguments] ${system_name} - IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN - - IF '''${SEABIOS_BOOT_DEVICE}''' != '' - Read From Terminal Until Press F10 key now for boot menu - Write Bare Into Terminal ${F10} - Read From Terminal Until Select boot device - Write Bare Into Terminal ${SEABIOS_BOOT_DEVICE} - RETURN - END - ${menu_construction}= Enter Boot Menu Tianocore And Return Construction - # With ESP scanning feature boot entries are named differently: - IF ${ESP_SCANNING_SUPPORT} == ${TRUE} - IF "${system_name}" == "ubuntu" - ${system_name}= Set Variable Ubuntu - END - IF "${system_name}" == "trenchboot" and "${MANUFACTURER}" == "QEMU" - ${system_name}= Set Variable QEMU HARDDISK - END - END - ${is_system_present}= Evaluate "${system_name}" in """${menu_construction}""" - IF not ${is_system_present} - ${ssd_list}= Get Current CONFIG List Param Storage_SSD boot_name - ${ssd_list_length}= Get Length ${ssd_list} - IF ${ssd_list_length} == 0 - ${hdd_list}= Get Current CONFIG List Param HDD_Storage boot_name - ${hdd_list_length}= Get Length ${hdd_list} - IF ${hdd_list_length} == 0 - ${mmc_list}= Get Current CONFIG List Param MMC_Storage boot_name - ${mmc_list_length}= Get Length ${mmc_list} - IF ${mmc_list_length} == 0 - FAIL "System was not found and there are no disk connected" - END - ${disk_name}= Set Variable ${mmc_list[0]} - ELSE - ${disk_name}= Set Variable ${hdd_list[0]} - END - ELSE - ${disk_name}= Set Variable ${ssd_list[0]} - END - ${system_index}= Get Index From List ${menu_construction} ${disk_name} - IF ${system_index} == -1 - Fail Disk: ${disk_name} not found in Boot Menu - END - ELSE - ${system_index}= Get Index Of Matching Option In Menu ${menu_construction} ${system_name} - END - Press Key N Times And Enter ${system_index} ${ARROW_DOWN} - Make Sure That Network Boot Is Enabled [Documentation] This keywords checks that "Enable network boot" in ... "Networking Options" is enabled when present, so the network @@ -643,8 +491,13 @@ 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,} RETURN ${firmware_version} + +Select Boot Menu Option + [Documentation] Select the boot menu option using the given index. + [Arguments] ${index} ${key} + Press Key N Times ${index} ${key} diff --git a/lib/bios/seabios.robot b/lib/bios/seabios.robot new file mode 100644 index 0000000000..9bb864eedf --- /dev/null +++ b/lib/bios/seabios.robot @@ -0,0 +1,125 @@ +*** Settings *** +Documentation Collection of keywords related to SeaBIOS. + +# Here is comparison of terms with lib/bios/edk2.robot +# Tianocore -> SeaBIOS +# Setup Menu -> sortbootorder +# +Library Collections +Library String +Resource common.robot + + +*** Keywords *** +Get Boot Menu Construction + [Documentation] Keyword allows to get and return boot menu construction. + ${menu}= Read From Terminal Until TPM Configuration + # Lines to strip: + # Select boot device: + # + # 1. DVD/CD [AHCI/2: QEMU DVD-ROM ATAPI-4 DVD/CD] + # 2. iPXE + # 3. Payload [setup] + # 4. Payload [memtest] + # + # t. TPM Configuration + ${construction}= Parse Menu Snapshot Into Construction ${menu} 1 0 + RETURN ${construction} + +Get Option State + [Documentation] Gets menu construction and option name as arguments. + ... Returns option state, which can be: True or False. + [Arguments] ${menu} ${option} + ${index}= Get Index Of Matching Option In Menu ${menu} ${option} + ${value}= Get Regexp Matches ${menu}[${index}] (Enabled|Disabled) + + RETURN ${value}[0] + +Set Option State + [Documentation] Gets menu construction option name, and desired state + ... as arguments. Return TRUE if the option was changed and FALSE if + ... option was already in target state. + [Arguments] ${menu} ${option} ${target_state} + ${current_state}= Get Option State ${menu} ${option} + IF '${current_state}' != '${target_state}' + ${menu}= Enter Menu From Snapshot ${menu} ${option} + RETURN ${TRUE} + ELSE + RETURN ${FALSE} + END + +Enter Boot Menu From Snapshot + [Documentation] Enter given Menu option + [Arguments] ${menu} ${option} + ${key}= Extract Boot Menu Key ${menu} ${option} + Write Bare Into Terminal ${key} + +Enter Menu From Snapshot + [Documentation] Enter given Menu option and return construction + [Arguments] ${menu} ${option} + ${key}= Extract Menu Key ${menu} ${option} + Write Bare Into Terminal ${key} + +Extract Boot Menu Key + [Documentation] Extract boot menu which should be hit to enter given Menu in SeaBIOS + [Arguments] ${menu} ${option} + FOR ${item} IN @{menu} + ${matches}= Run Keyword And Return Status + ... Should Match ${item} *${option}* + IF ${matches} + ${option}= Set Variable ${item} + BREAK + END + END + ${key}= Set Variable ${option.split('.')[0]} + RETURN ${key} + +Extract Menu Key + [Documentation] Extract key which should be hit to toggle given sortbootorder Menu option + [Arguments] ${menu} ${option} + FOR ${item} IN @{menu} + ${matches}= Run Keyword And Return Status + ... Should Match ${item} *${option}* + IF ${matches} + ${option}= Set Variable ${item} + BREAK + END + END + ${key}= Set Variable ${option.split()[0]} + RETURN ${key} + +Save Changes + [Documentation] This keyword saves introduced changes + Write Bare Into Terminal s + +Enable Network/PXE Boot + [Documentation] Enable Network/PXE Boot and save. + Enter Setup Menu + ${menu}= Get Menu Construction Save configuration and exit 7 0 + Set Option State ${menu} Network/PXE boot Enabled + Save Changes + +Enter TPM Configuration + [Documentation] Enter TPM Configuration with Boot Menu Construction. + Enter Boot Menu + ${menu}= Get Boot Menu Construction + Enter Menu From Snapshot ${menu} TPM Configuration + +Enter IPXE + [Documentation] Enter iPXE with Boot Menu Construction. + Enable Network/PXE Boot + Enter Boot Menu + ${menu}= Get Boot Menu Construction + Enter Menu From Snapshot ${menu} iPXE + +# robocop: disable=unused-argument + +Select Boot Menu Option + [Documentation] Select the boot menu option using the given index. + ... Accounts for indices counting from zero, and SeaBIOS options counting + ... from '1.'. Has to take a dummy parameter for compatibility with the + ... EDK2 version of this keyword. + [Arguments] ${index} ${dummy} + ${option}= Evaluate ${index} + 1 + Write Bare Into Terminal '${option}' +# robocop: disable=unused-argument diff --git a/lib/dts-lib.robot b/lib/dts-lib.robot index eb3673a5a9..550860cc98 100644 --- a/lib/dts-lib.robot +++ b/lib/dts-lib.robot @@ -49,7 +49,7 @@ Boot Dasharo Tools Suite ... boot method (from USB or from iPXE) as parameter. [Arguments] ${dts_booting_method} IF '${dts_booting_method}'=='USB' - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction IF '${DUT_CONNECTION_METHOD}' == 'pikvm' Enter Submenu From Snapshot ${boot_menu} PiKVM Composite KVM Device ELSE IF '${MANUFACTURER}' == 'QEMU' diff --git a/lib/options/uefi-setup-menu.robot b/lib/options/uefi-setup-menu.robot index 0a5d056ee0..19f18ef11f 100644 --- a/lib/options/uefi-setup-menu.robot +++ b/lib/options/uefi-setup-menu.robot @@ -4,7 +4,7 @@ Documentation Library for UEFI configuration using the UEFI setup menu Library Collections Library String -Resource ../bios/menus.robot +Resource ../bios/edk2.robot Resource ../../keywords.robot Resource ../cbmem.robot @@ -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 @@ -74,7 +74,7 @@ Get UEFI Boot Manager Entries Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction RETURN ${boot_menu} Measure Coldboot Time diff --git a/lib/secure-boot-lib.robot b/lib/secure-boot-lib.robot index f5e6e1a167..5f5102801e 100644 --- a/lib/secure-boot-lib.robot +++ b/lib/secure-boot-lib.robot @@ -224,7 +224,7 @@ Select File In File Explorer Enter UEFI Shell [Documentation] Boots into UEFI Shell. Should be called after Power On or ... reboot - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction Enter Submenu From Snapshot ${boot_menu} UEFI Shell Read From Terminal Until Shell> Sleep 1s diff --git a/platform-configs/include/default.robot b/platform-configs/include/default.robot index 2e39a32314..589f0c6005 100644 --- a/platform-configs/include/default.robot +++ b/platform-configs/include/default.robot @@ -1,7 +1,6 @@ *** Settings *** Resource ../../os-config/windows-credentials.robot Resource ../../os-config/ubuntu-credentials.robot -Resource ../../lib/options/${OPTIONS_LIB}.robot *** Variables *** @@ -13,7 +12,7 @@ ${PAYLOAD}= tianocore ${RTE_S2_N_PORT}= 13541 ${FLASH_SIZE}= ${TBD} ${FLASH_LENGTH}= ${TBD} -${TIANOCORE_STRING}= to boot directly +${FW_STRING}= to boot directly ${BOOT_MENU_KEY}= ${F11} ${SETUP_MENU_KEY}= Delete ${BOOT_MENU_STRING}= Please select boot device: @@ -39,6 +38,7 @@ ${LAPTOP_EC_SERIAL_WORKAROUND}= ${FALSE} # - uefi-setup-menu: Will set options via the UEFI Setup menu (serial) # - dcu: Will use Dasharo Configuration Utility to configure options. ${OPTIONS_LIB}= uefi-setup-menu +${BIOS_LIB}= uefi # OS config ${DEVICE_WINDOWS_USERNAME}= ${WINDOWS_USERNAME} diff --git a/platform-configs/include/msi-z690-common.robot b/platform-configs/include/msi-z690-common.robot index d7dcc8378f..0e911e74a1 100644 --- a/platform-configs/include/msi-z690-common.robot +++ b/platform-configs/include/msi-z690-common.robot @@ -12,7 +12,7 @@ ${PAYLOAD}= tianocore ${RTE_S2_N_PORT}= 13541 ${FLASH_SIZE}= ${32*1024*1024} ${FLASH_LENGTH}= ${TBD} -${TIANOCORE_STRING}= to boot directly +${FW_STRING}= to boot directly ${BOOT_MENU_KEY}= ${F11} ${SETUP_MENU_KEY}= Delete ${BOOT_MENU_STRING}= Please select boot device: diff --git a/platform-configs/include/novacustom-common.robot b/platform-configs/include/novacustom-common.robot index f1a9d46daa..a08fde8c4f 100644 --- a/platform-configs/include/novacustom-common.robot +++ b/platform-configs/include/novacustom-common.robot @@ -10,7 +10,7 @@ Resource ../../lib/novacustom-lib.robot ${INITIAL_DUT_CONNECTION_METHOD}= SSH ${DUT_CONNECTION_METHOD}= ${INITIAL_DUT_CONNECTION_METHOD} ${PAYLOAD}= tianocore -${TIANOCORE_STRING}= to boot directly +${FW_STRING}= to boot directly ${BOOT_MENU_KEY}= ${F7} ${SETUP_MENU_KEY}= ${F2} ${BOOT_MENU_STRING}= Please select boot device: diff --git a/platform-configs/include/pcengines.robot b/platform-configs/include/pcengines.robot index 5d5dcb7929..0bfdc9086a 100644 --- a/platform-configs/include/pcengines.robot +++ b/platform-configs/include/pcengines.robot @@ -10,7 +10,7 @@ ${PAYLOAD}= tianocore ${RTE_S2_N_PORT}= 13541 ${FLASH_SIZE}= ${8*1024*1024} ${FLASH_LENGTH}= ${TBD} -${TIANOCORE_STRING}= ENTER +${FW_STRING}= ENTER ${BOOT_MENU_KEY}= ${F10} ${SETUP_MENU_KEY}= ${DELETE} ${BOOT_MENU_STRING}= Please select boot device: diff --git a/platform-configs/include/protectli-common.robot b/platform-configs/include/protectli-common.robot index 03ef611509..63739a2bab 100644 --- a/platform-configs/include/protectli-common.robot +++ b/platform-configs/include/protectli-common.robot @@ -8,7 +8,7 @@ ${DUT_CONNECTION_METHOD}= ${INITIAL_DUT_CONNECTION_METHOD} ${PAYLOAD}= tianocore ${RTE_S2_N_PORT}= 13541 ${FLASH_LENGTH}= ${TBD} -${TIANOCORE_STRING}= to boot directly +${FW_STRING}= to boot directly ${BOOT_MENU_KEY}= ${F11} ${SETUP_MENU_KEY}= ${DELETE} ${BOOT_MENU_STRING}= Please select boot device diff --git a/platform-configs/minnowboard-turbot.robot b/platform-configs/minnowboard-turbot.robot index 7f1452743c..f768134dcf 100644 --- a/platform-configs/minnowboard-turbot.robot +++ b/platform-configs/minnowboard-turbot.robot @@ -9,7 +9,7 @@ ${PAYLOAD}= tianocore ${RTE_S2_N_PORT}= 13542 ${FLASH_SIZE}= ${8*1024*1024} ${FLASH_LENGTH}= ${TBD} -${TIANOCORE_STRING}= to enter Boot Manager Menu +${FW_STRING}= to enter Boot Manager Menu ${BOOT_MENU_STRING}= Please select boot device: ${BOOT_MENU_KEY}= ${F7} ${SETUP_MENU_KEY}= ${F2} diff --git a/platform-configs/optiplex-7010-seabios.robot b/platform-configs/optiplex-7010-seabios.robot new file mode 100644 index 0000000000..d99c35c419 --- /dev/null +++ b/platform-configs/optiplex-7010-seabios.robot @@ -0,0 +1,12 @@ +*** Settings *** +Resource optiplex-7010.robot + + +*** Variables *** +${BIOS_LIB}= seabios +${FW_STRING}= ESC +# ${SEABIOS_BOOT_DEVICE}= 2 +${BOOT_MENU_KEY}= ${ESC} +${DMIDECODE_FIRMWARE_VERSION}= Dasharo (coreboot+SeaBIOS) v0.1.0 +${DMIDECODE_RELEASE_DATE}= 11/27/2024 +${TESTS_IN_FIRMWARE_SUPPORT}= {FALSE} diff --git a/platform-configs/qemu-selftests.robot b/platform-configs/qemu-selftests-seabios.robot similarity index 79% rename from platform-configs/qemu-selftests.robot rename to platform-configs/qemu-selftests-seabios.robot index d6f62d5947..9947af93ea 100644 --- a/platform-configs/qemu-selftests.robot +++ b/platform-configs/qemu-selftests-seabios.robot @@ -4,6 +4,7 @@ This config targets QEMU firmware with as many menus enabled as possible. *** Settings *** Library ../lib/QemuMonitor.py /tmp/qmp-socket +Resource qemu.robot Resource include/default.robot @@ -12,8 +13,9 @@ ${INITIAL_DUT_CONNECTION_METHOD}= Telnet ${DUT_CONNECTION_METHOD}= ${INITIAL_DUT_CONNECTION_METHOD} ${RTE_S2_N_PORT}= 1234 ${FLASH_SIZE}= ${8*1024*1024} -${BOOT_MENU_KEY}= ${ESC} -${SETUP_MENU_KEY}= ${F2} +${FW_STRING}= for boot menu +${BOOT_MENU_KEY}= ${F10} +${SETUP_MENU_KEY}= ${F10} ${MANUFACTURER}= QEMU ${POWER_CTRL}= RteCtrl ${FLASHING_METHOD}= none @@ -42,12 +44,4 @@ ${DASHARO_POWER_MGMT_MENU_SUPPORT}= ${TRUE} ${DASHARO_PCI_PCIE_MENU_SUPPORT}= ${TRUE} ${DASHARO_MEMORY_MENU_SUPPORT}= ${TRUE} - -*** Keywords *** -Power On - [Documentation] Keyword clears telnet buffer and sets Device Under Test - ... into Power On state using RTE OC buffers. Implementation - ... must be compatible with the theory of operation of a - ... specific platform. - Read From Terminal - Qemu Monitor.System Reset +${BIOS_LIB}= seabios diff --git a/platform-configs/qemu-selftests-uefi.robot b/platform-configs/qemu-selftests-uefi.robot new file mode 100644 index 0000000000..3f1ccdb3e2 --- /dev/null +++ b/platform-configs/qemu-selftests-uefi.robot @@ -0,0 +1,53 @@ +*** Comments *** +This config targets QEMU firmware with as many menus enabled as possible. + + +*** Settings *** +Library ../lib/QemuMonitor.py /tmp/qmp-socket +Resource qemu.robot +Resource include/default.robot + + +*** Variables *** +${CUSTOM_NETWORK_BOOT_ENTRIES_SUPPORT}= ${TRUE} +${CUSTOM_LOGO_SUPPORT}= ${TRUE} +${USB_DISKS_DETECTION_SUPPORT}= ${TRUE} +${USB_KEYBOARD_DETECTION_SUPPORT}= ${TRUE} +${UEFI_SHELL_SUPPORT}= ${TRUE} +${IPXE_BOOT_SUPPORT}= ${TRUE} +${AUDIO_SUBSYSTEM_SUPPORT}= ${TRUE} +${FIRMWARE_NUMBER_VERIFICATION}= ${TRUE} +${PRODUCT_NAME_VERIFICATION}= ${TRUE} +${RELEASE_DATE_VERIFICATION}= ${TRUE} +${MANUFACTURER_VERIFICATION}= ${TRUE} +${VENDOR_VERIFICATION}= ${TRUE} +${TYPE_VERIFICATION}= ${TRUE} +${EMMC_SUPPORT}= ${TRUE} +${DTS_SUPPORT}= ${TRUE} +${UPLOAD_ON_USB_SUPPORT}= ${TRUE} +${RESET_TO_DEFAULTS_SUPPORT}= ${TRUE} +${ESP_SCANNING_SUPPORT}= ${TRUE} + +# Test module: dasharo-security +${TPM_SUPPORT}= ${TRUE} +${VERIFIED_BOOT_SUPPORT}= ${TRUE} +${VERIFIED_BOOT_POPUP_SUPPORT}= ${TRUE} +${MEASURED_BOOT_SUPPORT}= ${TRUE} +${SECURE_BOOT_SUPPORT}= ${TRUE} +${USB_STACK_SUPPORT}= ${TRUE} +${USB_MASS_STORAGE_SUPPORT}= ${TRUE} +${UEFI_PASSWORD_SUPPORT}= ${TRUE} + +# Test module: dasharo-performance +${SERIAL_BOOT_MEASURE}= ${TRUE} +${CPU_FREQUENCY_MEASURE}= ${TRUE} +${CPU_TEMPERATURE_MEASURE}= ${TRUE} +${PLATFORM_STABILITY_CHECKING}= ${TRUE} + +# Test module: trenchboot +${TRENCHBOOT_SUPPORT}= ${TRUE} + +${AUTO_BOOT_TIME_OUT_DEFAULT_VALUE}= 0 + +# Test module: dasharo-stability +${CAPSULE_UPDATE_SUPPORT}= ${TRUE} diff --git a/platform-configs/qemu.robot b/platform-configs/qemu.robot index dd5bdf0016..a311a3045e 100644 --- a/platform-configs/qemu.robot +++ b/platform-configs/qemu.robot @@ -8,81 +8,39 @@ Resource include/default.robot *** Variables *** -${INITIAL_DUT_CONNECTION_METHOD}= Telnet -${DUT_CONNECTION_METHOD}= ${INITIAL_DUT_CONNECTION_METHOD} -${RTE_S2_N_PORT}= 1234 -${FLASH_SIZE}= ${8*1024*1024} -${BOOT_MENU_KEY}= ${ESC} -${SETUP_MENU_KEY}= ${F2} -${MANUFACTURER}= QEMU -${POWER_CTRL}= RteCtrl -${FLASHING_METHOD}= none - -${DMIDECODE_SERIAL_NUMBER}= N/A -${DMIDECODE_FIRMWARE_VERSION}= Dasharo (coreboot+UEFI) v0.2.0 -${DMIDECODE_PRODUCT_NAME}= QEMU x86 q35/ich9 -${DMIDECODE_RELEASE_DATE}= 06/21/2024 -${DMIDECODE_MANUFACTURER}= Emulation -${DMIDECODE_VENDOR}= 3mdeb -${DMIDECODE_FAMILY}= N/A -${DMIDECODE_TYPE}= Desktop +${INITIAL_DUT_CONNECTION_METHOD}= Telnet +${DUT_CONNECTION_METHOD}= ${INITIAL_DUT_CONNECTION_METHOD} +${RTE_S2_N_PORT}= 1234 +${FLASH_SIZE}= ${8*1024*1024} +${BOOT_MENU_KEY}= ${ESC} +${SETUP_MENU_KEY}= ${F2} +${MANUFACTURER}= QEMU +${POWER_CTRL}= RteCtrl +${FLASHING_METHOD}= none + +${DMIDECODE_SERIAL_NUMBER}= N/A +${DMIDECODE_FIRMWARE_VERSION}= Dasharo (coreboot+UEFI) v0.2.0 +${DMIDECODE_PRODUCT_NAME}= QEMU x86 q35/ich9 +${DMIDECODE_RELEASE_DATE}= 06/21/2024 +${DMIDECODE_MANUFACTURER}= Emulation +${DMIDECODE_VENDOR}= 3mdeb +${DMIDECODE_FAMILY}= N/A +${DMIDECODE_TYPE}= Desktop # Supported test environments -${TESTS_IN_FIRMWARE_SUPPORT}= ${TRUE} -${TESTS_IN_UBUNTU_SUPPORT}= ${TRUE} -${TESTS_IN_METATB_SUPPORT}= ${TRUE} +${TESTS_IN_FIRMWARE_SUPPORT}= ${TRUE} +${TESTS_IN_UBUNTU_SUPPORT}= ${TRUE} +${TESTS_IN_METATB_SUPPORT}= ${TRUE} # Regression test flags -${DASHARO_SECURITY_MENU_SUPPORT}= ${TRUE} -${DASHARO_USB_MENU_SUPPORT}= ${TRUE} -${DASHARO_NETWORKING_MENU_SUPPORT}= ${TRUE} -${DASHARO_CHIPSET_MENU_SUPPORT}= ${TRUE} - -# Test module: dasharo-compatibility -${CUSTOM_BOOT_MENU_KEY_SUPPORT}= ${TRUE} -${CUSTOM_SETUP_MENU_KEY_SUPPORT}= ${TRUE} -${CUSTOM_NETWORK_BOOT_ENTRIES_SUPPORT}= ${TRUE} -${CUSTOM_LOGO_SUPPORT}= ${TRUE} -${USB_DISKS_DETECTION_SUPPORT}= ${TRUE} -${USB_KEYBOARD_DETECTION_SUPPORT}= ${TRUE} -${UEFI_SHELL_SUPPORT}= ${TRUE} -${IPXE_BOOT_SUPPORT}= ${TRUE} -${AUDIO_SUBSYSTEM_SUPPORT}= ${TRUE} -${FIRMWARE_NUMBER_VERIFICATION}= ${TRUE} -${PRODUCT_NAME_VERIFICATION}= ${TRUE} -${RELEASE_DATE_VERIFICATION}= ${TRUE} -${MANUFACTURER_VERIFICATION}= ${TRUE} -${VENDOR_VERIFICATION}= ${TRUE} -${TYPE_VERIFICATION}= ${TRUE} -${EMMC_SUPPORT}= ${TRUE} -${DTS_SUPPORT}= ${TRUE} -${UPLOAD_ON_USB_SUPPORT}= ${TRUE} -${RESET_TO_DEFAULTS_SUPPORT}= ${TRUE} -${ESP_SCANNING_SUPPORT}= ${TRUE} - -# Test module: dasharo-security -${TPM_SUPPORT}= ${TRUE} -${VERIFIED_BOOT_SUPPORT}= ${TRUE} -${VERIFIED_BOOT_POPUP_SUPPORT}= ${TRUE} -${MEASURED_BOOT_SUPPORT}= ${TRUE} -${SECURE_BOOT_SUPPORT}= ${TRUE} -${USB_STACK_SUPPORT}= ${TRUE} -${USB_MASS_STORAGE_SUPPORT}= ${TRUE} -${UEFI_PASSWORD_SUPPORT}= ${TRUE} - -# Test module: dasharo-performance -${SERIAL_BOOT_MEASURE}= ${TRUE} -${CPU_FREQUENCY_MEASURE}= ${TRUE} -${CPU_TEMPERATURE_MEASURE}= ${TRUE} -${PLATFORM_STABILITY_CHECKING}= ${TRUE} - -# Test module: trenchboot -${TRENCHBOOT_SUPPORT}= ${TRUE} - -${AUTO_BOOT_TIME_OUT_DEFAULT_VALUE}= 0 - -# Test module: dasharo-stability -${CAPSULE_UPDATE_SUPPORT}= ${TRUE} +${DASHARO_SECURITY_MENU_SUPPORT}= ${TRUE} +${DASHARO_USB_MENU_SUPPORT}= ${TRUE} +${DASHARO_NETWORKING_MENU_SUPPORT}= ${TRUE} +${DASHARO_INTEL_ME_MENU_SUPPORT}= ${TRUE} +${DASHARO_CHIPSET_MENU_SUPPORT}= ${TRUE} +${DASHARO_POWER_MGMT_MENU_SUPPORT}= ${TRUE} +${DASHARO_PCI_PCIE_MENU_SUPPORT}= ${TRUE} +${DASHARO_MEMORY_MENU_SUPPORT}= ${TRUE} *** Keywords *** diff --git a/platform-configs/rpi-3b.robot b/platform-configs/rpi-3b.robot index 223fcec657..75d071d63b 100644 --- a/platform-configs/rpi-3b.robot +++ b/platform-configs/rpi-3b.robot @@ -4,7 +4,7 @@ ${PAYLOAD}= ${TBD} ${RTE_S2_N_PORT}= 13541 ${FLASH_SIZE}= ${TBD} ${FLASH_LENGTH}= ${TBD} -${TIANOCORE_STRING}= ${TBD} +${FW_STRING}= ${TBD} ${BOOT_MENU_KEY}= ${TBD} ${SETUP_MENU_KEY}= ${TBD} ${BOOT_MENU_STRING}= ${TBD} diff --git a/scripts/ci/qemu-run.sh b/scripts/ci/qemu-run.sh index 3492446425..0cf47a5a22 100755 --- a/scripts/ci/qemu-run.sh +++ b/scripts/ci/qemu-run.sh @@ -30,7 +30,7 @@ TPM_LOG_FILE="${TPM_DIR}/log" # some cases. # TPM_VERSION="2.0" -QEMU_FW_FILE="./qemu_q35.rom" +QEMU_FW_FILE=${QEMU_FW_FILE:-./qemu_q35.rom} usage() { cat < /dev/null - -echo "Running QEMU Q35 with Dasharo (coreboot+UEFI) firmware ... (Ctrl+C to terminate)" +if [ "${ACTION}" == "uefi" ] || [ "${ACTION}" == "firmware" ]; then + echo "Clear UEFI variables" + echo "On each run on this script, the firmware settings would be restored to default." + dd if=/dev/zero of=${QEMU_FW_FILE} bs=256 count=1 conv=notrunc 2> /dev/null + echo "Running QEMU Q35 with Dasharo (coreboot+UEFI) firmware ... (Ctrl+C to terminate)" +else + echo "Running QEMU Q35 with Dasharo (coreboot+SeaBIOS) firmware ... (Ctrl+C to terminate)" +fi tpm_start qemu-system-x86_64 -m ${MEMORY} ${QEMU_PARAMS} || cleanup diff --git a/scripts/ci/qemu-self-test-seabios.sh b/scripts/ci/qemu-self-test-seabios.sh new file mode 100755 index 0000000000..73788b3677 --- /dev/null +++ b/scripts/ci/qemu-self-test-seabios.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Define an array of commands +commands=( + "robot -X -L TRACE -v config:qemu-selftests-seabios -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/setup-and-boot-seabios -v snipeit:no self-tests/setup-and-boot-seabios.robot" +) + +# Initialize a variable to track overall success +overall_success=0 + +# Execute each command and capture the exit codes +for cmd in "${commands[@]}"; do + eval $cmd + exit_code=$? + if [ $exit_code -ne 0 ]; then + overall_success=1 + fi +done + +# Exit with the appropriate status +exit $overall_success diff --git a/scripts/ci/qemu-self-test.sh b/scripts/ci/qemu-self-test.sh index 54427e3ed8..5aa0c61771 100755 --- a/scripts/ci/qemu-self-test.sh +++ b/scripts/ci/qemu-self-test.sh @@ -2,13 +2,13 @@ # Define an array of commands commands=( - "robot -L TRACE -v config:qemu-selftests -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/setup-and-boot-menus -v snipeit:no self-tests/setup-and-boot-menus.robot" - "robot -L TRACE -v config:qemu-selftests -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/dasharo-system-features-menus -v snipeit:no self-tests/dasharo-system-features-menus.robot" - "robot -L TRACE -v config:qemu-selftests -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/boolean-options -v snipeit:no self-tests/boolean-options.robot" - "robot -L TRACE -v config:qemu-selftests -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/numerical-options -v snipeit:no self-tests/numerical-options.robot" - "robot -L TRACE -v config:qemu-selftests -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/list-options -v snipeit:no self-tests/list-options.robot" - "robot -L TRACE -v config:qemu-selftests -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/secure-boot -v snipeit:no self-tests/secure-boot.robot" - "robot -L TRACE -v config:qemu-selftests -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/self-tests -v snipeit:no self-tests/terminal.robot" + "robot -X -L TRACE -v config:qemu-selftests-uefi -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/setup-and-boot-menus -v snipeit:no self-tests/setup-and-boot-menus.robot" + "robot -X -L TRACE -v config:qemu-selftests-uefi -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/dasharo-system-features-menus -v snipeit:no self-tests/dasharo-system-features-menus.robot" + "robot -X -L TRACE -v config:qemu-selftests-uefi -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/boolean-options -v snipeit:no self-tests/boolean-options.robot" + "robot -X -L TRACE -v config:qemu-selftests-uefi -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/numerical-options -v snipeit:no self-tests/numerical-options.robot" + "robot -X -L TRACE -v config:qemu-selftests-uefi -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/list-options -v snipeit:no self-tests/list-options.robot" + "robot -X -L TRACE -v config:qemu-selftests-uefi -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/secure-boot -v snipeit:no self-tests/secure-boot.robot" + "robot -X -L TRACE -v config:qemu-selftests-uefi -v rte_ip:127.0.0.1 -d ./logs/$(date +%Y.%m.%d_%H.%M.%S)/self-tests -v snipeit:no self-tests/terminal.robot" ) # Initialize a variable to track overall success diff --git a/self-tests/scrolling-boot-manager.robot b/self-tests/scrolling-boot-manager.robot index 14dadecf58..9ad108c261 100644 --- a/self-tests/scrolling-boot-manager.robot +++ b/self-tests/scrolling-boot-manager.robot @@ -28,10 +28,10 @@ Suite Teardown Run Keyword *** Test Cases *** -Enter Boot Menu Tianocore +Enter Boot Menu [Documentation] Test Enter Boot Menu kwd Prepare EFI Partition With System Files Power On - ${boot_menu}= Enter Boot Menu Tianocore And Return Construction + ${boot_menu}= Enter Boot Menu And Return Construction ${no_entries}= Get Length ${boot_menu} Should Be True ${no_entries} > 11 diff --git a/self-tests/setup-and-boot-menus.robot b/self-tests/setup-and-boot-menus.robot index 69bc3c7242..e2f2b557ec 100644 --- a/self-tests/setup-and-boot-menus.robot +++ b/self-tests/setup-and-boot-menus.robot @@ -28,25 +28,25 @@ Suite Teardown Run Keyword *** Test Cases *** -Enter Boot Menu Tianocore +Enter Boot Menu [Documentation] Test Enter Boot Menu kwd Power On - Enter Boot Menu Tianocore + Enter Boot Menu ${out}= Read From Terminal Until exit Should Contain ${out} Please select boot device: -Enter Boot Menu Tianocore And Return Construction +Enter Boot Menu And Return Construction [Documentation] Test Enter Boot Menu kwd Power On - ${menu}= Enter Boot Menu Tianocore And Return Construction + ${menu}= Enter Boot Menu And Return Construction List Should Not Contain Value ${menu} Please select boot device: List Should Contain Value ${menu} Setup Menu Construction Should Not Contain Control Text ${menu} -Enter Setup Menu Tianocore - [Documentation] Test Enter Setup Menu Tianocore kwd +Enter Setup Menu + [Documentation] Test Enter Setup Menu kwd Power On - Enter Setup Menu Tianocore + Enter Setup Menu ${out}= Read From Terminal Until Select Entry Should Contain ${out} Select Language @@ -212,7 +212,7 @@ Get Menu Construction Stress Test FOR ${i} IN RANGE 50 Log To Console Iteration: ${i} Power On - Enter Setup Menu Tianocore + Enter Setup Menu ${menu}= Get Setup Menu Construction Run Keyword And Continue On Failure Should Not Be Empty ${menu} diff --git a/self-tests/setup-and-boot-seabios.robot b/self-tests/setup-and-boot-seabios.robot new file mode 100644 index 0000000000..e6fb4d653b --- /dev/null +++ b/self-tests/setup-and-boot-seabios.robot @@ -0,0 +1,140 @@ +*** Settings *** +Documentation This suite verifies the correct operation of keywords +... entering and parsing Boot Menu, Setup Menu, and top-level submenus +... of the Setup Menu. + +Library Collections +Library OperatingSystem +Library Process +Library String +Library Telnet timeout=10 seconds connection_timeout=40 seconds +Library SSHLibrary timeout=90 seconds +Library RequestsLibrary +# TODO: maybe have a single file to include if we need to include the same +# stuff in all test cases +Resource ../variables.robot +Resource ../keywords.robot +Resource ../keys.robot +Resource ../pikvm-rest-api/pikvm_comm.robot + +# TODO: +# - document which setup/teardown keywords to use and what are they doing +# - go threough them and make sure they are doing what the name suggest (not +# exactly the case right now) +Suite Setup Run Keyword +... Prepare Test Suite +Suite Teardown Run Keyword +... Log Out And Close Connection + + +*** Test Cases *** +Enter Boot Menu + [Documentation] Test Enter Boot Menu kwd + Power On + Enter Boot Menu + ${out}= Read From Terminal Until [memtest] + Should Contain ${out} Select boot device: + +Enter Boot Menu And Return Construction + [Documentation] Test Enter Boot Menu And Return Construction kwd + Power On + ${menu}= Enter Boot Menu And Return Construction + List Should Not Contain Value ${menu} Select boot device: + List Should Contain Value ${menu} 1. DVD/CD [AHCI/2: QEMU DVD-ROM ATAPI-4 DVD/CD] + List Should Contain Value ${menu} 2. Payload [setup] + List Should Contain Value ${menu} 3. Payload [memtest] + List Should Contain Value ${menu} t. TPM Configuration + Menu Construction Should Not Contain Control Text ${menu} + +Enter Setup Menu + [Documentation] Test Enter Setup Menu kwd + Power On + Enter Setup Menu + ${out}= Read From Terminal Until Save configuration and exit + Should Contain ${out} PC Engines QEMU x86 q35/ich9 setup + +Get Menu Construction + [Documentation] Get Menu Construction kwd + Power On + Enter Setup Menu + ${menu}= Get Menu Construction Save configuration and exit 7 0 + List Should Not Contain Value ${menu} Boot order + List Should Contain Value ${menu} r Restore boot order defaults + List Should Contain Value ${menu} n Network/PXE boot - Currently Disabled + List Should Contain Value ${menu} u USB boot - Currently Enabled + List Should Contain Value ${menu} t Serial console - Currently Enabled + List Should Contain Value ${menu} k Redirect console output to COM2 - Currently Disabled + List Should Contain Value ${menu} o UART C - Currently Enabled - Toggle UART C / GPIO + List Should Contain Value ${menu} p UART D - Currently Enabled - Toggle UART D / GPIO + List Should Contain Value ${menu} m Force mPCIe2 slot CLK (GPP3 PCIe) - Currently Disabled + List Should Contain Value ${menu} h EHCI0 controller - Currently Disabled + List Should Contain Value ${menu} l Core Performance Boost - Currently Enabled + List Should Contain Value ${menu} i Watchdog - Currently Disabled + List Should Contain Value ${menu} j SD 3.0 mode - Currently Disabled + List Should Contain Value ${menu} g Reverse order of PCI addresses - Currently Disabled + List Should Contain Value ${menu} v IOMMU - Currently Disabled + List Should Contain Value ${menu} y PCIe power management features - Currently Disabled + List Should Contain Value ${menu} w Enable BIOS write protect - Currently Disabled + List Should Contain Value ${menu} z Clock menu + List Should Contain Value ${menu} x Exit setup without save + List Should Contain Value ${menu} s Save configuration and exit + Menu Construction Should Not Contain Control Text ${menu} + +Get Option State + [Documentation] Test Get Option State kwd + Power On + Enter Setup Menu + ${menu}= Get Menu Construction Save configuration and exit 7 0 + ${state}= Get Option State ${menu} Network/PXE boot + Should Contain ${state} Disabled + +Enter Menu From Snapshot + [Documentation] Test Enter Menu From Snapshot and Return sortbootorder Construction kwd + Power On + Enter Setup Menu + ${menu}= Get Menu Construction Save configuration and exit 7 0 + Enter Menu From Snapshot ${menu} Network/PXE boot + ${menu}= Get Menu Construction Save configuration and exit 7 0 + List Should Not Contain Value ${menu} Boot order + List Should Contain Value ${menu} r Restore boot order defaults + List Should Contain Value ${menu} n Network/PXE boot - Currently Enabled + List Should Contain Value ${menu} u USB boot - Currently Enabled + List Should Contain Value ${menu} t Serial console - Currently Enabled + List Should Contain Value ${menu} k Redirect console output to COM2 - Currently Disabled + List Should Contain Value ${menu} o UART C - Currently Enabled - Toggle UART C / GPIO + List Should Contain Value ${menu} p UART D - Currently Enabled - Toggle UART D / GPIO + List Should Contain Value ${menu} m Force mPCIe2 slot CLK (GPP3 PCIe) - Currently Disabled + List Should Contain Value ${menu} h EHCI0 controller - Currently Disabled + List Should Contain Value ${menu} l Core Performance Boost - Currently Enabled + List Should Contain Value ${menu} i Watchdog - Currently Disabled + List Should Contain Value ${menu} j SD 3.0 mode - Currently Disabled + List Should Contain Value ${menu} g Reverse order of PCI addresses - Currently Disabled + List Should Contain Value ${menu} v IOMMU - Currently Disabled + List Should Contain Value ${menu} y PCIe power management features - Currently Disabled + List Should Contain Value ${menu} w Enable BIOS write protect - Currently Disabled + List Should Contain Value ${menu} z Clock menu + List Should Contain Value ${menu} x Exit setup without save + List Should Contain Value ${menu} s Save configuration and exit + Menu Construction Should Not Contain Control Text ${menu} + +Enter TPM Configuration + [Documentation] Test Enter TPM Configuration kwd + Power On + Enter TPM Configuration + ${out}= Read From Terminal Until reboot the machine + Should Contain ${out} Clear TPM + +Enable Network Boot + [Documentation] Test Enable Network/PXE boot + Power On + Enable Network/PXE Boot + Enter Setup Menu + ${menu}= Get Menu Construction Save configuration and exit 7 0 + List Should Contain Value ${menu} n Network/PXE boot - Currently Enabled + +Enter iPXE + [Documentation] Test Enter iPXE kwd + Power On + Enter IPXE + ${out}= Read From Terminal Until autoboot + Should Contain ${out} ipxe shell