Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SeaBIOS support #574

Open
wants to merge 33 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2a1aba8
add support for BIOS_LIB uefi or seabios
pietrushnic Nov 22, 2024
38dbe77
add lib/bios/seabios.robot, remove resource menus.robot
pietrushnic Nov 8, 2024
44b5018
platform-configs/include/default.robot: disable OPTIONS_LIB, which de…
pietrushnic Nov 8, 2024
55e14fa
platform-configs/qemu-selftests.robot: change configuration to one us…
pietrushnic Nov 8, 2024
9fcaf08
scripts/ci/qemu-run.sh: give ability to provide QEMU_FW_FILE through …
pietrushnic Nov 8, 2024
bca7507
scripts/ci/qemu-run.sh: enabled kvm only if it supported
pietrushnic Nov 8, 2024
9fed386
scripts/ci/qemu-self-test-seabios.sh: initial commit
pietrushnic Nov 8, 2024
bba6a4d
self-tests/setup-and-boot-seabios.robot: initial commit
pietrushnic Nov 8, 2024
d6d1c32
scripts: add support for Dasharo (coreboot+SeaBIOS) for QEMU Q35
pietrushnic Nov 12, 2024
87e2b6f
lib/bios/seabios.robot: add more keywords and its tests
pietrushnic Nov 13, 2024
9d3a4d6
.github/workflows/qemu-self-test-seabios.yml: initial commit
pietrushnic Nov 25, 2024
13fa3f6
platform-configs/qemu: swap release and selftests configs
macpijan Nov 26, 2024
329f474
platform-configs/qemu-selftests-uefi.robot: use common part from qemu…
macpijan Nov 26, 2024
48a7ffe
keywords.robot: do not import lib/bios/menus.robot twice
pietrushnic Nov 26, 2024
f15c763
platform-configs/qemu-selftests-uefi.robot: fix resource order
pietrushnic Nov 26, 2024
3fc5a86
platform-configs,scripts: make BIOS_LIB=uefi default and override onl…
pietrushnic Nov 26, 2024
13b6871
platform-configs/qemu-selftests-seabios.robot: import common qemu.rob…
pietrushnic Nov 26, 2024
e84c0ea
docs,scripts: keep firmware option for qemu-run.sh as backward compat…
pietrushnic Nov 26, 2024
c6de4d6
rename lib/bios/menus.robot -> lib/bios/edk2.robot
pietrushnic Nov 27, 2024
b2aeac0
use platform-defined FW_STRING instead of {SEABIOS,TIANOCORE}_STRING
pietrushnic Nov 27, 2024
3fa1672
lib/bios/common.robot: initial support for common Enter Boot Menu kwd
pietrushnic Nov 27, 2024
ea76664
add unified Enter Boot Menu and Return Construction
pietrushnic Nov 27, 2024
db3a1ad
lib/bios/seabios.robot: remove unused Get IPXE Boot Menu Construction
pietrushnic Nov 28, 2024
ced49a6
lib/bios/seabios.robot: remove unused Get RTC Clock Submenu Construction
pietrushnic Nov 29, 2024
de96c46
unify Enter Setup Menu kwd for uefi and seabios
pietrushnic Nov 29, 2024
fcdf8fa
lib/bios: user Get Menu Construction instead of SeaBIOS dedicated wra…
pietrushnic Dec 2, 2024
57289d9
lib/bios/seabios.robot: remove unused keywords
pietrushnic Dec 2, 2024
880043d
lib/bios/edk2.robot: remove Get Menu Consutruction use common implmen…
pietrushnic Dec 2, 2024
d8b7190
lib/bios/seabios.robot: align API with edk2 lib
pietrushnic Dec 2, 2024
c7f0aeb
lib/bios: move Get Index Of Matching Option In Menu to common
pietrushnic Dec 2, 2024
728bf25
lib/bios: move Boot System Or From Connected Disk to common lib
filipleple Dec 6, 2024
b193b25
platform-configs/optiplex-7010-seabios.robot: add
filipleple Dec 6, 2024
76ccdd9
lib/bios: make Boot System Or From Connected Disk more generic
filipleple Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/qemu-self-test-seabios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Keywords self-tests for Dasharo (coreboot+SeaBIOS) on QEMU Q35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this is copied from existing file, so we could avoid duplication: https://docs.github.com/en/actions/sharing-automations/reusing-workflows

Not a high priority, we can also leave it in issues.

I can also imagine, we would like to reuse this workflow not only in this repo, but use very similar config in e.g. coreboot or edk2 repos in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should stick to GH's actions. The question is if this would be reliable. Sooner or later, we will exhaust the pool of free actions and storage. I don't see ourselves switching to paid GH, so I would switch to our Woodpecker CI instead.

But I get your point about reusability. My gh-actions-fu was not good enough to be aware of that possibility. There is no space for such work for now, but we should track it as a potential improvement. Based on your comment, I will create an issue for the following PC Engines release.


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
4 changes: 2 additions & 2 deletions .github/workflows/qemu-self-test.yml
Original file line number Diff line number Diff line change
@@ -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]

Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions dasharo-compatibility/apu-configuration-menu.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
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
4 changes: 2 additions & 2 deletions dasharo-compatibility/custom-boot-menu-key.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
2 changes: 1 addition & 1 deletion dasharo-compatibility/ec-and-super-IO.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions dasharo-compatibility/esp-scanning.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -85,15 +85,15 @@ 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
[Documentation] This test aims to verify that the firmware will not
... 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
Expand All @@ -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
10 changes: 5 additions & 5 deletions dasharo-compatibility/memory-profile.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down 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
Loading
Loading