From patchwork Fri Aug 30 13:38:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 824005 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp787460wrs; Fri, 30 Aug 2024 06:44:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUO+8Kz3T4VCMqu6Bybgz6o5wVhhywuePV/HLjtNPYy+NpZnwtTh6z2WbRIlqiWX024OgKKmw==@linaro.org X-Google-Smtp-Source: AGHT+IE4CJQPc57w+5urZuvvhPy85E8pkyFGbTKT4QFm4JHv1/x1QjAygyVOpRuUA7EKKmarHde8 X-Received: by 2002:a05:620a:371b:b0:7a1:d701:f165 with SMTP id af79cd13be357-7a8041bcc72mr737355685a.26.1725025499718; Fri, 30 Aug 2024 06:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725025499; cv=none; d=google.com; s=arc-20160816; b=eMCPHUQ5DQ568EN9yVlUL0CsmS2JLqfzcCZhocXcPKORwT9ztzKzQcJjeM9+2DzdZ+ 8oAuOaT4CG3Kikp0HvIk4h0z4dAeAulWnR8RQ2rxKmcm2wgh6GhGt5meLsjuFdq8nkin DRJlX+vaBPxopQrwFUFp+OJMwuFgveCVJ5CvNYHSDi2dU1jTaok0RnyiVq6zBW2Et0+D yUom7EFyFUIdwJ0/rdGI5gjrdSn+UeXrETi7KY+c4zidZBEy/GCzWgZEznJcicXknd4q j778LSPcF3BylSbfVzwpTPtf9Tk+vBV+r5Jf5kE5KjLaFlbNPK3IeFLLQWHOQPtDoxx8 7ZGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=g8reHlBu2HO9GEDbKdRUlnYq6oypIbdQw/HlVrHWB+0=; fh=P38goHIztZ4gXokF5rhgtVEB12E6Nfjaq+2lEOZYQsE=; b=jYN2VApBATBsxFXrVnBHWmK7G4HRLwNKwVD0yae7x6yhRYMI5a0RYnffwKs2QALOj9 KJnW0o1/69dGOxcmEhNk32Ei/5upWbRT7UVIPJyas82zssVajaaIl3nVsUNrxjBbCD+c a/WbDNiYtKSvQ6AP7c9dyjFZyzmWKi7qA33RWWb3A4hLGH2pYdx0c0TuJACCmnKsrqiz SkhmnopGVbusCf9Qt0NMM5dYXxUO8MGb6LODSaglhUR4CAgRunYGqV5vgX7jupJ4dOUd lXCkXQfEM+ylQhIOHDSEN/CTaz0GpXa9WGc/5j0xJHqVSh8gQzaEFBoW9Hv7Z4plseTM cWDw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i0RhcuBZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a806c16820si389131885a.71.2024.08.30.06.44.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Aug 2024 06:44:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i0RhcuBZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sk1sT-000064-8Z; Fri, 30 Aug 2024 09:41:25 -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 1sk1sQ-00088Q-Fq for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1sN-0005ca-Cl for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725025278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g8reHlBu2HO9GEDbKdRUlnYq6oypIbdQw/HlVrHWB+0=; b=i0RhcuBZVmLmg91i1SOlosi4c+YgN/PAMn5voF3h/uOvehN/5C0Sbx5qpcvK9Rgf7XGmha DMlFrFd6jwju7UkFDIbDuY775GxJpH2DswV52o4wZfX49/oOEd2lm6265EDnMC/QTR/B+Y Dz1y0/Bc+WNHpgGSAeXcLuXIL7Anl/o= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-YN8f9HqQN7qMsEBgJQItLQ-1; Fri, 30 Aug 2024 09:41:16 -0400 X-MC-Unique: YN8f9HqQN7qMsEBgJQItLQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A05171955D45; Fri, 30 Aug 2024 13:41:15 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C4520300019C; Fri, 30 Aug 2024 13:41:12 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha , Richard Henderson , John Snow , Fabiano Rosas Subject: [PATCH v5 33/44] tests/functional: Convert ARM Integrator/CP avocado tests Date: Fri, 30 Aug 2024 15:38:27 +0200 Message-ID: <20240830133841.142644-34-thuth@redhat.com> In-Reply-To: <20240830133841.142644-1-thuth@redhat.com> References: <20240830133841.142644-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. $ QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 make check-functional-arm ... 6/6 qemu:func-thorough+func-arm-thorough+thorough / func-arm-arm_integratorcp OK 3.90s 2 subtests passed Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-ID: <20240822110238.82312-1-philmd@linaro.org> Signed-off-by: Thomas Huth --- MAINTAINERS | 2 +- tests/functional/meson.build | 1 + .../test_arm_integratorcp.py} | 56 ++++++++++--------- 3 files changed, 33 insertions(+), 26 deletions(-) rename tests/{avocado/machine_arm_integratorcp.py => functional/test_arm_integratorcp.py} (63%) mode change 100644 => 100755 diff --git a/MAINTAINERS b/MAINTAINERS index 25e71ac14c..14500cf8a5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -785,7 +785,7 @@ S: Maintained F: hw/arm/integratorcp.c F: hw/misc/arm_integrator_debug.c F: include/hw/misc/arm_integrator_debug.h -F: tests/avocado/machine_arm_integratorcp.py +F: tests/functional/test_arm_integratorcp.py F: docs/system/arm/integratorcp.rst MCIMX6UL EVK / i.MX6ul diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 58f6bcf95d..182d40e052 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -34,6 +34,7 @@ tests_generic_bsduser = [ tests_arm_system_thorough = [ 'arm_canona1100', + 'arm_integratorcp', 'arm_n8x0', ] diff --git a/tests/avocado/machine_arm_integratorcp.py b/tests/functional/test_arm_integratorcp.py old mode 100644 new mode 100755 similarity index 63% rename from tests/avocado/machine_arm_integratorcp.py rename to tests/functional/test_arm_integratorcp.py index 87f5cf3953..0fe083f661 --- a/tests/avocado/machine_arm_integratorcp.py +++ b/tests/functional/test_arm_integratorcp.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a Linux kernel and checks the console # # Copyright (c) 2020 Red Hat, Inc. @@ -7,13 +9,15 @@ # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. +# +# SPDX-License-Identifier: GPL-2.0-or-later import os import logging -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from qemu_test import QemuSystemTest, Asset +from qemu_test import wait_for_console_pattern +from unittest import skipUnless NUMPY_AVAILABLE = True @@ -33,50 +37,49 @@ class IntegratorMachine(QemuSystemTest): timeout = 90 - def boot_integratorcp(self): - kernel_url = ('https://github.com/zayac/qemu-arm/raw/master/' - 'arm-test/kernel/zImage.integrator') - kernel_hash = '0d7adba893c503267c946a3cbdc63b4b54f25468' - kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + ASSET_KERNEL = Asset( + ('https://github.com/zayac/qemu-arm/raw/master/' + 'arm-test/kernel/zImage.integrator'), + '26e7c7e8f943de785d95bd3c74d66451604a9b6a7a3d25dceb279e7548fd8e78') + + ASSET_INITRD = Asset( + ('https://github.com/zayac/qemu-arm/raw/master/' + 'arm-test/kernel/arm_root.img'), + 'e187c27fb342ad148c7f33475fbed124933e0b3f4be8c74bc4f3426a4793373a') - initrd_url = ('https://github.com/zayac/qemu-arm/raw/master/' - 'arm-test/kernel/arm_root.img') - initrd_hash = 'b51e4154285bf784e017a37586428332d8c7bd8b' - initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash) + ASSET_TUXLOGO = Asset( + ('https://github.com/torvalds/linux/raw/v2.6.12/' + 'drivers/video/logo/logo_linux_vga16.ppm'), + 'b762f0d91ec018887ad1b334543c2fdf9be9fdfc87672b409211efaa3ea0ef79') + def boot_integratorcp(self): + kernel_path = self.ASSET_KERNEL.fetch() + initrd_path = self.ASSET_INITRD.fetch() + + self.set_machine('integratorcp') self.vm.set_console() self.vm.add_args('-kernel', kernel_path, '-initrd', initrd_path, '-append', 'printk.time=0 console=ttyAMA0') self.vm.launch() - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted code') def test_integratorcp_console(self): """ Boots the Linux kernel and checks that the console is operational - :avocado: tags=arch:arm - :avocado: tags=machine:integratorcp - :avocado: tags=device:pl011 """ self.boot_integratorcp() wait_for_console_pattern(self, 'Log in as root') @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted code') def test_framebuffer_tux_logo(self): """ Boot Linux and verify the Tux logo is displayed on the framebuffer. - :avocado: tags=arch:arm - :avocado: tags=machine:integratorcp - :avocado: tags=device:pl110 - :avocado: tags=device:framebuffer """ screendump_path = os.path.join(self.workdir, "screendump.pbm") - tuxlogo_url = ('https://github.com/torvalds/linux/raw/v2.6.12/' - 'drivers/video/logo/logo_linux_vga16.ppm') - tuxlogo_hash = '3991c2ddbd1ddaecda7601f8aafbcf5b02dc86af' - tuxlogo_path = self.fetch_asset(tuxlogo_url, asset_hash=tuxlogo_hash) + tuxlogo_path = self.ASSET_TUXLOGO.fetch() self.boot_integratorcp() framebuffer_ready = 'Console: switching to colour frame buffer device' @@ -97,3 +100,6 @@ def test_framebuffer_tux_logo(self): for tux_count, pt in enumerate(zip(*loc[::-1]), start=1): logger.debug('found Tux at position [x, y] = %s', pt) self.assertGreaterEqual(tux_count, cpu_count) + +if __name__ == '__main__': + QemuSystemTest.main() From patchwork Fri Aug 30 13:38:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 824000 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp786355wrs; Fri, 30 Aug 2024 06:42:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXwM1jK6bUvpjGMuMsIHf+a2lTQCQ/rtA+M2bhXNvI7Qzoof00LcKN9Xi8coxWQa8yC4yOYSA==@linaro.org X-Google-Smtp-Source: AGHT+IGL7aVLScwJS86Ua0s8C9DjtaiVG5KXEQeeRRVqsWHSwZMN0lz61yLaFHnj9XJ4lxe1+Obf X-Received: by 2002:a05:6214:5691:b0:6c1:6f9a:17c6 with SMTP id 6a1803df08f44-6c33e6a8bf1mr59059016d6.54.1725025356429; Fri, 30 Aug 2024 06:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725025356; cv=none; d=google.com; s=arc-20160816; b=X2pqlV8z+fgSnaMgalePQzbWxoYQQzKMcjAEYUMm92kMK5OG+I3/9kslnIYDABHxUT 6pdRpAJ75D7SAn210hk30RSPyEg4neNYari3woLS9Om0ao0+i5xwxGLyJTY+GjvljfO8 422To89RIvOVxxT1qGKh3p72vMwXcfseUQOICH5T1eIIHZOu6kVC+c+l3kP7NnvHFY3o Sxw+hCYj5PuumVoYf8ovxeccxmzAEujx5v0w/covKOQXlkRvBsxje7jEBQaDcf+8dCNt G6cYez2vr7hrVwoQrMfGAQgKoLBP0EuHgbVyHHGJo2ut3Wu80ZISXjZJ0IrtGMDFz6Cd GfgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6mdIoF3xuCHGOPdCVcPwzRR0kONRuQQzMBOLWj4UZjU=; fh=P38goHIztZ4gXokF5rhgtVEB12E6Nfjaq+2lEOZYQsE=; b=qYyJZYKhD32A90qPNtZes8EItZ0RwHTqCAP/aJX5qqzv2bkoD66xh8reNqxMKVFwZ2 uV7yvbOAPS1OVHO4CoKzyfi6s2ZiUkQrkhDUyMVAO5Hrcy1KIZs+ZFP36Sau7iziSh51 dIJ3EK7Tig1PPpA3weOVkUQaOBd8YqT1MCE7eV0d0bKl63T+d1KRcdlwSbsbIaY4JRGr QA4vifxTNm9sDe6TdiZwfSsX4ejJAoUet+sYjfQ9cspn5BDNoDe5dKwxZl7rsBnxDHI7 rflroCv32rQAcT6IFc0/cdp/cVUoGDh9pqRxA0CE1RVo7ki1ltIA7VlHNDtyrLy7xtS3 hFgg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DnP7zLr1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45682d91415si40177111cf.504.2024.08.30.06.42.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Aug 2024 06:42:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DnP7zLr1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sk1sb-0001TY-3b; Fri, 30 Aug 2024 09:41:33 -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 1sk1sY-00015Q-Qq for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1sV-0005dt-R0 for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725025287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6mdIoF3xuCHGOPdCVcPwzRR0kONRuQQzMBOLWj4UZjU=; b=DnP7zLr1JUlcxuRnU0Ope4tphPnocY4qRoU2d7jA1LL3WWz4iQRfxzgpWt64asoA9D4BKL nEMUmCINEpJiO7XHO2GQzDxLWDoXzUHpl4aXTCZZ83D1zfJDZ3M3VMTF2ovoZXZQlvd84I PWrZdybE0y7LGioLqd1JJQj41dASAuc= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-uKfB9zBWNXOO8WrvaxU0vQ-1; Fri, 30 Aug 2024 09:41:21 -0400 X-MC-Unique: uKfB9zBWNXOO8WrvaxU0vQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 61B441955EA1; Fri, 30 Aug 2024 13:41:20 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5C96A300019C; Fri, 30 Aug 2024 13:41:15 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha , Richard Henderson , John Snow , Fabiano Rosas Subject: [PATCH v5 34/44] tests/functional: Convert Aarch64 SBSA-Ref avocado tests Date: Fri, 30 Aug 2024 15:38:28 +0200 Message-ID: <20240830133841.142644-35-thuth@redhat.com> In-Reply-To: <20240830133841.142644-1-thuth@redhat.com> References: <20240830133841.142644-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Since SBSA_FLASH files are not tarballs, use lzma_uncompress() method. Avocado used to set a timeout of 11 tests * 180s = 1980s. Hopefully 600s should be sufficient. Running on macOS Sonoma / Apple silicon M1: $ QEMU_TEST_TIMEOUT_EXPECTED=1 make check-functional-aarch64 V=1 ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_alpine_linux_max OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_alpine_linux_max_pauth_impdef OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_alpine_linux_max_pauth_off OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_alpine_linux_neoverse_n1 OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_edk2_firmware OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_openbsd73_cortex_a57 OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_openbsd73_max OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_openbsd73_max_pauth_impdef OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_openbsd73_max_pauth_off OK ▶ 1/5 test_aarch64_sbsaref.Aarch64SbsarefMachine.test_sbsaref_openbsd73_neoverse_n1 OK 1/5 qemu:func-thorough+func-aarch64-thorough+thorough / func-aarch64-aarch64_sbsaref OK 241.79s 11 subtests passed ... Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Marcin Juszkiewicz Message-ID: <20240823131614.10269-1-philmd@linaro.org> Signed-off-by: Thomas Huth --- MAINTAINERS | 2 +- tests/functional/meson.build | 5 + .../test_aarch64_sbsaref.py} | 144 ++++++------------ 3 files changed, 55 insertions(+), 96 deletions(-) rename tests/{avocado/machine_aarch64_sbsaref.py => functional/test_aarch64_sbsaref.py} (56%) mode change 100644 => 100755 diff --git a/MAINTAINERS b/MAINTAINERS index 14500cf8a5..e9aa174dc7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -971,7 +971,7 @@ F: hw/misc/sbsa_ec.c F: hw/watchdog/sbsa_gwdt.c F: include/hw/watchdog/sbsa_gwdt.h F: docs/system/arm/sbsa.rst -F: tests/avocado/machine_aarch64_sbsaref.py +F: tests/functional/test_aarch64_sbsaref.py Sharp SL-5500 (Collie) PDA M: Peter Maydell diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 182d40e052..bfa04818cc 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -11,6 +11,7 @@ endif # Timeouts for individual tests that can be slow e.g. with debugging enabled test_timeouts = { + 'aarch64_sbsaref' : 600, 'acpi_bits' : 240, 'netdev_ethtool' : 180, 'ppc_40p' : 240, @@ -32,6 +33,10 @@ tests_generic_linuxuser = [ tests_generic_bsduser = [ ] +tests_aarch64_system_thorough = [ + 'aarch64_sbsaref', +] + tests_arm_system_thorough = [ 'arm_canona1100', 'arm_integratorcp', diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/functional/test_aarch64_sbsaref.py old mode 100644 new mode 100755 similarity index 56% rename from tests/avocado/machine_aarch64_sbsaref.py rename to tests/functional/test_aarch64_sbsaref.py index f8bf40c192..e90566cdb8 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/functional/test_aarch64_sbsaref.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional test that boots a Linux kernel and checks the console # # SPDX-FileCopyrightText: 2023-2024 Linaro Ltd. @@ -8,12 +10,11 @@ import os -from avocado import skipUnless -from avocado.utils import archive - -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern -from avocado_qemu import interrupt_interactive_console_until_pattern +from qemu_test import QemuSystemTest, Asset +from qemu_test import wait_for_console_pattern +from qemu_test import interrupt_interactive_console_until_pattern +from qemu_test.utils import lzma_uncompress +from unittest import skipUnless class Aarch64SbsarefMachine(QemuSystemTest): @@ -28,6 +29,16 @@ class Aarch64SbsarefMachine(QemuSystemTest): timeout = 180 + ASSET_FLASH0 = Asset( + ('https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/' + '20240619-148232/edk2/SBSA_FLASH0.fd.xz'), + '0c954842a590988f526984de22e21ae0ab9cb351a0c99a8a58e928f0c7359cf7') + + ASSET_FLASH1 = Asset( + ('https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/' + '20240619-148232/edk2/SBSA_FLASH1.fd.xz'), + 'c6ec39374c4d79bb9e9cdeeb6db44732d90bb4a334cec92002b3f4b9cac4b5ee') + def fetch_firmware(self): """ Flash volumes generated using: @@ -44,47 +55,31 @@ def fetch_firmware(self): """ # Secure BootRom (TF-A code) - fs0_xz_url = ( - "https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/" - "20240619-148232/edk2/SBSA_FLASH0.fd.xz" - ) - fs0_xz_hash = "0c954842a590988f526984de22e21ae0ab9cb351a0c99a8a58e928f0c7359cf7" - tar_xz_path = self.fetch_asset(fs0_xz_url, asset_hash=fs0_xz_hash, - algorithm='sha256') - archive.extract(tar_xz_path, self.workdir) + fs0_xz_path = self.ASSET_FLASH0.fetch() fs0_path = os.path.join(self.workdir, "SBSA_FLASH0.fd") + lzma_uncompress(fs0_xz_path, fs0_path) # Non-secure rom (UEFI and EFI variables) - fs1_xz_url = ( - "https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/" - "20240619-148232/edk2/SBSA_FLASH1.fd.xz" - ) - fs1_xz_hash = "c6ec39374c4d79bb9e9cdeeb6db44732d90bb4a334cec92002b3f4b9cac4b5ee" - tar_xz_path = self.fetch_asset(fs1_xz_url, asset_hash=fs1_xz_hash, - algorithm='sha256') - archive.extract(tar_xz_path, self.workdir) + fs1_xz_path = self.ASSET_FLASH1.fetch() fs1_path = os.path.join(self.workdir, "SBSA_FLASH1.fd") + lzma_uncompress(fs1_xz_path, fs1_path) for path in [fs0_path, fs1_path]: with open(path, "ab+") as fd: fd.truncate(256 << 20) # Expand volumes to 256MiB + self.set_machine('sbsa-ref') self.vm.set_console() self.vm.add_args( - "-drive", - f"if=pflash,file={fs0_path},format=raw", - "-drive", - f"if=pflash,file={fs1_path},format=raw", - "-machine", - "sbsa-ref", + "-drive", f"if=pflash,file={fs0_path},format=raw", + "-drive", f"if=pflash,file={fs1_path},format=raw", ) def test_sbsaref_edk2_firmware(self): - """ - :avocado: tags=cpu:cortex-a57 - """ self.fetch_firmware() + + self.vm.add_args('-cpu', 'cortex-a57') self.vm.launch() # TF-A boot sequence: @@ -110,87 +105,62 @@ def test_sbsaref_edk2_firmware(self): wait_for_console_pattern(self, "UEFI firmware (version 1.0") interrupt_interactive_console_until_pattern(self, "QEMU SBSA-REF Machine") + + ASSET_ALPINE_ISO = 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 boot_alpine_linux(self, cpu): self.fetch_firmware() - iso_url = ( - "https://dl-cdn.alpinelinux.org/" - "alpine/v3.17/releases/aarch64/alpine-standard-3.17.2-aarch64.iso" - ) - - iso_hash = "5a36304ecf039292082d92b48152a9ec21009d3a62f459de623e19c4bd9dc027" - iso_path = self.fetch_asset(iso_url, algorithm="sha256", asset_hash=iso_hash) + iso_path = self.ASSET_ALPINE_ISO.fetch() self.vm.set_console() self.vm.add_args( - "-cpu", - cpu, - "-drive", - f"file={iso_path},media=cdrom,format=raw", + "-cpu", cpu, + "-drive", f"file={iso_path},media=cdrom,format=raw", ) self.vm.launch() wait_for_console_pattern(self, "Welcome to Alpine Linux 3.17") def test_sbsaref_alpine_linux_cortex_a57(self): - """ - :avocado: tags=cpu:cortex-a57 - :avocado: tags=os:linux - """ self.boot_alpine_linux("cortex-a57") def test_sbsaref_alpine_linux_neoverse_n1(self): - """ - :avocado: tags=cpu:neoverse-n1 - :avocado: tags=os:linux - """ self.boot_alpine_linux("neoverse-n1") def test_sbsaref_alpine_linux_max_pauth_off(self): - """ - :avocado: tags=cpu:max - :avocado: tags=os:linux - """ self.boot_alpine_linux("max,pauth=off") def test_sbsaref_alpine_linux_max_pauth_impdef(self): - """ - :avocado: tags=cpu:max - :avocado: tags=os:linux - """ self.boot_alpine_linux("max,pauth-impdef=on") - @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') + @skipUnless(os.getenv('QEMU_TEST_TIMEOUT_EXPECTED'), 'Test might timeout') def test_sbsaref_alpine_linux_max(self): - """ - :avocado: tags=cpu:max - :avocado: tags=os:linux - """ self.boot_alpine_linux("max") + ASSET_OPENBSD_ISO = Asset( + ('https://cdn.openbsd.org/pub/OpenBSD/7.3/arm64/miniroot73.img'), + '7fc2c75401d6f01fbfa25f4953f72ad7d7c18650056d30755c44b9c129b707e5') + # 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 boot_openbsd73(self, cpu): self.fetch_firmware() - img_url = ( - "https://cdn.openbsd.org/pub/OpenBSD/7.3/arm64/miniroot73.img" - ) - - img_hash = "7fc2c75401d6f01fbfa25f4953f72ad7d7c18650056d30755c44b9c129b707e5" - img_path = self.fetch_asset(img_url, algorithm="sha256", asset_hash=img_hash) + img_path = self.ASSET_OPENBSD_ISO.fetch() self.vm.set_console() self.vm.add_args( - "-cpu", - cpu, - "-drive", - f"file={img_path},format=raw,snapshot=on", + "-cpu", cpu, + "-drive", f"file={img_path},format=raw,snapshot=on", ) self.vm.launch() @@ -199,38 +169,22 @@ def boot_openbsd73(self, cpu): " 7.3 installation program.") def test_sbsaref_openbsd73_cortex_a57(self): - """ - :avocado: tags=cpu:cortex-a57 - :avocado: tags=os:openbsd - """ self.boot_openbsd73("cortex-a57") def test_sbsaref_openbsd73_neoverse_n1(self): - """ - :avocado: tags=cpu:neoverse-n1 - :avocado: tags=os:openbsd - """ self.boot_openbsd73("neoverse-n1") def test_sbsaref_openbsd73_max_pauth_off(self): - """ - :avocado: tags=cpu:max - :avocado: tags=os:openbsd - """ self.boot_openbsd73("max,pauth=off") - @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') + @skipUnless(os.getenv('QEMU_TEST_TIMEOUT_EXPECTED'), 'Test might timeout') def test_sbsaref_openbsd73_max_pauth_impdef(self): - """ - :avocado: tags=cpu:max - :avocado: tags=os:openbsd - """ self.boot_openbsd73("max,pauth-impdef=on") - @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') + @skipUnless(os.getenv('QEMU_TEST_TIMEOUT_EXPECTED'), 'Test might timeout') def test_sbsaref_openbsd73_max(self): - """ - :avocado: tags=cpu:max - :avocado: tags=os:openbsd - """ self.boot_openbsd73("max") + + +if __name__ == '__main__': + QemuSystemTest.main() From patchwork Fri Aug 30 13:38:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 823999 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp786071wrs; Fri, 30 Aug 2024 06:41:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV7NYtwHHlPgSb+3Y/l8hMC4Nr56K+V9y+75MKtCfh+zRefc1aw6uzrb2OCbDKhatTkbnzSRw==@linaro.org X-Google-Smtp-Source: AGHT+IEm+c6aRi2UiIuLf3bY+/hF8hxr0yD/UfgQluU2KGL6HiLIq0+CLyb4suMM+wl4iXw7w3v3 X-Received: by 2002:a05:6870:9106:b0:277:6bd4:3fa1 with SMTP id 586e51a60fabf-277903c6398mr5815312fac.51.1725025314027; Fri, 30 Aug 2024 06:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725025314; cv=none; d=google.com; s=arc-20160816; b=uAEUL/78/sypJJ56TFREGJTEAErqQuvAt8eISem9+Aty+R2xe4BPe8b1+Z01X06a64 hIQoOYKJVMW981ljiwOJKoMKINCptnwc9k/JbZPR45WtCAVQNZE5EC9i4Ayt4IStfyuL SmG06M7jdSLyQbPvucYkiVmotK/UqH4d6uFkbxdbOQzFz3Pucq6sjTU2YgCq7JHt/e7K mrnTjo/H3PuKUq1ZE20LrPJJwJxfTbRHAXsY7inAXWcvkiYKRhFTZ1TvaRQjnWDmtPdR QwqD0PDykrA9CUOjv9ori99Az8QZJKAzzwB5d89QmreIJ2NOQcjBipxLgn6Y0u7wvQak 6f4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=COIEQfzLP1CAiIPZqcELBtwxDeHv0xwQTj4LFwfL18M=; fh=P38goHIztZ4gXokF5rhgtVEB12E6Nfjaq+2lEOZYQsE=; b=XkkdYUcQBM3zjm2p7R+I9yVijrPO8eFCyp8ORjWPex/9gjSk0WaQXdD0DM9K4+++sb VBlE/TNAh79niKZoLDf+WnboLsbEmv5OSYzLNHJSzjzi8Tw2Ja66zkWv4DqrtkoJKS1R p4Xteu8jn1nF0iHdMUwiAQJOT9BbMkDUlEHXxUem9EOTqOA/jiAJZyZZgpll6JzODU0t Mk6p6sztucL6DuaPEqL4wWRhT5g8mouO/M4xqA/uFQiebk9TbbuChz/EIh2DUblfdvbp wwI3kJ7DeU49OgA9QSsGppKKRomihen16ZvFwh6MvEQqdK01elNfc2FSulnWWX4imvPS trEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b4BW3RY2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a806d857a2si392693985a.495.2024.08.30.06.41.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Aug 2024 06:41:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b4BW3RY2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sk1sb-0001aa-JU; Fri, 30 Aug 2024 09:41:33 -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 1sk1sZ-000195-1o for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1sW-0005dx-Dq for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725025287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=COIEQfzLP1CAiIPZqcELBtwxDeHv0xwQTj4LFwfL18M=; b=b4BW3RY2wS65aKl4rs4lx1rMqAQsn8YyWQoussyMfLSXJ+Qk2yQnFjQ/BZq8ue9R7lbcny O7f/gTcISYtymcUfe4kH7D1OzcJfzaxww7jHMoCmW/P1+lOcp+brHopJpFMWIg3OG/S1Ai 80UXBAqEfSYTJuU53ddynqdgh8dYOAc= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-140-bT3rnuozMdKwMkAf0k6CyA-1; Fri, 30 Aug 2024 09:41:26 -0400 X-MC-Unique: bT3rnuozMdKwMkAf0k6CyA-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5DCB01955BED; Fri, 30 Aug 2024 13:41:24 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B6FBD300019C; Fri, 30 Aug 2024 13:41:20 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha , Richard Henderson , John Snow , Fabiano Rosas Subject: [PATCH v5 35/44] tests/functional: Convert Aarch64 Virt machine avocado tests Date: Fri, 30 Aug 2024 15:38:29 +0200 Message-ID: <20240830133841.142644-36-thuth@redhat.com> In-Reply-To: <20240830133841.142644-1-thuth@redhat.com> References: <20240830133841.142644-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Provide get_qemu_img() helper in qemu_test. $ make check-functional-aarch64 V=1 ▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aarch64_virt_gicv2 OK ▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aarch64_virt_gicv3 OK ▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_alpine_virt_tcg_gic_max OK 1/4 qemu:func-thorough+func-aarch64-thorough+thorough / func-aarch64-aarch64_virt OK 30.44s 3 subtests passed ... Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240826103634.52384-1-philmd@linaro.org> Signed-off-by: Thomas Huth --- MAINTAINERS | 2 +- tests/functional/meson.build | 2 + tests/functional/qemu_test/__init__.py | 2 +- tests/functional/qemu_test/cmd.py | 15 ++++ .../test_aarch64_virt.py} | 69 ++++++++----------- 5 files changed, 46 insertions(+), 44 deletions(-) rename tests/{avocado/machine_aarch64_virt.py => functional/test_aarch64_virt.py} (69%) mode change 100644 => 100755 diff --git a/MAINTAINERS b/MAINTAINERS index e9aa174dc7..cbdf2863fa 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 Xilinx Zynq M: Edgar E. Iglesias diff --git a/tests/functional/meson.build b/tests/functional/meson.build index bfa04818cc..4154b1cbcd 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 enabled test_timeouts = { 'aarch64_sbsaref' : 600, + 'aarch64_virt' : 360, 'acpi_bits' : 240, 'netdev_ethtool' : 180, 'ppc_40p' : 240, @@ -35,6 +36,7 @@ tests_generic_bsduser = [ tests_aarch64_system_thorough = [ 'aarch64_sbsaref', + 'aarch64_virt', ] tests_arm_system_thorough = [ diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py index db05c8f412..1d87d7122f 100644 --- a/tests/functional/qemu_test/__init__.py +++ b/tests/functional/qemu_test/__init__.py @@ -10,5 +10,5 @@ from .config import BUILD_DIR from .cmd import has_cmd, has_cmds, run_cmd, is_readable_executable_file, \ interrupt_interactive_console_until_pattern, wait_for_console_pattern, \ - exec_command, exec_command_and_wait_for_pattern + exec_command, exec_command_and_wait_for_pattern, get_qemu_img from .testcase import QemuSystemTest, QemuBaseTest diff --git a/tests/functional/qemu_test/cmd.py b/tests/functional/qemu_test/cmd.py index 8580ee8faf..3acd617324 100644 --- a/tests/functional/qemu_test/cmd.py +++ b/tests/functional/qemu_test/cmd.py @@ -16,6 +16,8 @@ import os.path import subprocess +from .config import BUILD_DIR + def has_cmd(name, args=None): """ @@ -176,3 +178,16 @@ def exec_command_and_wait_for_pattern(test, command, :param failure_message: if this message appears, test fails """ _console_interaction(test, success_message, failure_message, command + '\r') + +def get_qemu_img(test): + test.log.debug('Looking for and selecting a qemu-img binary') + + # If qemu-img has been built, use it, otherwise the system wide one + # will be used. + qemu_img = os.path.join(BUILD_DIR, 'qemu-img') + if os.path.exists(qemu_img): + return qemu_img + if has_cmd('qemu-img'): + return 'qemu-img' + test.skipTest('Could not find "qemu-img", which is required to ' + 'create temporary images') diff --git a/tests/avocado/machine_aarch64_virt.py b/tests/functional/test_aarch64_virt.py old mode 100644 new mode 100755 similarity index 69% rename from tests/avocado/machine_aarch64_virt.py rename to tests/functional/test_aarch64_virt.py index 6831d2c0ed..c967da41b4 --- 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,11 @@ import os import logging -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 get_qemu_img, run_cmd + class Aarch64VirtMachine(QemuSystemTest): KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' @@ -28,23 +29,18 @@ def wait_for_console_pattern(self, success_message, vm=None): failure_message='Kernel panic - not syncing', vm=vm) + ASSET_ALPINE_ISO = 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=arch:aarch64 - :avocado: tags=machine:virt - :avocado: tags=accel:tcg - """ - iso_url = ( - "https://dl-cdn.alpinelinux.org/" - "alpine/v3.17/releases/aarch64/alpine-standard-3.17.2-aarch64.iso" - ) - - iso_hash = "5a36304ecf039292082d92b48152a9ec21009d3a62f459de623e19c4bd9dc027" - iso_path = self.fetch_asset(iso_url, algorithm="sha256", asset_hash=iso_hash) + iso_path = self.ASSET_ALPINE_ISO.fetch() + self.set_machine('virt') self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0') @@ -68,6 +64,11 @@ def test_alpine_virt_tcg_gic_max(self): self.wait_for_console_pattern('Welcome to Alpine Linux 3.17') + ASSET_KERNEL = 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 +76,9 @@ def common_aarch64_virt(self, machine): """ logger = logging.getLogger('aarch64_virt') - kernel_url = ('https://fileserver.linaro.org/s/' - 'z6B2ARM7DQT3HWN/download') - kernel_hash = 'ed11daab50c151dde0e1e9c9cb8b2d9bd3215347' - kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + kernel_path = self.ASSET_KERNEL.fetch() + self.set_machine('virt') self.vm.set_console() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyAMA0') @@ -98,14 +97,8 @@ def common_aarch64_virt(self, machine): # Also add a scratch block device logger.info('creating scratch qcow2 image') image_path = os.path.join(self.workdir, 'scratch.qcow2') - qemu_img = os.path.join(BUILD_DIR, 'qemu-img') - if not os.path.exists(qemu_img): - qemu_img = find_command('qemu-img', False) - if qemu_img is False: - self.cancel('Could not find "qemu-img", which is required to ' - 'create the temporary qcow2 image') - cmd = '%s create -f qcow2 %s 8M' % (qemu_img, image_path) - process.run(cmd) + qemu_img = get_qemu_img(self) + run_cmd([qemu_img, 'create', '-f', 'qcow2', image_path, '8M']) # Add the device self.vm.add_args('-blockdev', @@ -128,19 +121,11 @@ def common_aarch64_virt(self, machine): time.sleep(0.1) def test_aarch64_virt_gicv3(self): - """ - :avocado: tags=arch:aarch64 - :avocado: tags=machine:virt - :avocado: tags=accel:tcg - :avocado: tags=cpu:max - """ self.common_aarch64_virt("virt,gic_version=3") def test_aarch64_virt_gicv2(self): - """ - :avocado: tags=arch:aarch64 - :avocado: tags=machine:virt - :avocado: tags=accel:tcg - :avocado: tags=cpu:max - """ self.common_aarch64_virt("virt,gic-version=2") + + +if __name__ == '__main__': + QemuSystemTest.main() From patchwork Fri Aug 30 13:38:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 824002 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp786848wrs; Fri, 30 Aug 2024 06:43:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVkW/y9zzBYbkA/ABQvcGdoMAe/Fd4oomlm3yXKsEehHHptZjLi4dImQhlCdo/pXNae4wQYiA==@linaro.org X-Google-Smtp-Source: AGHT+IEMI8xAv+IW8EozpH4lbN4swNy+Yd2vTYjF7rMBvwGN+39bZeGPYYNGcFztE8vm/pl0f/rw X-Received: by 2002:a0c:ff08:0:b0:6c3:4ba5:edd8 with SMTP id 6a1803df08f44-6c34ba5ef71mr12220806d6.39.1725025413476; Fri, 30 Aug 2024 06:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725025413; cv=none; d=google.com; s=arc-20160816; b=R9+MjitiAdERPoGMXCN6XDM9yUqZV1ON2F28RNIWXPO3ZR50G9iuoPUyOL+02vGjNr W2ku+3OSUYGH4d1a+iS62s9wU4OPi5zaaEJtXn14Iigdb5nsVNWWMGy8/X8HwfpKyREa ifwRNg2oWHrbIZO4FgQC7hCDZlGXKf46mFqKfJCaX14Ou8WBP/EOP2AVd6H9Qy7YvTiu f5Gp4RbeLbYZ++AdfkmcYiBfQ1tkcO7CShyxiU0a9MzWLXQLhl3mFX9sAxJqVa3/KG/Z SiV2H1cuVB5/wVY5HmpEpBVWu+w/QSfsHTBaOIv5W2VwW02EGuu6kGcv+RCFVRxvxp6G Oqzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xhy1BSCohpIoQg+VSoYYxiPc5WzgWchrjchDtLPRrd8=; fh=P38goHIztZ4gXokF5rhgtVEB12E6Nfjaq+2lEOZYQsE=; b=kKxqadYIyCj9WPqgn/+R797C9F5TGCCnM6joOMggdcdtKEQq31hUSIC4FirV2W/R9V qeHbdJS6JFo2370EbIzIabNwsEjG8gpSb/5o3C/InmnlprB+4RXGjBceSbdjfSfKu+T9 v/XbfK/u2ynFFD2JaAFRL55mvwTVdOGKGMtsWRLLUki76tiu656Ond2GFADbQ3dcy8KY 0GiV2O5iK2joq+Y0HgQQdsZu4C361MY9bMaOHygCFPnTf1tR6HmQAVAVLXdZLH9gSz3E /9jlPxs1fIH5cbq431X4MJCAV4PpIqynq2Guc7qR9LnLl0PrhrM/+9zhjuMaCb/DFcpD fbdw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HdgnZ3+Y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c340ca58b1si39698266d6.383.2024.08.30.06.43.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Aug 2024 06:43:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HdgnZ3+Y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sk1sg-0002MY-FM; Fri, 30 Aug 2024 09:41:38 -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 1sk1sd-0001vv-L5 for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1sb-0005eI-8N for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725025292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xhy1BSCohpIoQg+VSoYYxiPc5WzgWchrjchDtLPRrd8=; b=HdgnZ3+YOfs+H3WQMZBOWdSwtwE3vtWtnNB58pufBZV6G2qsf23ZMLewygC+kI4LmnKCpb n+T9xoxfyXjJ3nKaGXfMc+mtFgBUUk4oDTxxyeqybjQkoCZ1qyE+V7/uXuf/zCn3ftuMzP KqmBq0AQIhEs+Z2aIlWUYwi6jCeVu/w= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-79-pEkHzIXhMfGUtgtG5RdCYw-1; Fri, 30 Aug 2024 09:41:29 -0400 X-MC-Unique: pEkHzIXhMfGUtgtG5RdCYw-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5805619560B4; Fri, 30 Aug 2024 13:41:28 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 48D57300019C; Fri, 30 Aug 2024 13:41:24 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha , Richard Henderson , John Snow , Fabiano Rosas Subject: [PATCH v5 36/44] tests/functional: Convert mips64el Fuloong2e avocado test (1/2) Date: Fri, 30 Aug 2024 15:38:30 +0200 Message-ID: <20240830133841.142644-37-thuth@redhat.com> In-Reply-To: <20240830133841.142644-1-thuth@redhat.com> References: <20240830133841.142644-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Since the asset is expected locally and the test is guarded with RESCUE_YL_PATH, keep it under the 'quick' category. $ RESCUE_YL_PATH=/path/to/rescue-yl QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 \ make check-functional-mips64el 1/4 qemu:func-quick+func-mips64el / func-mips64el-empty_cpu_model OK 0.12s 1 subtests passed 2/4 qemu:func-quick+func-mips64el / func-mips64el-version OK 0.13s 1 subtests passed 3/4 qemu:func-quick+func-mips64el / func-mips64el-info_usernet OK 0.15s 1 subtests passed 4/4 qemu:func-quick+func-mips64el / func-mips64el-mips64el_fuloong2e OK 0.19s 1 subtests passed Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-ID: <20240827094905.80648-2-philmd@linaro.org> Signed-off-by: Thomas Huth --- MAINTAINERS | 2 +- tests/functional/meson.build | 4 +++ .../test_mips64el_fuloong2e.py} | 33 ++++++++++--------- 3 files changed, 23 insertions(+), 16 deletions(-) rename tests/{avocado/machine_mips_fuloong2e.py => functional/test_mips64el_fuloong2e.py} (58%) mode change 100644 => 100755 diff --git a/MAINTAINERS b/MAINTAINERS index cbdf2863fa..f6e6e5ebf5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1384,7 +1384,7 @@ S: Odd Fixes F: hw/mips/fuloong2e.c F: hw/pci-host/bonito.c F: include/hw/pci-host/bonito.h -F: tests/avocado/machine_mips_fuloong2e.py +F: tests/functional/test_mips64el_fuloong2e.py Loongson-3 virtual platforms M: Huacai Chen diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 4154b1cbcd..dcede9733e 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -65,6 +65,10 @@ tests_microblazeel_system_thorough = [ 'microblazeel_s3adsp1800' ] +tests_mips64el_system_quick = [ + 'mips64el_fuloong2e', +] + tests_mips64el_system_thorough = [ 'mips64el_loongson3v', ] diff --git a/tests/avocado/machine_mips_fuloong2e.py b/tests/functional/test_mips64el_fuloong2e.py old mode 100644 new mode 100755 similarity index 58% rename from tests/avocado/machine_mips_fuloong2e.py rename to tests/functional/test_mips64el_fuloong2e.py index 89291f47b2..7688a32713 --- a/tests/avocado/machine_mips_fuloong2e.py +++ b/tests/functional/test_mips64el_fuloong2e.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # Functional tests for the Lemote Fuloong-2E machine. # # Copyright (c) 2019 Philippe Mathieu-Daudé @@ -8,35 +10,36 @@ # SPDX-License-Identifier: GPL-2.0-or-later import os +import subprocess -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from qemu_test import QemuSystemTest +from qemu_test import wait_for_console_pattern +from unittest import skipUnless class MipsFuloong2e(QemuSystemTest): timeout = 60 - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted code') @skipUnless(os.getenv('RESCUE_YL_PATH'), 'RESCUE_YL_PATH not available') - def test_linux_kernel_isa_serial(self): - """ - :avocado: tags=arch:mips64el - :avocado: tags=machine:fuloong2e - :avocado: tags=endian:little - :avocado: tags=device:bonito64 - :avocado: tags=device:via686b - """ + def test_linux_kernel_2_6_27_isa_serial(self): # Recovery system for the Yeeloong laptop # (enough to test the fuloong2e southbridge, accessing its ISA bus) # http://dev.lemote.com/files/resource/download/rescue/rescue-yl - kernel_hash = 'ec4d1bd89a8439c41033ca63db60160cc6d6f09a' - kernel_path = self.fetch_asset('file://' + os.getenv('RESCUE_YL_PATH'), - asset_hash=kernel_hash) + sha = 'ab588d3316777c62cc81baa20ac92e98b01955c244dff3794b711bc34e26e51d' + kernel_path = os.getenv('RESCUE_YL_PATH') + output = subprocess.check_output(['sha256sum', kernel_path]) + checksum = output.split()[0] + assert checksum.decode("utf-8") == sha + self.set_machine('fuloong2e') self.vm.set_console() self.vm.add_args('-kernel', kernel_path) self.vm.launch() wait_for_console_pattern(self, 'Linux version 2.6.27.7lemote') cpu_revision = 'CPU revision is: 00006302 (ICT Loongson-2)' wait_for_console_pattern(self, cpu_revision) + + +if __name__ == '__main__': + QemuSystemTest.main() From patchwork Fri Aug 30 13:38:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 824004 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp787323wrs; Fri, 30 Aug 2024 06:44:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUiIFWxbe/B7rQrxDy2+Y64+Yn8J4SrFdC53JQUOAuydj85whkIIM2z2evN3qyw2sUhiADAoQ==@linaro.org X-Google-Smtp-Source: AGHT+IH+oVRr8VrVj5W/f07L7RzbU7lWl6qc/OmbcKPlrpQaSN4orJOuckS+XK4FCWkJ1pCmloIr X-Received: by 2002:a05:622a:a16:b0:447:e60c:628 with SMTP id d75a77b69052e-4567f6f3618mr72641991cf.51.1725025482897; Fri, 30 Aug 2024 06:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725025482; cv=none; d=google.com; s=arc-20160816; b=KKCoMeIVLNN2JYWqsLKZ9ZyjlkhqOMm0OlCA1F2z6ImXSGGi+AZxu+Rko1dhB1rmHI 8pIerToR9BPq5JLUmVYU0ZbEbI6RwJIvgTkEOoD9xAgV4ckpwG1so8ym83a6Nbey8NKU wxdvv5n/TkqjafSXw9oAaeg+1T/4jYRCptGzJvJUmJ3D0tNX327DjQnGk/mL7Rl4xXCq fH31FCgdMl4rkmzOvJwWK7ydFOvV0gG6tvzT6d7UKqMjbwmASzIiKwWornRsRU04+EeB zkXPeC0k8Mvk/Fl2+LlYMS1IaMek09cvCWj2K4Ph4TQYRloFvSSiqAxHPDZ5weth71J3 6Ghg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rD08ZnMTN0VvxHk60UxwJ6iH60cIkpG/1tMMITmmOvQ=; fh=P38goHIztZ4gXokF5rhgtVEB12E6Nfjaq+2lEOZYQsE=; b=MousvSL0uftJgla2zZF3QLd6A0jD8wyWqTuZjgh9ikBAY/IAlODbsJGQwPI5eIFCE5 7qZKOIMEGP8I26+VCOlKDGKVZ9o1w7++FovsYBYk8ATpXdABaMx1UJfVEAoJcETGjKr4 C49EzW4EbJE4AEJUq4lsJcqFA/DTCxCQE0AaM7pNB0ZXNj0Q76WuyTPuBfOkNiW2/Mrh FbbOh1Xm7MynLEq5hmQF+Kh4DC7XHk3cKq/n6NHUaXRrNeKgLeGqVUGdYnairuRNfy9i Uq/ZqYHB7IHGpU9tG6GQ7jJjYfgZYX6/9bAzVXrrngweiIaAskQgaafiDr2hkSfVsg1t 5VpQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="NIPi/j2N"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45682d3d223si37499331cf.327.2024.08.30.06.44.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Aug 2024 06:44:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="NIPi/j2N"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sk1sy-0003lX-Qd; Fri, 30 Aug 2024 09:41:57 -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 1sk1sl-00031T-HD for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1sj-0005eb-Br for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725025299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rD08ZnMTN0VvxHk60UxwJ6iH60cIkpG/1tMMITmmOvQ=; b=NIPi/j2N4m7qhYvv1NI5qyQsNuJOJ08S5YefLMJL86nkw1ZhXDCJfQ545PyZUzeexbvfXD ALntPRTrxH32T6w4wKAg7gpSopPu76p70YlYz3GPvbbKuFe46USnNyWpfNt2uI20Mth2xd pWNTQMGKKCXT63azXPMv06vZry2OoCQ= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-FfptHt0DOI2CIdlRhtrmog-1; Fri, 30 Aug 2024 09:41:36 -0400 X-MC-Unique: FfptHt0DOI2CIdlRhtrmog-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 672391955BFA; Fri, 30 Aug 2024 13:41:32 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EBFDF300019C; Fri, 30 Aug 2024 13:41:28 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha , Richard Henderson , John Snow , Fabiano Rosas Subject: [PATCH v5 37/44] tests/functional: Add QemuUserTest class Date: Fri, 30 Aug 2024 15:38:31 +0200 Message-ID: <20240830133841.142644-38-thuth@redhat.com> In-Reply-To: <20240830133841.142644-1-thuth@redhat.com> References: <20240830133841.142644-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Per commit 5334df4822 ("tests/avocado: Introduce QemuUserTest base class"): Similarly to the 'System' Test base class with methods for testing system emulation, the QemuUserTest class contains methods useful to test user-mode emulation. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240822104238.75045-2-philmd@linaro.org> Signed-off-by: Thomas Huth --- tests/functional/qemu_test/__init__.py | 2 +- tests/functional/qemu_test/testcase.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py index 1d87d7122f..f33282efe8 100644 --- a/tests/functional/qemu_test/__init__.py +++ b/tests/functional/qemu_test/__init__.py @@ -11,4 +11,4 @@ from .cmd import has_cmd, has_cmds, run_cmd, is_readable_executable_file, \ interrupt_interactive_console_until_pattern, wait_for_console_pattern, \ exec_command, exec_command_and_wait_for_pattern, get_qemu_img -from .testcase import QemuSystemTest, QemuBaseTest +from .testcase import QemuBaseTest, QemuUserTest, QemuSystemTest diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 18314be9d1..aa0146265a 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -13,6 +13,7 @@ import logging import os +import subprocess import pycotap import sys import unittest @@ -70,6 +71,22 @@ def main(): unittest.main(module = None, testRunner = tr, argv=["__dummy__", path]) +class QemuUserTest(QemuBaseTest): + + def setUp(self): + super().setUp('qemu-') + self._ldpath = [] + + def add_ldpath(self, ldpath): + self._ldpath.append(os.path.abspath(ldpath)) + + def run_cmd(self, bin_path, args=[]): + return subprocess.run([self.qemu_bin] + + ["-L %s" % ldpath for ldpath in self._ldpath] + + [bin_path] + + args, + text=True, capture_output=True) + class QemuSystemTest(QemuBaseTest): """Facilitates system emulation tests.""" From patchwork Fri Aug 30 13:38:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 824001 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp786754wrs; Fri, 30 Aug 2024 06:43:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVOsklpClgyrowFJFy1VZFK5hJf1HytpJ+HxQzBwXPOwmntLEwlf7GHrYyp21fkLZekeCywOQ==@linaro.org X-Google-Smtp-Source: AGHT+IG4VDn+jbyIGRJEZk7bJ3dC6hsfO/19r5SDy5B+Z+gAmWKi3mF/fiSeSYwjrNwmGW3g8OU/ X-Received: by 2002:a05:622a:4812:b0:44f:f1ba:d9fd with SMTP id d75a77b69052e-4567f7212dfmr69136241cf.64.1725025405076; Fri, 30 Aug 2024 06:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725025405; cv=none; d=google.com; s=arc-20160816; b=OxGgvUkPxmUtGEz1rUCEFRPU+sqpRoEcxK4XF3/aM2L4IqOlG6wjW3JBoqzJcAJTQL Crwbc+1zRH/QpyvFFrMqxiQ7FFzYMzkt+jfVttoQfRlIHKV2q1JmWohBDIpLEAQfDM5w InfB+THTWRCYyGTPAAaGcITBONT9FXGkSBx1Ghaq/RML5riyomqXPV6R9MwMzIV+9HaR qU+1d4ghADM7AxPSBDaKvX6gMKIDDkVPX2nETXRtJMW8pSAjmOkDQEsVVx0btZ/dochy QZfVrXzPXUJN884/1eQkoeJlS98746HEL1QAzuqnZdjxitp1AOcrCFyEV+q82f7+lskz DmWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AiCpW9mlrliMsd0sml8PvZbAgZSRZheKGz2GIntE/hc=; fh=P38goHIztZ4gXokF5rhgtVEB12E6Nfjaq+2lEOZYQsE=; b=vt/drH6PM0RYej0FvyHhrX19g7qR5JLG9CNzB+fdLvYRHU1KaY/TQspzz3v2yxBaHH Q1aPn8uwsqT8SGhASCWAUimVrEcB7NB7nUD9hehtVZ+06rNzVbeThbk5ATZNRAxXZO61 er36yKtvX86hEEylNAcSazm4wqbjAoyF0HRdYB7OQD0/90RogTlIGqtrT6MDbOZqC/2C Wb5hzcE/sMi6Lxa4tLhTHoFkcb5UroWQn9XZ+jX6jCgJJR5phlMZV/We/0dDDis2Q+5R UmC4OA3aATzRicr9G/es0f1zmCkg15CWSmJsZG4ko2f7i0uR48vJ88YPDyDw9rbVt3DN OP1A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CpHjW1nO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45682c87af6si10066731cf.149.2024.08.30.06.43.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Aug 2024 06:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CpHjW1nO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sk1sz-000463-ME; Fri, 30 Aug 2024 09:41:57 -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 1sk1so-0003Dc-My for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1sl-0005em-Hu for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725025302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AiCpW9mlrliMsd0sml8PvZbAgZSRZheKGz2GIntE/hc=; b=CpHjW1nOSUyg54HAzlWVfxQ4/mH2rGvAewWeza0UH2SMsNefmNe4UwmQuJRBDD9/270hGr 34AnDN4RHtdTMyLFOawmJAXGpaZxBsrfRTrHoMxvkvs82C+k0C2Ev0ppIVYgqmKy1w9+tD F11IEB4QfiYL5oQLUiQ2eFiAGe3FMUE= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-3W5w2x5jNKWJQ4ynAB7ctg-1; Fri, 30 Aug 2024 09:41:37 -0400 X-MC-Unique: 3W5w2x5jNKWJQ4ynAB7ctg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 34DD31955BF7; Fri, 30 Aug 2024 13:41:36 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BA8503001FE8; Fri, 30 Aug 2024 13:41:32 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha , Richard Henderson , John Snow , Fabiano Rosas Subject: [PATCH v5 38/44] tests/functional: Convert ARM bFLT linux-user avocado test Date: Fri, 30 Aug 2024 15:38:32 +0200 Message-ID: <20240830133841.142644-39-thuth@redhat.com> In-Reply-To: <20240830133841.142644-1-thuth@redhat.com> References: <20240830133841.142644-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Expose cpio_extract() in qemu_test.utils for possible reuse. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240822104238.75045-3-philmd@linaro.org> [thuth: Add test to meson.build] Signed-off-by: Thomas Huth --- tests/avocado/load_bflt.py | 54 ----------------------------- tests/functional/meson.build | 4 +++ tests/functional/qemu_test/utils.py | 9 +++++ tests/functional/test_arm_bflt.py | 44 +++++++++++++++++++++++ 4 files changed, 57 insertions(+), 54 deletions(-) delete mode 100644 tests/avocado/load_bflt.py create mode 100755 tests/functional/test_arm_bflt.py diff --git a/tests/avocado/load_bflt.py b/tests/avocado/load_bflt.py deleted file mode 100644 index bb50cec1ee..0000000000 --- a/tests/avocado/load_bflt.py +++ /dev/null @@ -1,54 +0,0 @@ -# Test the bFLT loader format -# -# Copyright (C) 2019 Philippe Mathieu-Daudé -# -# SPDX-License-Identifier: GPL-2.0-or-later - -import os -import bz2 -import subprocess - -from avocado import skipUnless -from avocado_qemu import QemuUserTest -from avocado_qemu import has_cmd - - -class LoadBFLT(QemuUserTest): - - def extract_cpio(self, cpio_path): - """ - Extracts a cpio archive into the test workdir - - :param cpio_path: path to the cpio archive - """ - cwd = os.getcwd() - os.chdir(self.workdir) - with bz2.open(cpio_path, 'rb') as archive_cpio: - subprocess.run(['cpio', '-i'], input=archive_cpio.read(), - stderr=subprocess.DEVNULL) - os.chdir(cwd) - - @skipUnless(*has_cmd('cpio')) - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') - def test_stm32(self): - """ - :avocado: tags=arch:arm - :avocado: tags=linux_user - :avocado: tags=quick - """ - # See https://elinux.org/STM32#User_Space - rootfs_url = ('https://elinux.org/images/5/51/' - 'Stm32_mini_rootfs.cpio.bz2') - rootfs_hash = '9f065e6ba40cce7411ba757f924f30fcc57951e6' - rootfs_path_bz2 = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash) - busybox_path = os.path.join(self.workdir, "/bin/busybox") - - self.extract_cpio(rootfs_path_bz2) - - res = self.run(busybox_path) - ver = 'BusyBox v1.24.0.git (2015-02-03 22:17:13 CET) multi-call binary.' - self.assertIn(ver, res.stdout_text) - - res = self.run(busybox_path, ['uname', '-a']) - unm = 'armv7l GNU/Linux' - self.assertIn(unm, res.stdout_text) diff --git a/tests/functional/meson.build b/tests/functional/meson.build index dcede9733e..6b00d240dd 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -45,6 +45,10 @@ tests_arm_system_thorough = [ 'arm_n8x0', ] +tests_arm_linuxuser_thorough = [ + 'arm_bflt', +] + tests_avr_system_thorough = [ 'avr_mega2560', ] diff --git a/tests/functional/qemu_test/utils.py b/tests/functional/qemu_test/utils.py index 99eae5fc45..2a1cb60d38 100644 --- a/tests/functional/qemu_test/utils.py +++ b/tests/functional/qemu_test/utils.py @@ -12,6 +12,7 @@ import lzma import os import shutil +import subprocess import tarfile def archive_extract(archive, dest_dir, member=None): @@ -45,3 +46,11 @@ def lzma_uncompress(xz_path, output_path): except: os.remove(output_path) raise + +def cpio_extract(cpio_handle, output_path): + cwd = os.getcwd() + os.chdir(output_path) + subprocess.run(['cpio', '-i'], + input=cpio_handle.read(), + stderr=subprocess.DEVNULL) + os.chdir(cwd) diff --git a/tests/functional/test_arm_bflt.py b/tests/functional/test_arm_bflt.py new file mode 100755 index 0000000000..281925d11a --- /dev/null +++ b/tests/functional/test_arm_bflt.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +# +# Test the bFLT loader format +# +# Copyright (C) 2019 Philippe Mathieu-Daudé +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import bz2 + +from qemu_test import QemuUserTest, Asset +from qemu_test import has_cmd +from qemu_test.utils import cpio_extract +from unittest import skipUnless + + +class LoadBFLT(QemuUserTest): + + ASSET_ROOTFS = Asset( + ('https://elinux.org/images/5/51/Stm32_mini_rootfs.cpio.bz2'), + 'eefb788e4980c9e8d6c9d60ce7d15d4da6bf4fbc6a80f487673824600d5ba9cc') + + @skipUnless(*has_cmd('cpio')) + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted code') + def test_stm32(self): + # See https://elinux.org/STM32#User_Space + rootfs_path_bz2 = self.ASSET_ROOTFS.fetch() + busybox_path = os.path.join(self.workdir, "bin/busybox") + + with bz2.open(rootfs_path_bz2, 'rb') as cpio_handle: + cpio_extract(cpio_handle, self.workdir) + + res = self.run_cmd(busybox_path) + ver = 'BusyBox v1.24.0.git (2015-02-03 22:17:13 CET) multi-call binary.' + self.assertIn(ver, res.stdout) + + res = self.run_cmd(busybox_path, ['uname', '-a']) + unm = 'armv7l GNU/Linux' + self.assertIn(unm, res.stdout) + + +if __name__ == '__main__': + QemuUserTest.main() From patchwork Fri Aug 30 13:38:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 824003 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp787236wrs; Fri, 30 Aug 2024 06:44:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW3oGJx2C4dOINhf8LZ2fKrVJPr3erj5kssgywZkbUa1yYvD5d1dvAtR2eZG5KhXyOsTKbXqQ==@linaro.org X-Google-Smtp-Source: AGHT+IHdWgWLmYanbuOYeHtA91vm5KYdrOdpoM10uZ0AjuiMsdK9cgs+pwEuO7IkeLmo0F6nFksv X-Received: by 2002:a05:6214:4281:b0:6c1:6b0e:8301 with SMTP id 6a1803df08f44-6c33e5e4d12mr70466556d6.5.1725025472537; Fri, 30 Aug 2024 06:44:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725025472; cv=none; d=google.com; s=arc-20160816; b=1J6O7e12hzv8kd2UhQZ99zVLAq6k9TgSzo/lSTtJ8fvTlcEGs1x2NylDnjgPp7mdsU M464TR/gauisVoV4o2spAH80SkvQjB9WgTsZC45u3WGVq0j11RZJM73quypTmjXTaZFb +AQZvzEeTk06vz3poH4n3w6EsysHBCbM5ZrasY05E2rNdDTiRs0aj9fXg3rY5qqI2a0a gu93so478ccNEWzCBrvjYSoFFpcG2aWikvhIIWJbalAXKkWChHTUA0KcNe8H4gQYMnLO 4Ftv5J9urXtgxZqKlKVZrJzwCc0nOdlk9u8OYwM5XsMOnq0YVwGEzBCF+t/qiFE5gTpZ 7FgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9p0RKHgP9JstxY3TIpZE+KxWklnhkhPn4c1qKdz/V94=; fh=P38goHIztZ4gXokF5rhgtVEB12E6Nfjaq+2lEOZYQsE=; b=gu10//iUUzlTHEWVxHbcV/FeXPrgSiFH7qNpucnn1BcIPzVXJ8GTwCSiGPC8PR8vjM phKuiqbk39tMEKyyI2+KTUQDj89jVZLILnR9t1kwNL0QhKLri9Jhf4IibO6n+KK2yL3A NIRdSZ7lWzWon5ajT5HHCU4p81zzcU1btTlYvBeTtLVDcPDZQzLxFl8nctJWbf+g0x6r ZnCpo0iYxACAI8jnW9kQDup6eF4Xn2T7ERmbNOkfY4927R0a9/uBCJASDuyPKJDMgYga WeH884R57Bc/aDxEQ/oImr1QT20stsCdqPQK75yN/86w4dq6PB3idFuc4TO12omGJghE lCqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VJ9IngPI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c340ca2213si39598056d6.320.2024.08.30.06.44.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Aug 2024 06:44:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VJ9IngPI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sk1sz-00048G-UT; Fri, 30 Aug 2024 09:41:58 -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 1sk1sp-0003K4-Lu for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1sn-0005ey-70 for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:41:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725025304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9p0RKHgP9JstxY3TIpZE+KxWklnhkhPn4c1qKdz/V94=; b=VJ9IngPICBmMglYNFivhMoS/IkQG+460icCNGrTB8Cvl/Mjw/6coXWhRoQ/I1R436K5i9Z TdAiVzdb6TwGpDHLWPlNKWPFn7N/ALOqqxXBBNPEHKt6OKL9JSlij0O0TEoSuRvGDbkeXS pPAjl5FhGX5nd2oqeB9uHUU69nsdUm0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-493-rztWY6CiN8GrrHs7SqQ4Gg-1; Fri, 30 Aug 2024 09:41:41 -0400 X-MC-Unique: rztWY6CiN8GrrHs7SqQ4Gg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EE57D1955D47; Fri, 30 Aug 2024 13:41:39 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A259E3001FEF; Fri, 30 Aug 2024 13:41:36 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ani Sinha , Richard Henderson , John Snow , Fabiano Rosas Subject: [PATCH v5 39/44] tests/avocado: Remove unused QemuUserTest class Date: Fri, 30 Aug 2024 15:38:33 +0200 Message-ID: <20240830133841.142644-40-thuth@redhat.com> In-Reply-To: <20240830133841.142644-1-thuth@redhat.com> References: <20240830133841.142644-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé The single test that was using the QemuUserTest class has been converted to the functional test framework. This class is now unused, remove it. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240822104238.75045-4-philmd@linaro.org> Signed-off-by: Thomas Huth --- tests/avocado/avocado_qemu/__init__.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index ef935614cf..0e4ecea7a0 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -384,23 +384,6 @@ def tearDown(self): super().tearDown() -class QemuUserTest(QemuBaseTest): - """Facilitates user-mode emulation tests.""" - - def setUp(self): - self._ldpath = [] - super().setUp('qemu-') - - def add_ldpath(self, ldpath): - self._ldpath.append(os.path.abspath(ldpath)) - - def run(self, bin_path, args=[]): - qemu_args = " ".join(["-L %s" % ldpath for ldpath in self._ldpath]) - bin_args = " ".join(args) - return process.run("%s %s %s %s" % (self.qemu_bin, qemu_args, - bin_path, bin_args)) - - class LinuxSSHMixIn: """Contains utility methods for interacting with a guest via SSH."""