From nobody Sun Nov 24 21:33:49 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720699059; cv=none; d=zohomail.com; s=zohoarc; b=NeN4ejPeFaH/kvFiNYMqkgQKNmXBIIRh4NLlxQ7eMFoRM5R1XIzhsTideWk5Yl07peryysyo9e4lhhu/GWSznJXeKwD4mjYQRk6BHPjfTYL3WSC5I09k5u79wx6Ca7rvqQ0TGdHNnhB92thmod86LxtGbVJ5TRrrHO5YB8Sv0Yc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720699059; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h18LYbjBJTgvDMDvH+3FMrTXwPHvgF54cOWbiPgrN0I=; b=JUjYlTDmfW7zvkPqk5m+AGgvJstTCdkpJTFWu+SRcPEZk+NC2aOyjPwEeaGtAvhXOebClJiBU/tZ7VZCgwifeJNy+FGznO9OJKeYU2OWdr7dL981K3mIXguCIrs0JnnakqnzV4K7bKI0m1+u0yW37bG652Q+TXOrog9xVI3het8= 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 1720699059858385.15740129510846; Thu, 11 Jul 2024 04:57:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRsQ7-0006P3-OP; Thu, 11 Jul 2024 07:57:08 -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 1sRsPZ-00040n-Ro for qemu-devel@nongnu.org; Thu, 11 Jul 2024 07:56:33 -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 1sRsPU-0004Ad-BP for qemu-devel@nongnu.org; Thu, 11 Jul 2024 07:56:32 -0400 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-688-M5v_Oe42NuKpmiTR4JIW3Q-1; Thu, 11 Jul 2024 07:56:23 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 1C9BA1954B3F; Thu, 11 Jul 2024 11:56:22 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.118]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 375F21954219; Thu, 11 Jul 2024 11:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720698986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h18LYbjBJTgvDMDvH+3FMrTXwPHvgF54cOWbiPgrN0I=; b=ckfJVyoDa2WtiDi5YaeyQoCWy5QDeUbZkDHodejKbKC9P00r3fgQlfp9h4cSK0mFTtk7fM g6yYa+y0wmG509Hx94OwVie6ZY1A2laBhR8fWu5U6bI8hk6pRpIJH7UV6gGSBS4ouWH2F5 LiveEfLDym0RqdiI49uhkYQEmMEeFKU= X-MC-Unique: M5v_Oe42NuKpmiTR4JIW3Q-1 From: Thomas Huth To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Cc: Ani Sinha , Richard Henderson , Paolo Bonzini , "Daniel P . Berrange" , John Snow Subject: [RFC PATCH 6/8] tests/pytest: Convert some tests that download files via fetch_asset() Date: Thu, 11 Jul 2024 13:55:44 +0200 Message-ID: <20240711115546.40859-7-thuth@redhat.com> In-Reply-To: <20240711115546.40859-1-thuth@redhat.com> References: <20240711115546.40859-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.142, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720699060845116600 Content-Type: text/plain; charset="utf-8" Now that we've got a working fetch_asset() function, we can convert some Avocado tests that use this function for downloading their required files. Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/pytest/meson.build | 16 +++++++++++++++ .../test_machine_arm_n8x0.py} | 20 +++++++------------ .../test_machine_avr6.py} | 7 ++----- .../test_machine_loongarch.py} | 11 ++++------ .../test_machine_mips_loongson3v.py} | 19 ++++++------------ 5 files changed, 35 insertions(+), 38 deletions(-) rename tests/{avocado/machine_arm_n8x0.py =3D> pytest/test_machine_arm_n8x= 0.py} (71%) rename tests/{avocado/machine_avr6.py =3D> pytest/test_machine_avr6.py} (9= 1%) rename tests/{avocado/machine_loongarch.py =3D> pytest/test_machine_loonga= rch.py} (89%) rename tests/{avocado/machine_mips_loongson3v.py =3D> pytest/test_machine_= mips_loongson3v.py} (59%) diff --git a/tests/pytest/meson.build b/tests/pytest/meson.build index 1486628d45..d3607db362 100644 --- a/tests/pytest/meson.build +++ b/tests/pytest/meson.build @@ -8,6 +8,22 @@ pytests_generic =3D [ 'version', ] =20 +pytests_arm =3D [ + 'machine_arm_n8x0', +] + +pytests_avr =3D [ + 'machine_avr6', +] + +pytests_loongarch64 =3D [ + 'machine_loongarch', +] + +pytests_mips64el =3D [ + 'machine_mips_loongson3v', +] + pytests_x86_64 =3D [ 'cpu_queries', 'mem_addr_space', diff --git a/tests/avocado/machine_arm_n8x0.py b/tests/pytest/test_machine_= arm_n8x0.py similarity index 71% rename from tests/avocado/machine_arm_n8x0.py rename to tests/pytest/test_machine_arm_n8x0.py index 12e9a6803b..082284b975 100644 --- a/tests/avocado/machine_arm_n8x0.py +++ b/tests/pytest/test_machine_arm_n8x0.py @@ -10,9 +10,9 @@ =20 import os =20 -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from unittest import skipUnless +from qemu_pytest import QemuSystemTest +from qemu_pytest import wait_for_console_pattern =20 class N8x0Machine(QemuSystemTest): """Boots the Linux kernel and checks that the console is operational""" @@ -32,18 +32,12 @@ def __do_test_n8x0(self): self.vm.launch() wait_for_console_pattern(self, 'TSC2005 driver initializing') =20 - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted co= de') def test_n800(self): - """ - :avocado: tags=3Darch:arm - :avocado: tags=3Dmachine:n800 - """ + self.machine =3D 'n800' self.__do_test_n8x0() =20 - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted co= de') def test_n810(self): - """ - :avocado: tags=3Darch:arm - :avocado: tags=3Dmachine:n810 - """ + self.machine =3D 'n810' self.__do_test_n8x0() diff --git a/tests/avocado/machine_avr6.py b/tests/pytest/test_machine_avr6= .py similarity index 91% rename from tests/avocado/machine_avr6.py rename to tests/pytest/test_machine_avr6.py index 5485db79c6..479038a221 100644 --- a/tests/avocado/machine_avr6.py +++ b/tests/pytest/test_machine_avr6.py @@ -19,16 +19,12 @@ =20 import time =20 -from avocado_qemu import QemuSystemTest +from qemu_pytest import QemuSystemTest =20 class AVR6Machine(QemuSystemTest): timeout =3D 5 =20 def test_freertos(self): - """ - :avocado: tags=3Darch:avr - :avocado: tags=3Dmachine:arduino-mega-2560-v3 - """ """ https://github.com/seharris/qemu-avr-tests/raw/master/free-rtos/De= mo/AVR_ATMega2560_GCC/demo.elf constantly prints out 'ABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRS= TUVWX' @@ -39,6 +35,7 @@ def test_freertos(self): rom_hash =3D '7eb521f511ca8f2622e0a3c5e8dd686efbb911d4' rom_path =3D self.fetch_asset(rom_url, asset_hash=3Drom_hash) =20 + self.machine =3D 'arduino-mega-2560-v3' self.vm.add_args('-bios', rom_path) self.vm.add_args('-nographic') self.vm.launch() diff --git a/tests/avocado/machine_loongarch.py b/tests/pytest/test_machine= _loongarch.py similarity index 89% rename from tests/avocado/machine_loongarch.py rename to tests/pytest/test_machine_loongarch.py index 8de308f2d6..3eb68745ac 100644 --- a/tests/avocado/machine_loongarch.py +++ b/tests/pytest/test_machine_loongarch.py @@ -5,9 +5,9 @@ # Copyright (c) 2023 Loongson Technology Corporation Limited # =20 -from avocado_qemu import QemuSystemTest -from avocado_qemu import exec_command_and_wait_for_pattern -from avocado_qemu import wait_for_console_pattern +from qemu_pytest import QemuSystemTest +from qemu_pytest import exec_command_and_wait_for_pattern +from qemu_pytest import wait_for_console_pattern =20 class LoongArchMachine(QemuSystemTest): KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' @@ -21,10 +21,7 @@ def wait_for_console_pattern(self, success_message, vm= =3DNone): =20 def test_loongarch64_devices(self): =20 - """ - :avocado: tags=3Darch:loongarch64 - :avocado: tags=3Dmachine:virt - """ + self.machine =3D 'virt' =20 kernel_url =3D ('https://github.com/yangxiaojuan-loongson/qemu-bin= ary/' 'releases/download/2024-05-30/vmlinuz.efi') diff --git a/tests/avocado/machine_mips_loongson3v.py b/tests/pytest/test_m= achine_mips_loongson3v.py similarity index 59% rename from tests/avocado/machine_mips_loongson3v.py rename to tests/pytest/test_machine_mips_loongson3v.py index 5194cf18c9..189b22c04e 100644 --- a/tests/avocado/machine_mips_loongson3v.py +++ b/tests/pytest/test_machine_mips_loongson3v.py @@ -10,28 +10,21 @@ import os import time =20 -from avocado import skipUnless -from avocado_qemu import QemuSystemTest -from avocado_qemu import wait_for_console_pattern +from unittest import skipUnless +from qemu_pytest import QemuSystemTest +from qemu_pytest import wait_for_console_pattern =20 class MipsLoongson3v(QemuSystemTest): timeout =3D 60 =20 - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted co= de') def test_pmon_serial_console(self): - """ - :avocado: tags=3Darch:mips64el - :avocado: tags=3Dendian:little - :avocado: tags=3Dmachine:loongson3-virt - :avocado: tags=3Dcpu:Loongson-3A1000 - :avocado: tags=3Ddevice:liointc - :avocado: tags=3Ddevice:goldfish_rtc - """ + self.machine =3D 'loongson3-virt' =20 pmon_hash =3D '7c8b45dd81ccfc55ff28f5aa267a41c3' pmon_path =3D self.fetch_asset('https://github.com/loongson-commun= ity/pmon/' 'releases/download/20210112/pmon-3avir= t.bin', - asset_hash=3Dpmon_hash, algorithm=3D'= md5') + asset_hash=3Dpmon_hash) =20 self.vm.set_console() self.vm.add_args('-bios', pmon_path) --=20 2.45.2