From nobody Sun May 12 22:18:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1668687629; cv=none; d=zohomail.com; s=zohoarc; b=hq8EBPo32OQIPfEWuhKnUeBkyu4P9HRIrJDBsh/TqKr1Hl1SlHCYJ3PFcx9QSp4y29mS1BbBQUAyZrVb8RJ4ygTtSlg/jBkEP1GoN+BvihzIAqWv7oYUElIKeuK0s5p8d+UUPsYWvUJ04d9qeCooZdPYYwAetwjiUvsRt37dNsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668687629; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=zppMS3RzLmE69IsYwkyZCWHtAwFFv5mlWItJsz2ebKo=; b=LbhXcObYAcnbkQrCGE6fMTkZJt7mDQOeCa+ruCUjmSzM+V3kDNPRIQOUSB6aLyeFKhfSt5m+Px6CRkFBEqI5o4Z7zTubI+MbpcQFDCB1MuTgdIJ7Q2vkPj1sk0h1H6+yytVx6W0d+I85EZMAX5rFLl9IZ790Z0L2IOQzdpxdXTc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1668687629458296.3581665346235; Thu, 17 Nov 2022 04:20:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovdre-0003ev-OT; Thu, 17 Nov 2022 07:19:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovdrc-0003eF-NN for qemu-devel@nongnu.org; Thu, 17 Nov 2022 07:19:28 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovdrN-0000lw-07 for qemu-devel@nongnu.org; Thu, 17 Nov 2022 07:19:28 -0500 Received: by mail-wr1-x435.google.com with SMTP id g12so3496210wrs.10 for ; Thu, 17 Nov 2022 04:19:12 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id r13-20020a05600c458d00b003c7087f6c9asm5743657wmo.32.2022.11.17.04.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 04:19:10 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 62A8B1FFB7; Thu, 17 Nov 2022 12:19:10 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zppMS3RzLmE69IsYwkyZCWHtAwFFv5mlWItJsz2ebKo=; b=LzrCaIivMO5Rlbb1xE1gYW1lRgw92kX+e4c3aQ2NEw4sVENVzGjC4Am5/IC2r9qYDN YhlR82srSnDINOzcCjRKrVjzi0jL9jHn41pju6OfNHkpKi85x1VMuKOXUoQGPwKB8v3m Gw3z++u4ZL0olJJYKrGI0iyd9JizK2JpzUVco8ra2dGn0qj+tiuc7RTy989bznfpzR6Q 37+Vh5rEVvYDMV3I6Z7nd4sRZI/EWJVtHCaP+9DepQW5tJJrAhVjknjKsXyh0RkZZdGE /xpkiQJR0N4rqHKDqX2WWjlnKT4b9QKIF7IWcpZhugG3cJH4egHtNasQ+OzBSeHhTzVh bgcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zppMS3RzLmE69IsYwkyZCWHtAwFFv5mlWItJsz2ebKo=; b=r7DJ+KvBpQ07tm2ex7uaPyfsX0WeGXyUmwf450DNxt1AGStRcS2owo1Dk4kBY9iq3B b6kxPcsVDdTlhbCwUdA3qHvr2B1QVBnzbhDcUzqZH5thBYz4ZYv0PR3Kpi4gAnpx3qJp 8bCW6SAmqdrEdjwrp9xMeD0UqR6hDbJpkjdQSUqAxxHrnVet2GQi3joI0QEY9pKm2omd e/+0316AaqvtDHyWp+KtebE0gJJ+NvKMJ1D5tdXlJk0tsZFlRULc/QlMnc3G5UqXA+BQ AU3rTgq6jo4e+TcYxC5/2XDatxpb1t3Xb1MwrJXT7z35XKaBn8vxfG9kgbnu1/MFq/Qp pcgg== X-Gm-Message-State: ANoB5pmEMRmProVQ51oKAVNGCfEgdI7IrU4D6K8WfDh6F2oLFP7VXsmU LT5WSRGwsDBMsp9gIukJTfwcAA== X-Google-Smtp-Source: AA0mqf4/+n307EnxYqsZ6gozdyj6A9Gd6qodf/u4Fo9f/sAc0yuWX/obZu0Hd95AeTbTmgUDxpmd9Q== X-Received: by 2002:a05:6000:1246:b0:22c:d593:f04d with SMTP id j6-20020a056000124600b0022cd593f04dmr1316966wrx.277.1668687551238; Thu, 17 Nov 2022 04:19:11 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, peter.maydell@linaro.org, thuth@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Beraldo Leal Subject: [RFC PATCH] tests/avocado: move aarch64 boot_linux tcg tests and slim down Date: Thu, 17 Nov 2022 12:19:00 +0000 Message-Id: <20221117121900.3922169-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1668687630647100001 The boot_linux tests download and run a full cloud image boot and start a full distro. While the ability to test the full boot chain is worthwhile it is perhaps a little too heavy weight and causes issues in CI. Fix this by dropping the TCG tests in boot_linux and replacing them with a alpine linux ISO boot in machine_aarch64_virt. This boots a fully loaded -cpu max with all the bells and whistles in 41s on my machine. A full debug build takes around 250s on my machine so we set a more generous timeout to cover that. We do drop testing for lesser GIC versions although there is some coverage for that already in the boot_xen.py tests. If we want to introduce more comprehensive testing we can do it with a custom kernel and initrd rather than a full distro boot. Signed-off-by: Alex Benn=C3=A9e --- tests/avocado/boot_linux.py | 43 +++++-------------------- tests/avocado/machine_aarch64_virt.py | 46 ++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 36 deletions(-) diff --git a/tests/avocado/boot_linux.py b/tests/avocado/boot_linux.py index 2be4be395d..0b747d5aa9 100644 --- a/tests/avocado/boot_linux.py +++ b/tests/avocado/boot_linux.py @@ -58,56 +58,29 @@ def test_pc_q35_kvm(self): self.launch_and_wait(set_up_ssh_connection=3DFalse) =20 =20 +# For Aarch64 we only boot KVM tests with the full LinuxTest cloud +# init. The TCG tests are run with lighter weight distros in the +# machine_aarch64_virt.py tests. class BootLinuxAarch64(LinuxTest): """ :avocado: tags=3Darch:aarch64 :avocado: tags=3Dmachine:virt - :avocado: tags=3Dmachine:gic-version=3D2 """ timeout =3D 240 =20 - def add_common_args(self): - self.vm.add_args('-bios', - os.path.join(BUILD_DIR, 'pc-bios', - 'edk2-aarch64-code.fd')) - self.vm.add_args('-device', 'virtio-rng-pci,rng=3Drng0') - self.vm.add_args('-object', 'rng-random,id=3Drng0,filename=3D/dev/= urandom') - - def test_virt_tcg_gicv2(self): - """ - :avocado: tags=3Daccel:tcg - :avocado: tags=3Dcpu:max - :avocado: tags=3Ddevice:gicv2 - """ - self.require_accelerator("tcg") - self.vm.add_args("-accel", "tcg") - self.vm.add_args("-cpu", "max,lpa2=3Doff") - self.vm.add_args("-machine", "virt,gic-version=3D2") - self.add_common_args() - self.launch_and_wait(set_up_ssh_connection=3DFalse) - - def test_virt_tcg_gicv3(self): - """ - :avocado: tags=3Daccel:tcg - :avocado: tags=3Dcpu:max - :avocado: tags=3Ddevice:gicv3 - """ - self.require_accelerator("tcg") - self.vm.add_args("-accel", "tcg") - self.vm.add_args("-cpu", "max,lpa2=3Doff") - self.vm.add_args("-machine", "virt,gic-version=3D3") - self.add_common_args() - self.launch_and_wait(set_up_ssh_connection=3DFalse) - def test_virt_kvm(self): """ :avocado: tags=3Daccel:kvm :avocado: tags=3Dcpu:host + :avocado: tags=3Dmachine:gic-version=3Dhost """ self.require_accelerator("kvm") self.vm.add_args("-accel", "kvm") self.vm.add_args("-machine", "virt,gic-version=3Dhost") - self.add_common_args() + self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios', + 'edk2-aarch64-code.fd')) + self.vm.add_args('-device', 'virtio-rng-pci,rng=3Drng0') + self.vm.add_args('-object', 'rng-random,id=3Drng0,filename=3D/dev/= urandom') self.launch_and_wait(set_up_ssh_connection=3DFalse) =20 =20 diff --git a/tests/avocado/machine_aarch64_virt.py b/tests/avocado/machine_= aarch64_virt.py index 21848cba70..19a2bcb7ad 100644 --- a/tests/avocado/machine_aarch64_virt.py +++ b/tests/avocado/machine_aarch64_virt.py @@ -1,4 +1,5 @@ -# Functional test that boots a Linux kernel and checks the console +# Functional test that boots a various Linux systems and checks the +# console output. # # Copyright (c) 2022 Linaro Ltd. # @@ -8,19 +9,62 @@ # SPDX-License-Identifier: GPL-2.0-or-later =20 import time +import os =20 from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado_qemu import exec_command +from avocado_qemu import BUILD_DIR =20 class Aarch64VirtMachine(QemuSystemTest): KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' + timeout =3D 360 =20 def wait_for_console_pattern(self, success_message, vm=3DNone): wait_for_console_pattern(self, success_message, failure_message=3D'Kernel panic - not syn= cing', vm=3Dvm) =20 + # This tests the whole boot chain from EFI to Userspace + # We only boot a whole OS for the current top level CPU and GIC + # Other test profiles should use more minimal boots + def test_virt_tcg_gic_max(self): + """ + :avocado: tags=3Darch:aarch64 + :avocado: tags=3Dmachine:virt + :avocado: tags=3Daccel:tcg + """ + iso_url =3D ('https://dl-cdn.alpinelinux.org/' + 'alpine/v3.16/releases/aarch64/' + 'alpine-standard-3.16.3-aarch64.iso') + + # Alpine use sha256 so I recalculated this myself + iso_sha1 =3D 'd2c461648ed9fe217c0f1bf90c2747d17244f1dc' + iso_path =3D self.fetch_asset(iso_url, asset_hash=3Diso_sha1) + + self.vm.set_console() + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'console=3DttyAMA0') + self.require_accelerator("tcg") + + self.vm.add_args("-accel", "tcg") + self.vm.add_args("-cpu", "max,pauth-impdef=3Don") + self.vm.add_args("-machine", + "virt,acpi=3Don," + "virtualization=3Don," + "mte=3Don," + "gic-version=3Dmax,iommu=3Dsmmuv3") + self.vm.add_args("-smp", "2", "-m", "1024") + self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios', + 'edk2-aarch64-code.fd')) + self.vm.add_args("-drive", f"file=3D{iso_path},format=3Draw") + self.vm.add_args('-device', 'virtio-rng-pci,rng=3Drng0') + self.vm.add_args('-object', 'rng-random,id=3Drng0,filename=3D/dev/= urandom') + + self.vm.launch() + self.wait_for_console_pattern('Welcome to Alpine Linux 3.16') + + def test_aarch64_virt(self): """ :avocado: tags=3Darch:aarch64 --=20 2.34.1