Skip to contentSkip to conversation

CI: updates to XTF CI runners

PATCH In review [email protected] 2 participants 7 messages Apr 22, 2025

lore
Share & tools
lore
#0 lore raw

v3 cover CI: updates to XTF CI runners

The series started from adding new argo XTF CI job and ended up with updating all XTF runners and related CI jobs.

It unifies the XTF runner scripts so that it is possible to use one script for executing any XTF test under QEMU. That simplifies running XTFs locally and in CI.

Patch 1 reworks x86 XTF runner.
Patch 2 reworks x86 EFI XTF.
Patch 3 reworks Arm64 XTF runner.
Patch 4 adds new argo x86 XTF CI job.

CI run: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/1778812896

Denis Mukhin (4):
CI: unify x86 XTF test runner
CI: switch x86 EFI smoke test runner to qemu-xtf.sh
CI: switch arm64 XTF test runner to qemu-xtf.sh
CI: add argo x86 XTF test

 automation/gitlab-ci/test.yaml                |  23 ++-
 automation/scripts/.gitignore                 |   6 +
 .../scripts/include/configs/xtf-arm64-config  |   2 +
 .../scripts/include/configs/xtf-x86-64-config |   0
 .../include/configs/xtf-x86-64-efi-config     |   0
 automation/scripts/include/xtf-arm64          |  81 ++++++++++
 automation/scripts/include/xtf-runner         | 138 ++++++++++++++++++
 automation/scripts/include/xtf-x86-64         |  31 ++++
 automation/scripts/include/xtf-x86-64-efi     |  52 +++++++
 automation/scripts/qemu-smoke-x86-64-efi.sh   |  43 ------
 automation/scripts/qemu-smoke-x86-64.sh       |  26 ----
 automation/scripts/qemu-xtf-dom0less-arm64.sh |  68 ---------
 automation/scripts/qemu-xtf.sh                |  28 ++++
 13 files changed, 354 insertions(+), 144 deletions(-)
 create mode 100644 automation/scripts/.gitignore
 create mode 100644 automation/scripts/include/configs/xtf-arm64-config
 create mode 100644 automation/scripts/include/configs/xtf-x86-64-config
 create mode 100644 automation/scripts/include/configs/xtf-x86-64-efi-config
 create mode 100644 automation/scripts/include/xtf-arm64
 create mode 100644 automation/scripts/include/xtf-runner
 create mode 100644 automation/scripts/include/xtf-x86-64
 create mode 100644 automation/scripts/include/xtf-x86-64-efi
 delete mode 100755 automation/scripts/qemu-smoke-x86-64-efi.sh
 delete mode 100755 automation/scripts/qemu-smoke-x86-64.sh
 delete mode 100755 automation/scripts/qemu-xtf-dom0less-arm64.sh
 create mode 100755 automation/scripts/qemu-xtf.sh
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/4 CI: unify x86 XTF test runner

From: Denis Mukhin <[email protected]>

Add test runner script qemu-xtf.sh which is allows any XTF x86 test to be easily executed. Test runner is invoked from the qemu-smoke* jobs with the hardcoded parameters.

Each x86 XTF job lead time is reduced a bit since only the test-related code is built, not the entire XTF project.

Add .gitignore to avoid committing test artifacts by mistake.

---
Changes v2->v3:
- fixes for .gitignore

---
 automation/gitlab-ci/test.yaml                |   8 +-
 automation/scripts/.gitignore                 |   3 +
 .../scripts/include/configs/xtf-x86-64-config |   0
 automation/scripts/include/xtf-runner         | 131 ++++++++++++++++++
 automation/scripts/include/xtf-x86-64         |  31 +++++
 automation/scripts/qemu-smoke-x86-64.sh       |  26 ----
 automation/scripts/qemu-xtf.sh                |  28 ++++
 7 files changed, 197 insertions(+), 30 deletions(-)
 create mode 100644 automation/scripts/.gitignore
 create mode 100644 automation/scripts/include/configs/xtf-x86-64-config
 create mode 100644 automation/scripts/include/xtf-runner
 create mode 100644 automation/scripts/include/xtf-x86-64
 delete mode 100755 automation/scripts/qemu-smoke-x86-64.sh
 create mode 100755 automation/scripts/qemu-xtf.sh
automation/gitlab-ci/test.yaml +4 -4
index 5ce445b78f..3adc841335 100644
@@ -659,28 +659,28 @@ qemu-alpine-x86_64-gcc:
 qemu-smoke-x86-64-gcc:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
 qemu-smoke-x86-64-clang:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-clang-debug
 
 qemu-smoke-x86-64-gcc-pvh:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pvh 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 hvm64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
 qemu-smoke-x86-64-clang-pvh:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64.sh pvh 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64 hvm64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-clang-debug
 
automation/scripts/.gitignore new file +3 -0
new file mode 100644
index 0000000000..310a577bef
@@ -0,0 +1,3 @@
+/binaries/
+/smoke.serial
+/xtf-*/
automation/scripts/include/configs/xtf-x86-64-config new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
automation/scripts/include/xtf-runner new file +131 -0

131 lines not on this page · raw message

automation/scripts/include/xtf-x86-64 new file +31 -0
new file mode 100644
index 0000000000..b1b0cc201e
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# XTF test utilities (x86_64).
+#
+
+# Arch-specific environment overrides.
+function xtf_arch_prepare()
+{
+    export FW_PREFIX="${FW_PREFIX:-}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-}"
+    export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
+    export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=com1}"
+    export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-master}"
+    export XTF_SRC_URI="${XTF_SRC_URI:-https://xenbits.xen.org/git-http/xtf.git}"
+    export XTF_SRC_VARIANTS="hvm64 pv64"
+}
+
+# Perform arch-specific XTF environment setup.
+function xtf_arch_setup()
+{
+    export TEST_CMD="${QEMU_PREFIX}qemu-system-x86_64 \
+        -no-reboot \
+        -nographic \
+        -monitor none \
+        -serial stdio \
+        -m 512 \
+        -kernel ${XEN_BINARY} \
+        -initrd ${XTF_BINARY} \
+        -append \"${XEN_CMDLINE}\" \
+    "
+}
automation/scripts/qemu-smoke-x86-64.sh deleted +0 -26
deleted file mode 100755
index da0c26cc2f..0000000000
@@ -1,26 +0,0 @@
-#!/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
-
-rm -f smoke.serial
-export TEST_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
-        -initrd xtf/tests/example/$k \
-        -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
-        -m 512 -monitor none -serial stdio"
-
-export TEST_LOG="smoke.serial"
-export PASSED="Test result: SUCCESS"
-
-./automation/scripts/console.exp | sed 's/\r\+$//'
automation/scripts/qemu-xtf.sh new file +28 -0
new file mode 100755
index 0000000000..55c221b36d
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# XTF test runner (QEMU).
+#
+
+set -e -o pipefail
+
+if [ $# -lt 3 ]; then
+    echo "Usage: $(basename $0) ARCH XTF-VARIANT XTF-NAME"
+    exit 0
+fi
+
+export ARCH="$1"
+shift
+
+set -x
+
+export XEN_ROOT="${PWD}"
+cd $(dirname $0)
+
+source include/xtf-runner
+
+if [ ! -f "include/xtf-${ARCH}" ]; then
+    die "unsupported architecture '${ARCH}'"
+fi
+source include/xtf-${ARCH}
+
+xtf_test $@
Signature · 1 line
2.34.1
#2 lore raw

PATCH v3 2/4 CI: switch x86 EFI smoke test runner to qemu-xtf.sh

In reply to [email protected]

From: Denis Mukhin <[email protected]>

Use qemu-xtf.sh for qemu-smoke-x86-64-gcc-efi job.

Lead time is reduced a bit since not all XTF code base is built, just the required test.

---
Changes v2->v3:
- use pv64 variant for EFI job

---
 automation/gitlab-ci/test.yaml                |  2 +-
 .../include/configs/xtf-x86-64-efi-config     |  0
 automation/scripts/include/xtf-x86-64-efi     | 52 +++++++++++++++++++
 automation/scripts/qemu-smoke-x86-64-efi.sh   | 43 ---------------
 4 files changed, 53 insertions(+), 44 deletions(-)
 create mode 100644 automation/scripts/include/configs/xtf-x86-64-efi-config
 create mode 100644 automation/scripts/include/xtf-x86-64-efi
 delete mode 100755 automation/scripts/qemu-smoke-x86-64-efi.sh
automation/gitlab-ci/test.yaml +1 -1
index 3adc841335..1d89575b24 100644
@@ -687,7 +687,7 @@ qemu-smoke-x86-64-clang-pvh:
 qemu-smoke-x86-64-gcc-efi:
   extends: .qemu-smoke-x86-64
   script:
-    - ./automation/scripts/qemu-smoke-x86-64-efi.sh pv 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh x86-64-efi pv64 example 2>&1 | tee ${LOGFILE}
   needs:
     - debian-12-x86_64-gcc-debug
 
automation/scripts/include/configs/xtf-x86-64-efi-config new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
automation/scripts/include/xtf-x86-64-efi new file +52 -0

52 lines not on this page · raw message

automation/scripts/qemu-smoke-x86-64-efi.sh deleted +0 -43

43 lines not on this page · raw message

Signature · 1 line
2.34.1
#3 lore raw

PATCH v3 3/4 CI: switch arm64 XTF test runner to qemu-xtf.sh

In reply to [email protected]

From: Denis Mukhin <[email protected]>

Hook arm64 QEMU configuration to qemu-xtf.sh and use new script in arm64 CI jobs.

---
Changes v2->v3:
- .gitignore fixup
- Kept Stefano's R-b since the change was trivial

---
 automation/gitlab-ci/test.yaml                |  4 +-
 automation/scripts/.gitignore                 |  3 +
 .../scripts/include/configs/xtf-arm64-config  |  2 +
 automation/scripts/include/xtf-arm64          | 81 +++++++++++++++++++
 automation/scripts/qemu-xtf-dom0less-arm64.sh | 68 ----------------
 5 files changed, 88 insertions(+), 70 deletions(-)
 create mode 100644 automation/scripts/include/configs/xtf-arm64-config
 create mode 100644 automation/scripts/include/xtf-arm64
 delete mode 100755 automation/scripts/qemu-xtf-dom0less-arm64.sh
automation/gitlab-ci/test.yaml +2 -2
index 1d89575b24..a603d4039a 100644
@@ -571,7 +571,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-earlyprintk:
 qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
   extends: .qemu-arm64
   script:
-    - ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
     - alpine-3.18-gcc-arm64
     - qemu-system-aarch64-6.0.0-arm64-export
@@ -579,7 +579,7 @@ qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
 qemu-xtf-dom0less-arm64-gcc-debug-hyp-xen-version:
   extends: .qemu-arm64
   script:
-    - ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
     - alpine-3.18-gcc-debug-arm64
     - qemu-system-aarch64-6.0.0-arm64-export
automation/scripts/.gitignore +3 -0
index 310a577bef..a01b533c60 100644
@@ -1,3 +1,6 @@
 /binaries/
+/imagebuilder/
 /smoke.serial
 /xtf-*/
+
+*.rom
automation/scripts/include/configs/xtf-arm64-config new file +2 -0
new file mode 100644
index 0000000000..9942740927
@@ -0,0 +1,2 @@
+CONFIG_GICV2=y
+CONFIG_SBSA_UART=y
automation/scripts/include/xtf-arm64 new file +81 -0

81 lines not on this page · raw message

automation/scripts/qemu-xtf-dom0less-arm64.sh deleted +0 -68

68 lines not on this page · raw message

Signature · 1 line
2.34.1
#4 lore raw

PATCH v3 4/4 CI: add argo x86 XTF test

In reply to [email protected]

From: Denis Mukhin <[email protected]>

Introduce new CI job to run x86 XTF argo test under QEMU to smoke test argo feature functionality in upstream CI.

The new job lead time is ~30s, limit max job duration to 60s.

---
Changes v2->v3:
- Added Stefano's R-b

---
 automation/gitlab-ci/test.yaml        | 9 +++++++++
 automation/scripts/include/xtf-runner | 7 +++++++
 2 files changed, 16 insertions(+)
automation/gitlab-ci/test.yaml +9 -0
index a603d4039a..eba41f4048 100644
@@ -691,6 +691,15 @@ qemu-smoke-x86-64-gcc-efi:
   needs:
     - debian-12-x86_64-gcc-debug
 
+qemu-xtf-argo-x86_64-gcc-debug:
+  extends: .qemu-smoke-x86-64
+  variables:
+    TEST_TIMEOUT_OVERRIDE: 60
+  script:
+    - ./automation/scripts/qemu-xtf.sh x86-64 pv64 argo 2>&1 | tee ${LOGFILE}
+  needs:
+    - alpine-3.18-gcc-debug
+
 qemu-smoke-riscv64-gcc:
   extends: .qemu-riscv64
   script:
automation/scripts/include/xtf-runner +7 -0
index 320eb65dc8..b7fea52dad 100644
@@ -68,6 +68,9 @@ function xtf_build_cmdline()
     local xtf_variant=$1
     local xtf_name=$2
     declare -a cmdline=()
+    declare -A per_test_args=(
+        [argo]="argo=1 mac-permissive=1"
+    )
 
     cmdline+=("${XEN_CMDLINE}")
 
@@ -76,6 +79,10 @@ function xtf_build_cmdline()
         cmdline+=("dom0-iommu=none dom0=pvh")
     fi
 
+    if [[ -v per_test_args[${xtf_name}] ]]; then
+        cmdline+=("${per_test_args[${xtf_name}]}")
+    fi
+
     export XEN_CMDLINE="${cmdline[@]}"
 }
 
Signature · 1 line
2.34.1
#5 lore raw
In reply to [email protected]
Quoted 11 lines · On Tue, 22 Apr 2025, [email protected] wrote:

The series started from adding new argo XTF CI job and ended up with updating all XTF runners and related CI jobs.

It unifies the XTF runner scripts so that it is possible to use one script for executing any XTF test under QEMU. That simplifies running XTFs locally and in CI.

Patch 1 reworks x86 XTF runner.
Patch 2 reworks x86 EFI XTF.
Patch 3 reworks Arm64 XTF runner.
Patch 4 adds new argo x86 XTF CI job.

I committed the first 3 patches. For the last patch, I take we need to wait for the argo test to land in XTF?

#6 lore raw
Quoted 9 lines · Stefano Stabellini
Quoted 7 lines · On Tue, 22 Apr 2025, [email protected] wrote:

The series started from adding new argo XTF CI job and ended up with updating all XTF runners and related CI jobs.

It unifies the XTF runner scripts so that it is possible to use one script for executing any XTF test under QEMU. That simplifies running XTFs locally and in CI.

Quoted 7 lines
Quoted 4 lines

Patch 1 reworks x86 XTF runner.
Patch 2 reworks x86 EFI XTF.
Patch 3 reworks Arm64 XTF runner.
Patch 4 adds new argo x86 XTF CI job.

I committed the first 3 patches. For the last patch, I take we need to wait for the argo test to land in XTF?

Thanks!

Yes, we need argo XTF test.