From patchwork Wed Sep 4 10:39:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 825303 Delivered-To: patch@linaro.org Received: by 2002:adf:e246:0:b0:367:895a:4699 with SMTP id bl6csp98300wrb; Wed, 4 Sep 2024 03:42:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVRsNnSJxuCTEDPOMPGcdCpeD73mqGS7iv93uFkmYn2ECWiWqKP92g6j5GiPoWBZeDE/7OsWQ==@linaro.org X-Google-Smtp-Source: AGHT+IF5uWpnW0uoARiKldgxwkGdyAqeb5qXcRWMn8gBwEUul8qtS2c3XDdcCH3H/YGcxvXMGy7g X-Received: by 2002:a05:620a:4547:b0:7a6:5cd1:aaf with SMTP id af79cd13be357-7a9788da09dmr675775285a.66.1725446563345; Wed, 04 Sep 2024 03:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725446563; cv=none; d=google.com; s=arc-20160816; b=mPzatRpqWwt9c8TAzLwbSEmv7tqwHCLFjKP4Gl8bslhoJnRfvTqmU+hFf5PLAQtg6x YD6Vn7rXpSO1emJI/hbFc6YHf8xsbvilkKZ5o8MbWQ+4ruecG3RQSqjiTkfKbOWBP8Ys SxXPjWrj9PjjFFkCXIwGRQenERHI6AunZtF9J98se0WqoUpCsDmyVl4Zo27tiShrDJF3 bOEqILMJCQGY7zVfcjPYD61iA/FJfD9fjQd8I3GG9QckpZd1gS8knUrg2aaDnaw2sIoA urLyWTqV0FRO/nBy3N9g17AsMyGPeBgkHGDZz7LDbCYgTiuDPVUeJyTfYVzRXGbF3JKN ffxQ== 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=ajoH62t7koMoEkPS3bEFtLyL7UGuEvc08cjgjR2BBLc=; fh=GA6tJk/WKXFNHREIjl3CVQtm7xJ+c0jqwR7aN/BFkLY=; b=BiYuiTpRlxxTXAOrBFn0RLPcBb5N/+GJVBmdwEfqI72xuLhdKQOxXbOAQJ2rE21lTb cDiX/pmhM6UAdxP8WmPOIJDDxup20W1OkbMUpaTMn8w8bLrupwDtH+J2J9i9vG5RvrX/ SyqfB+qL8CMebtb3kSRckO/s+CXVu4GVvom9XOt7m1hkfxlH43zwcHzTF9yhG5dUw1+R ZqurY2T0D1H6kgZMEQp+k/V1BEQq8AfGQtujIkq+RQxOWwNWqYxqazipyphNXrKN7f/A co4AvNQxXVjdXRVz/wYuVfTHZqQZOnX2LE8w0wx2UuAbo/xnfCehshWI+QJ7G/GcuEBy Rfgw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TL3r2Cpq; 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-7a806d5117bsi1412963585a.273.2024.09.04.03.42.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2024 03:42:43 -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=TL3r2Cpq; 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 1slnRb-0005oc-PJ; Wed, 04 Sep 2024 06:40:59 -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 1slnRa-0005jJ-HX for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:40:58 -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 1slnRY-0000Qh-KX for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:40:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725446456; 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=ajoH62t7koMoEkPS3bEFtLyL7UGuEvc08cjgjR2BBLc=; b=TL3r2Cpq2dD4D8XVBdyDPHQLHtietr9u0CKyK/qaEDt25yBuIqH1mD0/flPkPD9anWrXRq HcxW+a3CgAUk3yt39YF+JYMG9IrVnw12K9/tdHtB78SkCqPMzwTXuM4zBdH4sWiA+QrE+v qNUed6u0L5K/bUekkJy19l/0X7n7c2I= 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-270-BLInFrlaM8GzYTYQ4scEFg-1; Wed, 04 Sep 2024 06:40:54 -0400 X-MC-Unique: BLInFrlaM8GzYTYQ4scEFg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 AE9791956083; Wed, 4 Sep 2024 10:40:53 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.48]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 71F821955F44; Wed, 4 Sep 2024 10:40:51 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 31/42] tests/functional: Convert ARM Integrator/CP avocado tests Date: Wed, 4 Sep 2024 12:39:06 +0200 Message-ID: <20240904103923.451847-32-thuth@redhat.com> In-Reply-To: <20240904103923.451847-1-thuth@redhat.com> References: <20240904103923.451847-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 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, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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é Message-ID: <20240822110238.82312-1-philmd@linaro.org> Reviewed-by: Thomas Huth Message-ID: <20240830133841.142644-34-thuth@redhat.com> 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 092d3ec60f..a0b7e68c62 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -784,7 +784,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 2e34f4ddfd..7abd998e3c 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', ] tests_avr_system_thorough = [ 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 Wed Sep 4 10:39:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 825304 Delivered-To: patch@linaro.org Received: by 2002:adf:e246:0:b0:367:895a:4699 with SMTP id bl6csp98669wrb; Wed, 4 Sep 2024 03:44:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUdxgRMW4R5f8o33iP5yodqWr0tNfqSk+V4BAqyDHTDY1zFPYIoj5Hz2odcLkybkD4CKuWYHQ==@linaro.org X-Google-Smtp-Source: AGHT+IGekFL5j47B3kWGTrYBG9QqkvZ+rdilm3JrsBnzrue2HQF+kQVYzCuQtJjKjZZGMRk0rggF X-Received: by 2002:a05:6102:3712:b0:492:a11f:a87a with SMTP id ada2fe7eead31-49a5af8107bmr21940547137.25.1725446640350; Wed, 04 Sep 2024 03:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725446640; cv=none; d=google.com; s=arc-20160816; b=QIMvk4V4oGFTwzjze1QVIgpC+tj1b5Im4TKpR57/0G+tPvgWzIi6kBPshFG30sViRI 3tROVzjmjv1+YP445SfqJUaXDpwOz9ZA29c1ip7gsjRtK2yS+ASKT84AZYiEvX2khozK EEd/BiNVR/FkuVq9fyTjkVk4zGdYiGbd61Rl8B1BKawdFGNW8DNEsJqAvLxGf5WxsiHS IHOF56N+Rn0SQ4aQ6JY+iol/PAus5oQEQ03x9Z9PMnLuwjbgD9DqCpHA5oFqkNpOJc13 HNQwgA+/Xx0VETBy9jRil0ME5CzAoNrnNG49Uy4bpZqNr9diQrPPk96c2G0LD/iaVjYd 4M5g== 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=+H2zAIaCvXqycK9RY55+UERYhbxvdqjfeqsuSJFsjxs=; fh=JTUp4S8RRUG8HTpe5r+6hngn9ahtWJR3hTwbwGZV35E=; b=OWJTfDBAAzmx8Jkuyixne00h0NqK18V/fC7v8xyi8khDStlUXzn9IY9AidakRUqBtx NkduRblpFq5XSkudAyUXUyFRELe9IOg08WxXq5Z9lEuJ+sOPm/C2pS0+WQfC2JwkWxlz 2HQ1IDQHmF7xhaX426IBC7G98YaZDnvc8/wOLOkhwd67YlWy6P07LiqG8CjwpDH5UvsN bSGNe4bR8kOWCzM/70llNIY6uptpuIL1SDxJ4b8Q/WQVii7C9jf1v3Sf0QE0NC1+j3rp iuhl8yZrTCK33bFcvMy6Iq62TJdISwelFpTdasa5E9Z3P2q0KrwVdwrxIasOYSMPMvtN X5cg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QFZ6FlWG; 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-7a806d5401esi1455068985a.272.2024.09.04.03.44.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2024 03:44:00 -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=QFZ6FlWG; 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 1slnRj-0006tf-Qr; Wed, 04 Sep 2024 06:41:07 -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 1slnRi-0006iN-LF for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:06 -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 1slnRf-0000TI-Vw for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725446463; 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=+H2zAIaCvXqycK9RY55+UERYhbxvdqjfeqsuSJFsjxs=; b=QFZ6FlWGlnfapCEM/5fGxPnNHI7gw1VhvLgXfj5TP5QDhoOqaE9hdoOZa4zU4E6ijUE+Z+ QcNtns0/dvrnkcgjfhWNCCxCZ1kCWawbEnyEIJHDcmKjzQXuNRofieFo5BaC6N0mxETmQw 92reQV5SAee9mqx8g78uwhA4y74a3VM= Received: from mx-prod-mc-01.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-681-Y0kW9bHPMG69-DOACNWL7Q-1; Wed, 04 Sep 2024 06:40:57 -0400 X-MC-Unique: Y0kW9bHPMG69-DOACNWL7Q-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2E7451955D45; Wed, 4 Sep 2024 10:40:56 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.48]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 598E3195605A; Wed, 4 Sep 2024 10:40:54 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcin Juszkiewicz Subject: [PULL 32/42] tests/functional: Convert Aarch64 SBSA-Ref avocado tests Date: Wed, 4 Sep 2024 12:39:07 +0200 Message-ID: <20240904103923.451847-33-thuth@redhat.com> In-Reply-To: <20240904103923.451847-1-thuth@redhat.com> References: <20240904103923.451847-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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é Message-ID: <20240823131614.10269-1-philmd@linaro.org> Reviewed-by: Thomas Huth Reviewed-by: Marcin Juszkiewicz Message-ID: <20240830133841.142644-35-thuth@redhat.com> [thuth: remove remaining Avocado tags] Signed-off-by: Thomas Huth --- MAINTAINERS | 2 +- tests/functional/meson.build | 5 + .../test_aarch64_sbsaref.py} | 148 ++++++------------ 3 files changed, 55 insertions(+), 100 deletions(-) rename tests/{avocado/machine_aarch64_sbsaref.py => functional/test_aarch64_sbsaref.py} (55%) mode change 100644 => 100755 diff --git a/MAINTAINERS b/MAINTAINERS index a0b7e68c62..edd8e03a42 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -970,7 +970,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 7abd998e3c..b59cd4468f 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 55% rename from tests/avocado/machine_aarch64_sbsaref.py rename to tests/functional/test_aarch64_sbsaref.py index f8bf40c192..f31c2a60b6 --- 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,26 +10,31 @@ 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): """ - :avocado: tags=arch:aarch64 - :avocado: tags=machine:sbsa-ref - :avocado: tags=accel:tcg - As firmware runs at a higher privilege level than the hypervisor we can only run these tests under TCG emulation. """ 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 +51,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 +101,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 +165,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 Wed Sep 4 10:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 825307 Delivered-To: patch@linaro.org Received: by 2002:adf:e246:0:b0:367:895a:4699 with SMTP id bl6csp98911wrb; Wed, 4 Sep 2024 03:44:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVyxdcUJLJbJ7dQiOROTq9y76gmcvCt/2fIGySYMcUug63lZqKpGW3l4GEyVv132ADPA1nE4w==@linaro.org X-Google-Smtp-Source: AGHT+IF/gkQLHluOvCsvgcpG0VB08O4IYMdyyj8OTayZN6JOM4aBLCSPr5dCjlXK7M29L8TwrmnA X-Received: by 2002:a05:622a:2513:b0:457:c74a:638e with SMTP id d75a77b69052e-457e8574f0amr59308591cf.38.1725446680797; Wed, 04 Sep 2024 03:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725446680; cv=none; d=google.com; s=arc-20160816; b=r6QlSAQ7e0ifRoUvIZPV64Ev5DNBCb5m29G91wsKPEbtOB6TgvUrbRelaeSWbqMvQ3 RL0ZBnz/IFaOmly1zdR+xd50/sQrvxGMgR2Th7awt8zPUz5d3Ijg6nSQqqESGhSFCTtE x8NwieDmJ1qn097V+V+C6rIvCEO/qRXprvdVNjb6b9jBu4+oCauGD97dpI/AiRfE00GZ ivvOaWEnUQpFwHq9a9rnD1wjIyvcxcOGD0cF5Te7uEPlJPL3PiJfAe7G77qt5EHpKBUj lZUylFh40x4k8LY+CnzmGbiyntaL4fAbtD/XCfjC6lEhAdA8uMydaljgmzo60v1sXrFs hAsg== 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=TYOP2rcsPix6qPRPw96LNeqpZiRiCS6SJ+U+O5E4Kkg=; fh=GA6tJk/WKXFNHREIjl3CVQtm7xJ+c0jqwR7aN/BFkLY=; b=UbpbtLHRBpLZ9doykLQxf+OBtjG9H9jZn/LtJpWQWLYZDZfBC8exjyDpU8lcPMR04C sslYUdLVd9AMgwPhM8XUVjkmpR45RqZdWMMiHE0X5fzxAogAn6/QXtyru3ADTnfgNzsC HHevSpi+JXstoKWWcX4/KyE+RjWHm5ZaEmhfwxrE6ahICwnPaTtJEykFSdTGk2rh0InT /r2b+7JVvOuELu2vleu152YrgtgcfgMdB6M0Uh4vGa4NdJQUsT1YyPob98oo+HAOIAqk +xkqxEgwGyIVV9Oq1fDJIVOGkF4y9LwJ+wQmtt+Dx8iJx+EPqPLj023A/2380BPKABT0 Vq0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YZHV86dc; 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-45682c888c9si2516771cf.62.2024.09.04.03.44.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2024 03:44:40 -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=YZHV86dc; 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 1slnRg-0006O8-Oz; Wed, 04 Sep 2024 06:41:04 -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 1slnRf-00068k-6m for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:03 -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 1slnRd-0000SE-3P for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725446460; 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=TYOP2rcsPix6qPRPw96LNeqpZiRiCS6SJ+U+O5E4Kkg=; b=YZHV86dcpj7vAWhJMHdNV+VMeldfI3kqJzKkc4lS4yZd94TULhMqtYgqX0B7AxrUIwsvBM PRVhPRXHxOOf6kQwqowDzDXwwov4VQBuc3Bu2DnvKfP4MKkpVe0+QZZpRsWQI1sXv5UTDW cyaFf3nfpZbzfgp9Qh93KvBMgxg/SUA= 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-607-mP6QeXQ4MuCSE1oC_gIb2g-1; Wed, 04 Sep 2024 06:40:59 -0400 X-MC-Unique: mP6QeXQ4MuCSE1oC_gIb2g-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 365CA19560B0; Wed, 4 Sep 2024 10:40:58 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.48]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 92BCD195605A; Wed, 4 Sep 2024 10:40:56 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 33/42] tests/functional: Convert Aarch64 Virt machine avocado tests Date: Wed, 4 Sep 2024 12:39:08 +0200 Message-ID: <20240904103923.451847-34-thuth@redhat.com> In-Reply-To: <20240904103923.451847-1-thuth@redhat.com> References: <20240904103923.451847-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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> Reviewed-by: Thomas Huth Message-ID: <20240830133841.142644-36-thuth@redhat.com> 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 edd8e03a42..f49ab1e454 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1022,7 +1022,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 b59cd4468f..78d3a83a5a 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 Wed Sep 4 10:39:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 825305 Delivered-To: patch@linaro.org Received: by 2002:adf:e246:0:b0:367:895a:4699 with SMTP id bl6csp98773wrb; Wed, 4 Sep 2024 03:44:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVUpDtzjO69Ks/fJ4lcLnj9a9i8viCJdgw5ypwl+ShfDAWyMELtZdjKieFmrX5mZ75ZQ1qCew==@linaro.org X-Google-Smtp-Source: AGHT+IETg/tK+b2KvAwR3FgEhqGpZgjlfFAfTO9d28Nne+9Dev3X9eAGmNawl6pR86szrkX7MWvU X-Received: by 2002:a05:6214:4a02:b0:6c3:5bd8:509f with SMTP id 6a1803df08f44-6c35bd85884mr166843706d6.16.1725446658725; Wed, 04 Sep 2024 03:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725446658; cv=none; d=google.com; s=arc-20160816; b=d3bu/br/jvISQ/AlrQuwtc1MN7n4oEMTLDQDFniI2DKTBBZdtOnb5qESCWG+fPHPp0 kiHJi2Yen6QdxNaHFybcc+ejm1uEHonTjIwKuNobpPyaQL218PAfjStWjlk+xLBm+B0e 1zeUX+mFMxSGaNCVKMtARTWELVve+d5gYjbgngqljZjMGmdWfALz3t35plfUKmI/WBJb 6Ul2AkyFd5UBSJL7/IpUMsU6mZG8flMMh3h8jEMSvU6ECW/TBVhMb8UwlpAi8s6VC3w+ vY1cbaXhZbXd1adiTFDViMDAfI4Btl5rBNIN/0E1hhclUWa1nZGC6ldj+itJJckDMMPp dXEg== 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=+zCKtLmGUpSzIGM3A2iYrWFV3rIa/PLuCFzNEn4QBQc=; fh=GA6tJk/WKXFNHREIjl3CVQtm7xJ+c0jqwR7aN/BFkLY=; b=1EyP2lsweNNffYSj2H0a3y1Rk7ApnjWLRYPpy7jndw8jRIsjhfV6KkhC9DK8WryXmo HTD/yYUYZES14T1Tk3BVU2klnp778BSw/lutHmIR2BStNQtHt/aUSlZeecopFYOplmq+ 6iwj7BeLa/1KLUmti5jWEOzHOLXSTBRMMVOpt+ngxN2yYt7f/feY38Wl04jyafoHcwpr Q54jS3FBlxqRRjOGusFBwIeG6pqELNTNsjZfHvbltFyMZuLor7CzFlQgbEEjPYfhidLH YTvLRQxH1mdl/IkHLIRu3J8G2qmTnZiWNI7iiWwoYHUaVgwJfBPSdctD53/jtd4qKlIM QXIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LxyDGxlp; 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-6c340bf7793si43392606d6.50.2024.09.04.03.44.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2024 03:44:18 -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=LxyDGxlp; 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 1slnRn-0007IV-5d; Wed, 04 Sep 2024 06:41:13 -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 1slnRk-00070Q-Bg for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:08 -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 1slnRh-0000Ty-VI for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725446465; 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=+zCKtLmGUpSzIGM3A2iYrWFV3rIa/PLuCFzNEn4QBQc=; b=LxyDGxlp76t9fipL7G3UjCe1tJb3wlNYHFcfzwMpWAnbFFlKEdEqPMetLQrEIls2RAH2e1 V4XtLPyesn68qpvYctMhOPdyepYv+cFAh9a7rcAYfc9pCsSbO4saywZzgST5RKlpdQd1R4 GJJ5+FvGx1CrYpPjqUbp4TnYZ3Jj0pc= Received: from mx-prod-mc-01.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-225-VFuTqON_PRqVR70QFzAKvw-1; Wed, 04 Sep 2024 06:41:02 -0400 X-MC-Unique: VFuTqON_PRqVR70QFzAKvw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F3D6D1955D4B; Wed, 4 Sep 2024 10:41:00 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.48]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9F1ED1955F45; Wed, 4 Sep 2024 10:40:58 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 34/42] tests/functional: Convert mips64el Fuloong2e avocado test (1/2) Date: Wed, 4 Sep 2024 12:39:09 +0200 Message-ID: <20240904103923.451847-35-thuth@redhat.com> In-Reply-To: <20240904103923.451847-1-thuth@redhat.com> References: <20240904103923.451847-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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é Message-ID: <20240827094905.80648-2-philmd@linaro.org> Reviewed-by: Thomas Huth Message-ID: <20240830133841.142644-37-thuth@redhat.com> 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 f49ab1e454..e221f3460f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1383,7 +1383,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 78d3a83a5a..35c4bad23f 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -64,6 +64,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 Wed Sep 4 10:39:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 825306 Delivered-To: patch@linaro.org Received: by 2002:adf:e246:0:b0:367:895a:4699 with SMTP id bl6csp98792wrb; Wed, 4 Sep 2024 03:44:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXWqgqRgossTOqoPzDXad5pd4Hp4q5IHEpihPbMZwl7ZveiQnsMu/ZHvYyQJV6arulqzX0ycw==@linaro.org X-Google-Smtp-Source: AGHT+IHFyoVm2dyZPPEOphdaseNUUIYN2lMBMBIIkBQL60jMZdrCP1q1/cKtdL+k5k+CAp2QT/Bc X-Received: by 2002:a05:6830:3141:b0:709:3462:a4b6 with SMTP id 46e09a7af769-710aada0acfmr6385640a34.9.1725446661089; Wed, 04 Sep 2024 03:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725446661; cv=none; d=google.com; s=arc-20160816; b=zYpaMtjm8vKhDFCgfNzZk4JTTrtc2x0pkb4iZbun5eR2eniB14d6/h3AQpmxjvu6N3 RJnQEHQIKNCkHLq7cGsy4sBfBqEE/z82aS+HdyLmJY7dq6NLlbtpwvcYPM6SAr+Y3sSy ZLOtxJAdMmMclWi845DcZRbJRLDRqUchCDIJlYdzcHyQ8gfQO+uq+Yf5ZeI0E8WyGeu5 hUnYbRNEOSq426VSsUsWz5488EUxsE4zxoov7DAunCa0hzpQUzFZXY/fjgWZoa9rjxzz yzF3XW9GGZ+Id4+J+PVJ1NJWxJksmXbQDdnxp7aPLIKj+QUrlY+zfdqO1rQRnN1Lnb4h mTig== 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=2QG0fAfmdEZ+scHz33lHba5j2XI/Y3qWZNG3CM6ANi0=; fh=GA6tJk/WKXFNHREIjl3CVQtm7xJ+c0jqwR7aN/BFkLY=; b=Sgv429t2UtF0xMOeVnG6iAFfTuHHj3Uq25fHJAnrjO6A1HHbam23WFIsY3E1+RHzmH 2uH1wxue341S4lMFRQAjMiwGSDGK/IB7ycjBkhGrfldBoGU7j7qP8xNgUj3Gczp1z5to ko8Ueq17dCocOMhVwwMaBZanVS03pLcnWa22lsHTYtQaIf0Iw/Q9tiaSfXCM8WSwD82g aMOIQ9/iS5SC0HRoiYxl0L8rbwMk0GyktEtaTPJbCKcsvIya5QY8CCHhVNPWiP98y49O 7w5ZS/gVIiMaw2upI7cMmUwcnF7jDal8ziAqX4cMNiI+HX9tw/BVQNPN3vqV/OfO7TiF OCVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SXJyO3jG; 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-45682d8349bsi145803741cf.405.2024.09.04.03.44.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2024 03:44:21 -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=SXJyO3jG; 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 1slnRw-0000LZ-Mv; Wed, 04 Sep 2024 06:41:20 -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 1slnRp-0007h3-PD for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:14 -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 1slnRn-0000Va-1N for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725446470; 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=2QG0fAfmdEZ+scHz33lHba5j2XI/Y3qWZNG3CM6ANi0=; b=SXJyO3jGU+vSwt8GmeXP+XEOO3OSgulOFVdCMrHTmnBNGrvF0Tga1arRsR6u83Is+HuD3j bIPfDJ33ZiS9k+PKKZ+V1imN93ph7An4STV+mAwl7pxkOaPQnhL8YxbCMWPEeVutnbD9u+ vsZcF58PGYXtyQOoUxo8iguuPpEpN2c= 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-375-z4QGF8wdMkm81inRP_E-Vw-1; Wed, 04 Sep 2024 06:41:06 -0400 X-MC-Unique: z4QGF8wdMkm81inRP_E-Vw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 DEE6019560AE; Wed, 4 Sep 2024 10:41:02 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.48]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3AFFF1955F44; Wed, 4 Sep 2024 10:41:01 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 35/42] tests/functional: Add QemuUserTest class Date: Wed, 4 Sep 2024 12:39:10 +0200 Message-ID: <20240904103923.451847-36-thuth@redhat.com> In-Reply-To: <20240904103923.451847-1-thuth@redhat.com> References: <20240904103923.451847-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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> Reviewed-by: Thomas Huth Message-ID: <20240830133841.142644-38-thuth@redhat.com> 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 Wed Sep 4 10:39:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 825309 Delivered-To: patch@linaro.org Received: by 2002:adf:e246:0:b0:367:895a:4699 with SMTP id bl6csp100038wrb; Wed, 4 Sep 2024 03:47:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVw7AhrukQiiLsfZ67eZumdJ3sbkThNxXI+3geNRaTMZjRgPaU/lEHNmCSpywXZUm+usNL3kg==@linaro.org X-Google-Smtp-Source: AGHT+IHRjCIHZ5wIsPAwN3jG6BLQsMcOXNzG4Ug6M6f59SK93jRS7CaMo7wFYmU+XTxcxazbKquH X-Received: by 2002:a05:6214:3bc8:b0:6c3:5b2c:e0b3 with SMTP id 6a1803df08f44-6c35b2ce62amr159327256d6.26.1725446877287; Wed, 04 Sep 2024 03:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725446877; cv=none; d=google.com; s=arc-20160816; b=j1nlrkf4d+ThgJLMM9kdk6m9x7VgPK8YbMucDW/XR/43zxcV/uU71hPtXYMG580+EI V9DtcRnzSUpSANWo80R0s5wKJBlG/kI+mNCqfwPRGI//1vONu8P5seka3ByKxknATVPE bRuB54Rlq8LaPWNZ+RiScTlxEioeZB3Fjw5uNDG6qU56Dj+sAGdP/WIH96IunEzeqRLX pdsD+EwyunLretcQqzJ6IMrJt1/YW5hmcP4kYlsUCQ01kXOrAjuOyeyKoA0Ehz/QiCBq U/n+CXyRLNOgtDrHWVpZGOQDGBQvhO84JE/jYjXkKzIv6YvOT5vmzNbgVauVUZinq3cu 0dWw== 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=WL2yH1RcZnWdk1dEkat6xqugwWgp1xEyoElquYopUw8=; fh=GA6tJk/WKXFNHREIjl3CVQtm7xJ+c0jqwR7aN/BFkLY=; b=IVXGxZ1JHDMEoSw1rbZxggyK2z8S8kjt0EfGZhHnCTw0W+0a/liCCpWQwytV+DWd7O osHzqOAng06iZFinYzTR802+xEnA3IzzQOenTotajm/l3Gzhz2YSfUphQVXlLCmBHgG5 kVrHRNttS+HwpRBSKqb8ULlqilugJMWZIS9ovkCYjnhY95I4QwXmKYayMUer0W72smjP kouexVE99HJZkPFxuwSLW1MeUCp+8E30UnD/4hvaUdTKtK13d4ZhfyLK7vrqbsbNP4Sv WdElAxi4NbtAzdM336qYoWGpwwi2Ky1ikabBqKWoTrH1/2QeA9bYgQj+lr/DIrMk523U hTzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ENA6/CSG"; 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-6c516c56dc4si17727676d6.478.2024.09.04.03.47.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2024 03:47:57 -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="ENA6/CSG"; 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 1slnRr-0007pa-M1; Wed, 04 Sep 2024 06:41:15 -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 1slnRn-0007Po-EK for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:13 -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 1slnRl-0000VS-1H for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725446468; 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=WL2yH1RcZnWdk1dEkat6xqugwWgp1xEyoElquYopUw8=; b=ENA6/CSGvPrOg7/8ooJvAmc/ffIRbCpIIFbPRsVUzqmp66YxKMHnEGBSuUF9sY0PFNwQBS +OVbHVPfvPvRSy+GEt4HHY7j2AXKfRDTFgvIM4yqg2P+S0kjDpSlhrdNlTxk0VhbVkfWke J4a2aQ8/VBVprz9zp7yYF+zxuNYCQr0= Received: from mx-prod-mc-01.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-250-u0wo0h_DOCe9y-OCSYnYtw-1; Wed, 04 Sep 2024 06:41:06 -0400 X-MC-Unique: u0wo0h_DOCe9y-OCSYnYtw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4B6E81955D50; Wed, 4 Sep 2024 10:41:05 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.48]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 96B07195605A; Wed, 4 Sep 2024 10:41:03 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 36/42] tests/functional: Convert ARM bFLT linux-user avocado test Date: Wed, 4 Sep 2024 12:39:11 +0200 Message-ID: <20240904103923.451847-37-thuth@redhat.com> In-Reply-To: <20240904103923.451847-1-thuth@redhat.com> References: <20240904103923.451847-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 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, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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] Message-ID: <20240830133841.142644-39-thuth@redhat.com> 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 35c4bad23f..cda89c4b0c 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -44,6 +44,10 @@ tests_arm_system_thorough = [ 'arm_integratorcp', ] +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 Wed Sep 4 10:39:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 825308 Delivered-To: patch@linaro.org Received: by 2002:adf:e246:0:b0:367:895a:4699 with SMTP id bl6csp99475wrb; Wed, 4 Sep 2024 03:46:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWx0+VqFb7KKzkrltci8CAH5dy/vxcL4wS2DvmhOz08zQzZL/P4aoBmKJVXn2ZukyWMU7uDHw==@linaro.org X-Google-Smtp-Source: AGHT+IEp21KAnc87BZ8Uev8mNZDLaLmPAn/TMTQXye0Kc0e6VDBWR1CWkJxoUAhZQgr+1COdE4ed X-Received: by 2002:a05:622a:5c89:b0:456:4615:3718 with SMTP id d75a77b69052e-4567f6d6a00mr262274781cf.55.1725446773513; Wed, 04 Sep 2024 03:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725446773; cv=none; d=google.com; s=arc-20160816; b=gpLHqucI+If9IeKlbVLKrukArPMT+StlrzNOQpdOKQ8Qaos157noFFqEGKrmGGNVT9 EbtOJZpmSA/odYbceC3VCeUsbLglIzXbFEsv5prva79kBZ+Yx/QwUvcKEMTUsgMJA92R eqLyNQHteoXTemmlCGUeTAOaGnjnBpgiSaVS3A6X92VUxnJibMFz7rpIHuQYVp9QwHQ7 nlPxE8udN15YDe+zlsiZQeOpKrRylPJfZJHcAKc751lwz/4WVJhxAYq8UFrD6TfrFFYq 045iY6cJDFfhp7u3zXaCfMVXI0iWPqcC1MdbDmpbG8J3JRbG8WW276z6GV9PdVADdDzi ybfQ== 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=q+JbqVJUyDkMbxuDOXndQJEBnHIuZp9u4q8ONLAX6eU=; fh=GA6tJk/WKXFNHREIjl3CVQtm7xJ+c0jqwR7aN/BFkLY=; b=ELwMhawnzx6+ZWOHxYpSpatuvU/qrxziRh/r6VMYQGUoDrTcmnZ8iTq2F9ah/I4c+j Wdnc0q3x3XTTxu/COUE2cW7uiKy1IB81eM/eUZw4heaw0QLkEq95x9lFzs+OrtoSjWAF wI/Sop14ujYQqVhBrWPkgAZA+vzqbFYfK7Yih0Z4Onvf9USmGV0w290QkEKmRfd0q4Wb NxTdpL6u/o5RSHj38LkTvpHoLUok4CsniaiD138IwRQwenIPxkX/3OQZvY3wComKoxp+ LtCmfeHOT9pKCkKWF2Zy8YuNFfbfsmHiEj4wi/poe5odqFSGCsxmUSsBldEqbX6OvNf7 NA9A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b5myingN; 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-45682e03df6si136726231cf.666.2024.09.04.03.46.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2024 03:46:13 -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=b5myingN; 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 1slnRs-0007y8-Cu; Wed, 04 Sep 2024 06:41:16 -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 1slnRp-0007hD-PE for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:14 -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 1slnRn-0000Vc-3r for qemu-devel@nongnu.org; Wed, 04 Sep 2024 06:41:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725446470; 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=q+JbqVJUyDkMbxuDOXndQJEBnHIuZp9u4q8ONLAX6eU=; b=b5myingNqMgXd9Rfdqgbj2iHR5NImGUXCO681ewf32wK04GPcuWHb078DhLZ3Hj67Y33Bb sh1HKBWUdeUW7m8bG+tq9khV9pFwfXq18iNg1Mub63yHH5uSwthKNBMylp9Oxy/A3h0W9I naY98Rbrv5D0W+DeLJIAeHU8kjpd128= 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-434-NoXeh1SFOxG4twpi9MGBGw-1; Wed, 04 Sep 2024 06:41:09 -0400 X-MC-Unique: NoXeh1SFOxG4twpi9MGBGw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 3A19B195C272; Wed, 4 Sep 2024 10:41:08 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.194.48]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B16801955F44; Wed, 4 Sep 2024 10:41:05 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Richard Henderson , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 37/42] tests/avocado: Remove unused QemuUserTest class Date: Wed, 4 Sep 2024 12:39:12 +0200 Message-ID: <20240904103923.451847-38-thuth@redhat.com> In-Reply-To: <20240904103923.451847-1-thuth@redhat.com> References: <20240904103923.451847-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 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, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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> Reviewed-by: Thomas Huth Message-ID: <20240830133841.142644-40-thuth@redhat.com> 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."""