From nobody Sun Nov 24 09:46:14 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=1724328573; cv=none; d=zohomail.com; s=zohoarc; b=cZa6I4GBWBjbj5P8uB5mDKuPGyaLAHF4h87VX9F9sHeqUaWM7Cxj+hw7kapn1cBQOHBN1mAvpeuQMvaszayNpKmeRpbL9CHfZo/oTMjMgzy5hJAZkHvkB18lnbtRNzdyO0Yo97EOR/wTbp9OpzMehL6MZ+sUt5eyT2d1beei+UA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724328573; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4Zk1/6OYAiP7rVpOU6oHGiW3F+xDoqsXkjFUmuJvrU8=; b=l30TYSMiEIjAO+1UePwSgfUq923l9J+l9LUfTH84wrQwFtDJsoGeR2afwHhHlHUK8ViWLs0lb9a5a7IdBWe+6kIV8hRvf3Y/L7IYwUdZFbqOht7jKCD5/y8NHijiawVVFSzRTqlHK5d59DZOjVzSNRiLk/PAaX/oIGfxQ5bd4OQ= 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 1724328573444499.287524570439; Thu, 22 Aug 2024 05:09:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh6cT-0004oy-8Z; Thu, 22 Aug 2024 08:08:50 -0400 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 1sh6bi-0004bp-6W for qemu-devel@nongnu.org; Thu, 22 Aug 2024 08:08:05 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh6bd-0002Wc-HC for qemu-devel@nongnu.org; Thu, 22 Aug 2024 08:08:01 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-427fc97a88cso5172315e9.0 for ; Thu, 22 Aug 2024 05:07:56 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.153]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3730821ab1bsm1518781f8f.99.2024.08.22.05.07.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Aug 2024 05:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724328475; x=1724933275; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4Zk1/6OYAiP7rVpOU6oHGiW3F+xDoqsXkjFUmuJvrU8=; b=Yr+fvBXxw9JZVjUiwIswhWei0mUFBzsgBwERndNVsI9IRW1BygOHZOU5QTSdDOk6TC Anp27b1P/2g/aK4h4WGEURKLBLbbg/tiNxE9qTdda7l82UP9C37ydtK2wEMIFYY2QLtr a7K3dJ+F1kjMSjoM3DjCMHRqYR77kDJF29tcrjSMHVDCyvZMCNY5iRQkUowmY6AeASsD dpTPgeZ91HBOqAHZVUBdNfMuBuBZx4kl/HK+QIc0GkW7SjsLPEre8wAwJ1cnCiuvuKMo 5xUnk3ZebVGtrVgixJGSITQfI8CpfFkinarTpL6oqzSEeJbB5nkpMfQssnhcOz4tCJA3 Chnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724328475; x=1724933275; 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=4Zk1/6OYAiP7rVpOU6oHGiW3F+xDoqsXkjFUmuJvrU8=; b=koK7lEKUp9rMmlwXyAQBCFMwacdBG/PeRn1Cb/h1y+AO1hiMyalT0qnQ+Rqftf74wH 6kjldnR6N7fNPwuvq4L08nV/4GW4zpiDyaOkfZufEUL3n2+kmb8cdiinydk9gBuIu0U8 V7NvVDurqL0RAVECBYPHQ8cOgNPatZ8BCm+0zK66go6mG4HisWUh8+2ElryJFnX2Gzi8 AQa9sEQ5XHfZkjZnelfsogGsyYAlwz0IQ6C9f/mMCvmz9WvmHOGJeZhaZB0vjUg1YNYv lP/DT1AJz8/Xy4eXnh6JO60Fmjbz7oiQ+BttB9CSEtZXCsKqRcOg7jZvZk9wtN5RYC+Z TL2Q== X-Gm-Message-State: AOJu0YwP/HpQyf9aacYi9QXdgPtZ6FpPtp0MJmNhzoJ2MIjTIZBCqIer UkVkZCvZj3PsFhW4cDGbldu8DkSuxBa/EXycEQBvF961RE7zTA6QbQxWpOnaj0Nr5iFGb4lMFf2 m X-Google-Smtp-Source: AGHT+IFImfvX9ICeeSlaI6pA4CfbGpns2tsWMDSoDzqpOGAB/H8jmR2m4e7WRlwtGZqejO9hotlJXQ== X-Received: by 2002:adf:dd89:0:b0:371:8bc9:167c with SMTP id ffacd0b85a97d-372fd701305mr3105528f8f.41.1724328475004; Thu, 22 Aug 2024 05:07:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org, Thomas Huth , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] tests/functional: Convert Aarch64 Virt machine avocado tests Date: Thu, 22 Aug 2024 14:07:50 +0200 Message-ID: <20240822120750.89065-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1724328574840116600 Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Use has_cmd() and run_cmd() methods from qemu_test. $ make check-functional-aarch64 V=3D1 ... =E2=96=B6 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aarch64_virt_gicv= 2 OK =E2=96=B6 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aarch64_virt_gicv= 3 OK =E2=96=B6 1/4 test_aarch64_virt.Aarch64VirtMachine.test_alpine_virt_tcg_g= ic_max OK 1/4 qemu:func-thorough+func-aarch64-thorough+thorough / func-aarch64-aarc= h64_virt OK 30.44s 3 subtests passed Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Based-on: <20240822114146.86838-1-philmd@linaro.org> --- MAINTAINERS | 2 +- tests/functional/meson.build | 2 + .../test_aarch64_virt.py} | 63 ++++++++----------- 3 files changed, 29 insertions(+), 38 deletions(-) rename tests/{avocado/machine_aarch64_virt.py =3D> functional/test_aarch64= _virt.py} (74%) mode change 100644 =3D> 100755 diff --git a/MAINTAINERS b/MAINTAINERS index c720c02800..502065a1f2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1023,7 +1023,7 @@ S: Maintained F: hw/arm/virt* F: include/hw/arm/virt.h F: docs/system/arm/virt.rst -F: tests/avocado/machine_aarch64_virt.py +F: tests/functional/test_aarch64_virt.py =20 Xilinx Zynq M: Edgar E. Iglesias diff --git a/tests/functional/meson.build b/tests/functional/meson.build index aebeec1e0e..d31a1e7ac0 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -12,6 +12,7 @@ endif # Timeouts for individual tests that can be slow e.g. with debugging enabl= ed test_timeouts =3D { 'aarch64_sbsaref' : 18000, + 'aarch64_virt' : 360, 'acpi_bits' : 240, 'netdev_ethtool' : 180, 'ppc_40p' : 240, @@ -29,6 +30,7 @@ tests_generic =3D [ =20 tests_aarch64_thorough =3D [ 'aarch64_sbsaref', + 'aarch64_virt', ] =20 tests_arm_thorough =3D [ diff --git a/tests/avocado/machine_aarch64_virt.py b/tests/functional/test_= aarch64_virt.py old mode 100644 new mode 100755 similarity index 74% rename from tests/avocado/machine_aarch64_virt.py rename to tests/functional/test_aarch64_virt.py index 6831d2c0ed..d9a8e118c1 --- a/tests/avocado/machine_aarch64_virt.py +++ b/tests/functional/test_aarch64_virt.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a various Linux systems and checks the # console output. # @@ -12,12 +14,10 @@ import os import logging =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 -from avocado.utils import process -from avocado.utils.path import find_command +from qemu_test import BUILD_DIR +from qemu_test import QemuSystemTest, Asset +from qemu_test import exec_command, wait_for_console_pattern +from qemu_test import has_cmd, run_cmd =20 class Aarch64VirtMachine(QemuSystemTest): KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' @@ -28,23 +28,18 @@ def wait_for_console_pattern(self, success_message, vm= =3DNone): failure_message=3D'Kernel panic - not syn= cing', vm=3Dvm) =20 + ASSET_ALPINE_ISO =3D Asset( + ('https://dl-cdn.alpinelinux.org/' + 'alpine/v3.17/releases/aarch64/alpine-standard-3.17.2-aarch64.iso= '), + '5a36304ecf039292082d92b48152a9ec21009d3a62f459de623e19c4bd9dc027') + # 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_alpine_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.17/releases/aarch64/alpine-standard-3.17.2-aarch64.= iso" - ) - - iso_hash =3D "5a36304ecf039292082d92b48152a9ec21009d3a62f459de623e= 19c4bd9dc027" - iso_path =3D self.fetch_asset(iso_url, algorithm=3D"sha256", asset= _hash=3Diso_hash) + iso_path =3D self.ASSET_ALPINE_ISO.fetch() =20 + self.set_machine('virt') self.vm.set_console() kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + 'console=3DttyAMA0') @@ -68,6 +63,11 @@ def test_alpine_virt_tcg_gic_max(self): self.wait_for_console_pattern('Welcome to Alpine Linux 3.17') =20 =20 + ASSET_KERNEL =3D Asset( + ('https://fileserver.linaro.org/s/' + 'z6B2ARM7DQT3HWN/download'), + '12a54d4805cda6ab647cb7c7bbdb16fafb3df400e0d6f16445c1a0436100ef8d') + def common_aarch64_virt(self, machine): """ Common code to launch basic virt machine with kernel+initrd @@ -75,11 +75,9 @@ def common_aarch64_virt(self, machine): """ logger =3D logging.getLogger('aarch64_virt') =20 - kernel_url =3D ('https://fileserver.linaro.org/s/' - 'z6B2ARM7DQT3HWN/download') - kernel_hash =3D 'ed11daab50c151dde0e1e9c9cb8b2d9bd3215347' - kernel_path =3D self.fetch_asset(kernel_url, asset_hash=3Dkernel_h= ash) + kernel_path =3D self.ASSET_KERNEL.fetch() =20 + self.set_machine('virt') self.vm.set_console() kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + 'console=3DttyAMA0') @@ -100,12 +98,11 @@ def common_aarch64_virt(self, machine): image_path =3D os.path.join(self.workdir, 'scratch.qcow2') qemu_img =3D os.path.join(BUILD_DIR, 'qemu-img') if not os.path.exists(qemu_img): - qemu_img =3D find_command('qemu-img', False) + qemu_img =3D has_cmd('qemu-img') if qemu_img is False: self.cancel('Could not find "qemu-img", which is required to ' 'create the temporary qcow2 image') - cmd =3D '%s create -f qcow2 %s 8M' % (qemu_img, image_path) - process.run(cmd) + run_cmd([qemu_img, 'create', '-f', 'qcow2', image_path, '8M']) =20 # Add the device self.vm.add_args('-blockdev', @@ -128,19 +125,11 @@ def common_aarch64_virt(self, machine): time.sleep(0.1) =20 def test_aarch64_virt_gicv3(self): - """ - :avocado: tags=3Darch:aarch64 - :avocado: tags=3Dmachine:virt - :avocado: tags=3Daccel:tcg - :avocado: tags=3Dcpu:max - """ self.common_aarch64_virt("virt,gic_version=3D3") =20 def test_aarch64_virt_gicv2(self): - """ - :avocado: tags=3Darch:aarch64 - :avocado: tags=3Dmachine:virt - :avocado: tags=3Daccel:tcg - :avocado: tags=3Dcpu:max - """ self.common_aarch64_virt("virt,gic-version=3D2") + + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.45.2