From patchwork Wed Apr 16 05:32:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Mukhin X-Patchwork-Id: 14053178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB79CC369B1 for ; Wed, 16 Apr 2025 05:32:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.954992.1348858 (Exim 4.92) (envelope-from ) id 1u4vNy-000478-An; Wed, 16 Apr 2025 05:32:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 954992.1348858; Wed, 16 Apr 2025 05:32:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4vNy-000471-7v; Wed, 16 Apr 2025 05:32:34 +0000 Received: by outflank-mailman (input) for mailman id 954992; Wed, 16 Apr 2025 05:32:33 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4vNx-00046f-FB for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 05:32:33 +0000 Received: from mail-24417.protonmail.ch (mail-24417.protonmail.ch [109.224.244.17]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3127d67d-1a84-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 07:32:31 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3127d67d-1a84-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1744781549; x=1745040749; bh=I6xOE6IislzVIpQe71QtAcik34VMMvqkaRSuLdsw86M=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=fEW6GH2u2lIWIFRNZJWlsuaRUd3HYkNlHlXrJsTuj84LarkMmumGzEhAINRUuUuA1 mwhczRZhYUarHOVKBLZq51rpwm8An/JcweqxYTHgpu02iLFBa4Vj8TWBjXNMGJ+f+8 Z4C08MW0GZ1QKGqzJ/GJJY5vJ4AyATQMOrF5tk68i+lEG3EnO5FmQWP7QFCOicBzZy XI2/YBqyRTjWNOn+ga2C0Eu9zBPdXzrY06PbNABaNVwja1AJ3STF4i1EBczUJ4A99l dDyGHHgV6K5b9Qjz4Fj6G5mYLH+0jzwKvNJkcv1tvXe5O+3inZw6Fb7TIHBdORN5Xs U30ddRqgd4Faw== Date: Wed, 16 Apr 2025 05:32:26 +0000 To: xen-devel@lists.xenproject.org From: dmkhn@proton.me Cc: andrew.cooper3@citrix.com, cardoe@cardoe.com, marmarek@invisiblethingslab.com, sstabellini@kernel.org, dmukhin@ford.com Subject: [PATCH v1 1/4] CI: unify x86 XTF test runner Message-ID: <20250416053213.921444-2-dmukhin@ford.com> In-Reply-To: <20250416053213.921444-1-dmukhin@ford.com> References: <20250416053213.921444-1-dmukhin@ford.com> Feedback-ID: 123220910:user:proton X-Pm-Message-ID: 728b72d9a8a7fd6ad4174252f2a6564c267c75ea MIME-Version: 1.0 From: Denis Mukhin 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. Signed-off-by: Denis Mukhin --- automation/gitlab-ci/test.yaml | 8 +- automation/scripts/.gitignore | 6 + .../scripts/include/configs/xtf-x86-64-config | 0 automation/scripts/include/xtf-runner | 134 ++++++++++++++++++ automation/scripts/include/xtf-x86-64 | 31 ++++ automation/scripts/qemu-smoke-x86-64.sh | 26 ---- automation/scripts/qemu-xtf.sh | 26 ++++ 7 files changed, 201 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 diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 5ce445b78f..3adc841335 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -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 diff --git a/automation/scripts/.gitignore b/automation/scripts/.gitignore new file mode 100644 index 0000000000..2f2d6e1ebd --- /dev/null +++ b/automation/scripts/.gitignore @@ -0,0 +1,6 @@ +!include + +binaries +smoke.serial +xen +xtf*/ diff --git a/automation/scripts/include/configs/xtf-x86-64-config b/automation/scripts/include/configs/xtf-x86-64-config new file mode 100644 index 0000000000..e69de29bb2 diff --git a/automation/scripts/include/xtf-runner b/automation/scripts/include/xtf-runner new file mode 100644 index 0000000000..55b7b34b89 --- /dev/null +++ b/automation/scripts/include/xtf-runner @@ -0,0 +1,134 @@ +#!/bin/bash +# +# XTF test utilities. +# +# Environment variables: +# BOOT_MSG: Expected boot message +# FW_PREFIX: Firmware images path including '/' at the end +# PASSED: XTF test printout in case of a pass +# QEMU_PREFIX: QEMU path including '/' at the end +# TEST_LOG: Output log file +# UBOOT_CMD: U-Boot command line +# WORKDIR: Test working directory +# XEN_BINARY: Xen binary location +# XEN_CONSOLE: Xen console device name +# XTF_SRC_CONFIG: XTF config file +# XTF_SRC_BRANCH: XTF branch +# XTF_SRC_URI: XTF source code URI + +function die() +{ + set +x + echo "FATAL: $*" >&2 + exit 1 +} + +[ -z "$TOP" ] && die "\$TOP is not set" + +# Output log file +TEST_LOG="${TEST_LOG:-smoke.serial}" +# XTF test printout in case of a pass +PASSED="${PASSED:-Test result: SUCCESS}" +# Expected boot message +BOOT_MSG="${BOOT_MSG:-Latest ChangeSet: }" +# Test working directory +WORKDIR="${WORKDIR:-binaries}" +# XTF source code +XTF_SRC_CONFIG="${XTF_CONFIG:-${TOP}/include/configs/xtf-${ARCH}-config}" + +# Build an XTF test binary. +# $1 Test variant. +# $2 Test name. +function xtf_build_binary() +{ + local xtf_variant=$1 + local xtf_name=$2 + local xtf_dir="xtf-${ARCH}" + + # Crude check for local testing + if [ ! -d ${xtf_dir}/.git ]; then + git clone ${XTF_SRC_URI} ${xtf_dir} -b ${XTF_SRC_BRANCH} + fi + + make \ + -C ${xtf_dir} \ + -j$(nproc) \ + $(tr '\n' ' ' < ${XTF_SRC_CONFIG}) \ + TESTS=tests/${xtf_name} + + export XTF_NAME="${xtf_name}" + export XTF_VARIANT="${xtf_variant}" + export XTF_WORKDIR="$(readlink -f ${xtf_dir})" + export XTF_BINARY="${XTF_WORKDIR}/tests/${xtf_name}/test-${xtf_variant}-${xtf_name}" +} + +# Build Xen command line for running an XTF test. +# $1 Test variant. +# $2 Test name. +function xtf_build_cmdline() +{ + local xtf_variant=$1 + local xtf_name=$2 + declare -a cmdline=() + + cmdline+=("loglvl=all noreboot console_timestamps=boot") + cmdline+=("console=${XEN_CONSOLE}") + + # NB: OK to have hvm64, which is x86-only variant + if [[ $xtf_variant == "hvm64" ]]; then + cmdline+=("dom0-iommu=none dom0=pvh") + fi + + export XEN_CMDLINE="${cmdline[@]}" +} + +# Build an XTF test environment. +# $1 Test variant. +# $2 Test name. +function xtf_build_test() +{ + local v=$1 + local xtf_name=$2 + local xtf_variant="" + + for x in ${XTF_SRC_VARIANTS}; do + if [[ "${x}" == "${v}" ]]; then + xtf_variant=${v} + break + fi + done + if [[ -z $xtf_variant ]]; then + die "unsupported test variant '$1', supported variants: ${XTF_SRC_VARIANTS}" + fi + + xtf_build_binary ${xtf_variant} ${xtf_name} + xtf_build_cmdline ${xtf_variant} ${xtf_name} +} + +# Execute an XTF test. +function xtf_run_test() +{ + rm -f ${TEST_LOG} + export BOOT_MSG PASSED TEST_CMD TEST_LOG UBOOT_CMD + ${TOP}/console.exp | sed 's/\r\+$//' +} + +# Setup environment and run an XTF test. +# $1 Test variant. +# $2 Test name. +function xtf_test() +{ + # Out: FW_*, QEMU_*, XEN_{BINARY,CONSOLE}, XTF_SRC_* + xtf_arch_prepare + + # In: XTF_SRC_* + # OUt: XTF_{BINARY,NAME,VARIANT,WORKDIR} and XEN_CMDLINE + xtf_build_test $@ + + # In: FW_*, QEMU_*, XTF_*, XEN_* + # Out: BOOT_MSG, PASSED, TEST_{CMD,LOG}, UBOOT_CMD + xtf_arch_setup + + # In: BOOT_MSG, PASSED, TEST_{CMD,LOG}, UBOOT_CMD + xtf_run_test +} diff --git a/automation/scripts/include/xtf-x86-64 b/automation/scripts/include/xtf-x86-64 new file mode 100644 index 0000000000..edddf18b38 --- /dev/null +++ b/automation/scripts/include/xtf-x86-64 @@ -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_CONSOLE="${XEN_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}\" \ + " +} diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh deleted file mode 100755 index da0c26cc2f..0000000000 --- a/automation/scripts/qemu-smoke-x86-64.sh +++ /dev/null @@ -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\+$//' diff --git a/automation/scripts/qemu-xtf.sh b/automation/scripts/qemu-xtf.sh new file mode 100755 index 0000000000..2e16d4aece --- /dev/null +++ b/automation/scripts/qemu-xtf.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# XTF test runner (QEMU). +# + +set -e -o pipefail + +if [ $# -lt 3 ]; then + echo "Usage: $(basename $0) ARCH XTF-VARIANT XTF-NAME" + exit 1 +fi + +export ARCH="$1" +shift + +export TOP="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +if [ ! -f "${TOP}/include/xtf-${ARCH}" ]; then + echo "unsupported architecture '${ARCH}'" >&2 + exit 1 +fi + +set -x +source ${TOP}/include/xtf-runner +source ${TOP}/include/xtf-${ARCH} + +xtf_test $@ From patchwork Wed Apr 16 05:32:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Mukhin X-Patchwork-Id: 14053180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1F5AC369BA for ; Wed, 16 Apr 2025 05:32:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.954993.1348869 (Exim 4.92) (envelope-from ) id 1u4vO5-0004PM-Hb; Wed, 16 Apr 2025 05:32:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 954993.1348869; Wed, 16 Apr 2025 05:32:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4vO5-0004PF-Ef; Wed, 16 Apr 2025 05:32:41 +0000 Received: by outflank-mailman (input) for mailman id 954993; Wed, 16 Apr 2025 05:32:39 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4vO3-0003si-Tg for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 05:32:39 +0000 Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 355c522c-1a84-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 07:32:38 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 355c522c-1a84-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1744781557; x=1745040757; bh=AsC8FP7AN+giDJPs6/iyPqqQiNrqpgVGQhnG1yoYCi4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=JEnZLa2M9kZ7soG75K1Uzov1+P2hkyjZ2r8d3F85XNMLwvU+WmGZtPrqQxO61+zO4 VVOyamDrDcUmTCb8y7KA9EHJRCkA4nHoqy61a1LSSwr7Hj+IGPjv8u0yRXMcnlodd0 kEFH9kVmeyl2EmQCvnZe8yDYs7fGqHXGGwmiDqWYG18R3xFxSEKSitfCRkq4f9JG7b 970oH1mHTjcz6H85ddUD+MfJEVXCXP0HnKjELaaucbBxVKWuiL9FeNhZQNbZ2Yvgea ix35DdFOtqJeIbKIcAThmuJv8lV0n67BKmHLKXPsGb4nwogu9/E21MIsv3Y7SSfhQX 5Ibqk7U5YAH1A== Date: Wed, 16 Apr 2025 05:32:31 +0000 To: xen-devel@lists.xenproject.org From: dmkhn@proton.me Cc: andrew.cooper3@citrix.com, cardoe@cardoe.com, marmarek@invisiblethingslab.com, sstabellini@kernel.org, dmukhin@ford.com Subject: [PATCH v1 2/4] CI: switch x86 EFI smoke test runner to qemu-xtf.sh Message-ID: <20250416053213.921444-3-dmukhin@ford.com> In-Reply-To: <20250416053213.921444-1-dmukhin@ford.com> References: <20250416053213.921444-1-dmukhin@ford.com> Feedback-ID: 123220910:user:proton X-Pm-Message-ID: d9a5239f7accab34cab2f853694de4d8faec8406 MIME-Version: 1.0 From: Denis Mukhin 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. Signed-off-by: Denis Mukhin --- 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 diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 3adc841335..ca1e4eb528 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -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 hvm64 example 2>&1 | tee ${LOGFILE} needs: - debian-12-x86_64-gcc-debug diff --git a/automation/scripts/include/configs/xtf-x86-64-efi-config b/automation/scripts/include/configs/xtf-x86-64-efi-config new file mode 100644 index 0000000000..e69de29bb2 diff --git a/automation/scripts/include/xtf-x86-64-efi b/automation/scripts/include/xtf-x86-64-efi new file mode 100644 index 0000000000..79622d5a6c --- /dev/null +++ b/automation/scripts/include/xtf-x86-64-efi @@ -0,0 +1,52 @@ +#!/bin/bash +# +# XTF test utilities (x86_64, EFI). +# + +# Arch-specific environment overrides. +function xtf_arch_prepare() +{ + export FW_PREFIX="${FW_PREFIX:-/usr/share/OVMF/}" + export QEMU_PREFIX="${QEMU_PREFIX:-}" + export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen.efi}" + export XEN_CONSOLE="${XEN_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() +{ + local esp_dir="${WORKDIR}/boot-esp" + local efi_dir="${esp_dir}/EFI/BOOT" + + # Generate EFI boot environment + mkdir -p ${efi_dir} + cp ${XEN_BINARY} ${efi_dir}/BOOTX64.EFI + cp ${XTF_BINARY} ${efi_dir}/kernel + + cat > ${efi_dir}/BOOTX64.cfg < boot-esp/EFI/BOOT/BOOTX64.cfg < X-Patchwork-Id: 14053181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 051A8C369BA for ; Wed, 16 Apr 2025 05:32:52 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.954995.1348879 (Exim 4.92) (envelope-from ) id 1u4vO8-0004ht-Q4; Wed, 16 Apr 2025 05:32:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 954995.1348879; Wed, 16 Apr 2025 05:32:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4vO8-0004hk-Mn; Wed, 16 Apr 2025 05:32:44 +0000 Received: by outflank-mailman (input) for mailman id 954995; Wed, 16 Apr 2025 05:32:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4vO7-0003si-FI for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 05:32:43 +0000 Received: from mail-10629.protonmail.ch (mail-10629.protonmail.ch [79.135.106.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3769d7d7-1a84-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 07:32:41 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3769d7d7-1a84-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1744781560; x=1745040760; bh=2pegpKuJrXYQi1LaLPh2IQLU6dFKWwZGALvyqz7kbTQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=EkNHT+Xd7YmF2Nj8KaZH5qeVvdAZie/+1Vg1TD2S5FUg7CGnnQDqxxc6tYfv6aZH4 16P03pNH+JfEu6TLAUYlSJXC+YM2Q1pM9N8ntIj5PNz3O4KIiwJdt3IwXakA66eWkv QDNObfsrUQmLjwdsxeUxs+uXHOERc64s/CiUGn3y1NqvJ0rl1IsFrohvGg0VnAkRUB 7dyEACndYKPFN22peWgosNPj2Mnmtkkmns+UGQjcQVuG8A8M7PcmjM/NvEyQskAw+k MDp2RBEgCXyCMvmsNC+1tEyfp4zomKwRISuqbRyOP3Jif36SRv3Sr8TGsV1eMgpLNw KafAHLOdzBcdw== Date: Wed, 16 Apr 2025 05:32:37 +0000 To: xen-devel@lists.xenproject.org From: dmkhn@proton.me Cc: andrew.cooper3@citrix.com, cardoe@cardoe.com, marmarek@invisiblethingslab.com, sstabellini@kernel.org, dmukhin@ford.com Subject: [PATCH v1 3/4] CI: switch arm64 XTF test runner to qemu-xtf.sh Message-ID: <20250416053213.921444-4-dmukhin@ford.com> In-Reply-To: <20250416053213.921444-1-dmukhin@ford.com> References: <20250416053213.921444-1-dmukhin@ford.com> Feedback-ID: 123220910:user:proton X-Pm-Message-ID: 5e8b4d47754f1fc6a00317c667c22976030e8f80 MIME-Version: 1.0 From: Denis Mukhin Hook arm64 QEMU configuration to qemu-xtf.sh and use new script in arm64 CI jobs. Signed-off-by: Denis Mukhin Reviewed-by: Stefano Stabellini --- 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 diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index ca1e4eb528..d6e4a0a622 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -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 diff --git a/automation/scripts/.gitignore b/automation/scripts/.gitignore index 2f2d6e1ebd..f853da4d89 100644 --- a/automation/scripts/.gitignore +++ b/automation/scripts/.gitignore @@ -1,6 +1,9 @@ !include binaries +imagebuilder smoke.serial xen xtf*/ + +*.rom diff --git a/automation/scripts/include/configs/xtf-arm64-config b/automation/scripts/include/configs/xtf-arm64-config new file mode 100644 index 0000000000..9942740927 --- /dev/null +++ b/automation/scripts/include/configs/xtf-arm64-config @@ -0,0 +1,2 @@ +CONFIG_GICV2=y +CONFIG_SBSA_UART=y diff --git a/automation/scripts/include/xtf-arm64 b/automation/scripts/include/xtf-arm64 new file mode 100644 index 0000000000..68487fe617 --- /dev/null +++ b/automation/scripts/include/xtf-arm64 @@ -0,0 +1,81 @@ +#!/bin/bash +# +# XTF test utilities (arm64). +# + +# Arch-specific environment overrides. +function xtf_arch_prepare() +{ + export FW_PREFIX="${FW_PREFIX:-/usr/lib/u-boot/qemu_arm64/}" + export QEMU_PREFIX="${QEMU_PREFIX:-${WORKDIR}/}" + export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}" + export XEN_CONSOLE="${XEN_CONSOLE:-dtuart}" + export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-xtf-arm}" + export XTF_SRC_URI="${XTF_SRC_URI:-https://gitlab.com/xen-project/fusa/xtf.git}" + export XTF_SRC_VARIANTS="mmu64le" +} + +# Perform arch-specific XTF environment setup. +function xtf_arch_setup() +{ + # QEMU looks for "efi-virtio.rom" even if it is unneeded + curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom + + # Crude check for local testing + if [ ! -d imagebuilder/.git ]; then + git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git + fi + + cat > ${WORKDIR}/config < binaries/config - -rm -rf imagebuilder -git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git -bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/config - -# Run the test -rm -f smoke.serial -export TEST_CMD="./binaries/qemu-system-aarch64 \ - -machine virtualization=true \ - -cpu cortex-a57 -machine type=virt \ - -m 2048 -monitor none -serial stdio \ - -smp 2 \ - -no-reboot \ - -device virtio-net-pci,netdev=n0 \ - -netdev user,id=n0,tftp=binaries \ - -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin" - -export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000" -export BOOT_MSG="Latest ChangeSet: " -export TEST_LOG="smoke.serial" -export PASSED="${passed}" - -./automation/scripts/console.exp | sed 's/\r\+$//' From patchwork Wed Apr 16 05:32:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Mukhin X-Patchwork-Id: 14053182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 955A6C369BA for ; Wed, 16 Apr 2025 05:32:55 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.954999.1348889 (Exim 4.92) (envelope-from ) id 1u4vOB-00054N-87; Wed, 16 Apr 2025 05:32:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 954999.1348889; Wed, 16 Apr 2025 05:32:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4vOB-00054E-5A; Wed, 16 Apr 2025 05:32:47 +0000 Received: by outflank-mailman (input) for mailman id 954999; Wed, 16 Apr 2025 05:32:46 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u4vOA-0003si-LW for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 05:32:46 +0000 Received: from mail-24418.protonmail.ch (mail-24418.protonmail.ch [109.224.244.18]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3965d38f-1a84-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 07:32:45 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3965d38f-1a84-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1744781564; x=1745040764; bh=D9Cgha2SO1BNucjhG9GORmWwPJ0BvTYcJSIZrXZF8Ws=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=LyC3YwHxpH0xYzYvbah4TcAHDJ+Eqs7f133qf0qa3ZFyUuuHcRl+PakFFepucYOwP QXURvwsSd6rzMFvzA+/2FITM9xk9s2JoP/Gk4qvhyjuFIY40M89vQAGZ4NCLZ2BhMf SBxdWp2jV9uUB0btrgICFhEav0+Uj0qscPZjGut0z5gRO8VxyIlepHBK9Yyrpf894w cqnhzu0ovbsCnw4oYT+Q/XmOLs4nxE5jebP9GiKVoFMNYYOJIIR0ov3gIExtpVzNsD ltfm3fMer7ZVj+/h/BnTc1QG+uw2B5eetIOfM13Jh/Bv4whVGH/SGL9zvig1w4rVt8 TpUE7Tdm8Saeg== Date: Wed, 16 Apr 2025 05:32:41 +0000 To: xen-devel@lists.xenproject.org From: dmkhn@proton.me Cc: andrew.cooper3@citrix.com, cardoe@cardoe.com, marmarek@invisiblethingslab.com, sstabellini@kernel.org, dmukhin@ford.com Subject: [PATCH v1 4/4] CI: add argo x86 XTF test Message-ID: <20250416053213.921444-5-dmukhin@ford.com> In-Reply-To: <20250416053213.921444-1-dmukhin@ford.com> References: <20250416053213.921444-1-dmukhin@ford.com> Feedback-ID: 123220910:user:proton X-Pm-Message-ID: f05f6260e2cd634798a6c0dfc99d27a6ec6a89a4 MIME-Version: 1.0 From: Denis Mukhin 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. Signed-off-by: Denis Mukhin --- automation/gitlab-ci/test.yaml | 9 +++++++++ automation/scripts/include/xtf-runner | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index d6e4a0a622..9001efb45c 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -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: diff --git a/automation/scripts/include/xtf-runner b/automation/scripts/include/xtf-runner index 55b7b34b89..12470b3979 100644 --- a/automation/scripts/include/xtf-runner +++ b/automation/scripts/include/xtf-runner @@ -70,6 +70,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+=("loglvl=all noreboot console_timestamps=boot") cmdline+=("console=${XEN_CONSOLE}") @@ -79,6 +82,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[@]}" }