Skip to contentSkip to conversation

automation: add a smoke test for xen.efi on X86

PATCH In review Marek Marczykowski-Górecki 1 participant 2 messages Oct 2, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 automation: add a smoke test for xen.efi on X86

Check if xen.efi is bootable with an XTF dom0.

The TEST_TIMEOUT is set in the script to override project-global value. Setting it in the gitlab yaml file doesn't work, as it's too low priority
(https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence).

The multiboot2+EFI path is tested on hardware tests already.

---
This requires rebuilding debian:bookworm container.

The TEST_TIMEOUT issue mentioned above applies to xilix-* jobs too. It's not clear to me why the default TEST_TIMEOUT is set at the group level instead of in the yaml file, so I'm not adjusting the other places.

---
 automation/build/debian/bookworm.dockerfile |  1 +
 automation/gitlab-ci/test.yaml              |  7 ++++
 automation/scripts/qemu-smoke-x86-64-efi.sh | 44 +++++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100755 automation/scripts/qemu-smoke-x86-64-efi.sh
automation/build/debian/bookworm.dockerfile +1 -0
index 3dd70cb6b2e3..061114ba522d 100644
@@ -46,6 +46,7 @@ RUN apt-get update && \
         # for test phase, qemu-smoke-* jobs
         qemu-system-x86 \
         expect \
+        ovmf \
         # for test phase, qemu-alpine-* jobs
         cpio \
         busybox-static \
automation/gitlab-ci/test.yaml +7 -0
index 8675016b6a37..74fd3f3109ae 100644
@@ -463,6 +463,13 @@ qemu-smoke-x86-64-clang-pvh:
   needs:
     - debian-bookworm-clang-debug
 
+qemu-smoke-x86-64-gcc-efi:
+  extends: .qemu-x86-64
+  script:
+    - ./automation/scripts/qemu-smoke-x86-64-efi.sh pv 2>&1 | tee ${LOGFILE}
+  needs:
+    - debian-bookworm-gcc-debug
+
 qemu-smoke-riscv64-gcc:
   extends: .qemu-riscv64
   script:
automation/scripts/qemu-smoke-x86-64-efi.sh new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.46.0
#1 lore raw
Quoted 10 lines · Marek Marczykowski-Górecki

Check if xen.efi is bootable with an XTF dom0.

The TEST_TIMEOUT is set in the script to override project-global value. Setting it in the gitlab yaml file doesn't work, as it's too low priority
(https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence).

The multiboot2+EFI path is tested on hardware tests already.

Sorry, forgot a prerequisite patch - resent now as 2 patch series.

Quoted 96 lines

---
This requires rebuilding debian:bookworm container.

The TEST_TIMEOUT issue mentioned above applies to xilix-* jobs too. It's not clear to me why the default TEST_TIMEOUT is set at the group level instead of in the yaml file, so I'm not adjusting the other places.

---
 automation/build/debian/bookworm.dockerfile |  1 +
 automation/gitlab-ci/test.yaml              |  7 ++++
 automation/scripts/qemu-smoke-x86-64-efi.sh | 44 +++++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100755 automation/scripts/qemu-smoke-x86-64-efi.sh
automation/build/debian/bookworm.dockerfile +1 -0
index 3dd70cb6b2e3..061114ba522d 100644
@@ -46,6 +46,7 @@ RUN apt-get update && \
         # for test phase, qemu-smoke-* jobs
         qemu-system-x86 \
         expect \
+        ovmf \
         # for test phase, qemu-alpine-* jobs
         cpio \
         busybox-static \
automation/gitlab-ci/test.yaml +7 -0
index 8675016b6a37..74fd3f3109ae 100644
@@ -463,6 +463,13 @@ qemu-smoke-x86-64-clang-pvh:
   needs:
     - debian-bookworm-clang-debug
 
+qemu-smoke-x86-64-gcc-efi:
+  extends: .qemu-x86-64
+  script:
+    - ./automation/scripts/qemu-smoke-x86-64-efi.sh pv 2>&1 | tee ${LOGFILE}
+  needs:
+    - debian-bookworm-gcc-debug
+
 qemu-smoke-riscv64-gcc:
   extends: .qemu-riscv64
   script:
automation/scripts/qemu-smoke-x86-64-efi.sh new file +44 -0
new file mode 100755
index 000000000000..e053cfa995ba
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+set -ex -o pipefail
+
+# variant should be either pv or pvh
+variant=$1
+
+# Clone and build XTF
+git clone https://xenbits.xen.org/git-http/xtf.git
+cd xtf && make -j$(nproc) && cd -
+
+case $variant in
+    pvh) k=test-hvm64-example    extra="dom0-iommu=none dom0=pvh" ;;
+    *)   k=test-pv64-example     extra= ;;
+esac
+
+mkdir -p boot-esp/EFI/BOOT
+cp binaries/xen.efi boot-esp/EFI/BOOT/BOOTX64.EFI
+cp xtf/tests/example/$k boot-esp/EFI/BOOT/kernel
+
+cat > boot-esp/EFI/BOOT/BOOTX64.cfg <<EOF
+[global]
+default=test
+
+[test]
+options=loglvl=all console=com1 noreboot console_timestamps=boot $extra
+kernel=kernel
+EOF
+
+cp /usr/share/OVMF/OVMF_CODE.fd OVMF_CODE.fd
+cp /usr/share/OVMF/OVMF_VARS.fd OVMF_VARS.fd
+
+rm -f smoke.serial
+export TEST_CMD="qemu-system-x86_64 -nographic -M q35,kernel-irqchip=split \
+        -drive if=pflash,format=raw,readonly=on,file=OVMF_CODE.fd \
+        -drive if=pflash,format=raw,file=OVMF_VARS.fd \
+        -drive file=fat:rw:boot-esp,media=disk,index=0,format=raw \
+        -m 512 -monitor none -serial stdio"
+
+export TEST_LOG="smoke.serial"
+export PASSED="Test result: SUCCESS"
+export TEST_TIMEOUT=120
+
+./automation/scripts/console.exp | sed 's/\r\+$//'
Signature · 1 line
2.46.0
Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab