From nobody Tue May 7 14:27:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561457894; cv=none; d=zoho.com; s=zohoarc; b=finQGNdi6UAfwXUfCezesx4BYisM7ZuA0lNToKvDXU9MfgACDFt7v+iNsJQxY2LOLiFBbksr9cH9zgpkyOYb6vQsL5sff8kPKlH/ez4hMaEcZnqI3H+ZcT7oovn0qH8Kla4KK/Svdq1+cTW8+oItVcqFj0+TC9J5JaJDm/jDuIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561457894; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=YmkoBkvtf1F9HHne6ve11AVzF75xQZ4SjF1yjIm6T/4=; b=bTfWohni5myQgtCXgowZb5nsyRUZaoSzbQFy8cc0et/d316getAd4iEqUrEtnG7WfLMc1ZGzFSmuHJBHaMsv4MSMNDkh3CK74v30P345g9Sn2DlVianHO3O6WpFc1fDO5tHSgcZPOOO4vJb1herBXxygJdEOTJsQ57REQVN+Tu0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561457894771969.1675016908927; Tue, 25 Jun 2019 03:18:14 -0700 (PDT) Received: from localhost ([::1]:58336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiWf-00072A-CH for importer@patchew.org; Tue, 25 Jun 2019 06:18:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33996) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiUj-0005oT-1u for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfiUg-0007OD-9E for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35646) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfiUe-000789-VR for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1899F30820EA; Tue, 25 Jun 2019 10:15:46 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB50C5B68D; Tue, 25 Jun 2019 10:15:41 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 12:15:20 +0200 Message-Id: <20190625101524.13447-2-philmd@redhat.com> In-Reply-To: <20190625101524.13447-1-philmd@redhat.com> References: <20190625101524.13447-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 25 Jun 2019 10:15:49 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/5] tests/acceptance: Rename avocado_qemu.Test as MachineTest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Maxime Coquelin , Alistair Francis , Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This class is used to test QEMU machines, rename it as MachineTest. This will allow us to add a UserTest class for qemu-user tests. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- docs/devel/testing.rst | 8 ++++---- tests/acceptance/avocado_qemu/__init__.py | 7 ++++++- tests/acceptance/boot_linux_console.py | 4 ++-- tests/acceptance/cpu_queries.py | 4 ++-- tests/acceptance/empty_cpu_model.py | 4 ++-- tests/acceptance/linux_initrd.py | 4 ++-- tests/acceptance/linux_ssh_mips_malta.py | 4 ++-- tests/acceptance/migration.py | 4 ++-- tests/acceptance/version.py | 4 ++-- tests/acceptance/virtio_version.py | 4 ++-- tests/acceptance/vnc.py | 4 ++-- 11 files changed, 28 insertions(+), 23 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index da2d0fc964..5b911e153d 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -599,7 +599,7 @@ class. Here's a simple usage example: from avocado_qemu import Test =20 =20 - class Version(Test): + class Version(MachineTest): """ :avocado: tags=3Dquick """ @@ -623,7 +623,7 @@ in the current directory, tagged as "quick", run: =20 avocado run -t quick . =20 -The ``avocado_qemu.Test`` base test class +The ``avocado_qemu.MachineTest`` base test class ----------------------------------------- =20 The ``avocado_qemu.Test`` class has a number of characteristics that @@ -644,10 +644,10 @@ and hypothetical example follows: =20 .. code:: =20 - from avocado_qemu import Test + from avocado_qemu import MachineTest =20 =20 - class MultipleMachines(Test): + class MultipleMachines(MachineTest): """ :avocado: enable """ diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 2b236a1cf0..84fe090458 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -52,7 +52,6 @@ def pick_default_qemu_bin(arch=3DNone): =20 class Test(avocado.Test): def setUp(self): - self._vms =3D {} arches =3D self.tags.get('arch', []) if len(arches) =3D=3D 1: arch =3D arches.pop() @@ -65,6 +64,12 @@ class Test(avocado.Test): if self.qemu_bin is None: self.cancel("No QEMU binary defined or found in the source tre= e") =20 + +class MachineTest(Test): + def setUp(self): + self._vms =3D {} + super().setUp() + def _new_vm(self, *args): vm =3D QEMUMachine(self.qemu_bin) if args: diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot= _linux_console.py index 32159503e9..1a7b378413 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -14,12 +14,12 @@ import lzma import gzip import shutil =20 -from avocado_qemu import Test +from avocado_qemu import MachineTest from avocado.utils import process from avocado.utils import archive =20 =20 -class BootLinuxConsole(Test): +class BootLinuxConsole(MachineTest): """ Boots a Linux kernel and checks that the console is operational and the kernel command line is properly passed from QEMU to the kernel diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries= .py index e71edec39f..30f545fe48 100644 --- a/tests/acceptance/cpu_queries.py +++ b/tests/acceptance/cpu_queries.py @@ -10,9 +10,9 @@ =20 import logging =20 -from avocado_qemu import Test +from avocado_qemu import MachineTest =20 -class QueryCPUModelExpansion(Test): +class QueryCPUModelExpansion(MachineTest): """ Run query-cpu-model-expansion for each CPU model, and validate results """ diff --git a/tests/acceptance/empty_cpu_model.py b/tests/acceptance/empty_c= pu_model.py index 3f4f663582..a4e9cc62f8 100644 --- a/tests/acceptance/empty_cpu_model.py +++ b/tests/acceptance/empty_cpu_model.py @@ -8,9 +8,9 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. import subprocess -from avocado_qemu import Test +from avocado_qemu import MachineTest =20 -class EmptyCPUModel(Test): +class EmptyCPUModel(MachineTest): def test(self): cmd =3D [self.qemu_bin, '-S', '-display', 'none', '-machine', 'non= e', '-cpu', ''] r =3D subprocess.run(cmd, stderr=3Dsubprocess.PIPE, stdout=3Dsubpr= ocess.PIPE) diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_init= rd.py index 23be5a63aa..b9b2d3dab1 100644 --- a/tests/acceptance/linux_initrd.py +++ b/tests/acceptance/linux_initrd.py @@ -12,10 +12,10 @@ import logging import tempfile from avocado.utils.process import run =20 -from avocado_qemu import Test +from avocado_qemu import MachineTest =20 =20 -class LinuxInitrd(Test): +class LinuxInitrd(MachineTest): """ Checks QEMU evaluates correctly the initrd file passed as -initrd opti= on. =20 diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index aafb0c39f6..8451d05f7c 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -13,12 +13,12 @@ import paramiko import time =20 from avocado import skipIf -from avocado_qemu import Test +from avocado_qemu import MachineTest from avocado.utils import process from avocado.utils import archive =20 =20 -class LinuxSSH(Test): +class LinuxSSH(MachineTest): =20 timeout =3D 150 # Not for 'configure --enable-debug --enable-debug-tcg' =20 diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py index 6115cf6c24..7fdb717628 100644 --- a/tests/acceptance/migration.py +++ b/tests/acceptance/migration.py @@ -10,13 +10,13 @@ # later. See the COPYING file in the top-level directory. =20 =20 -from avocado_qemu import Test +from avocado_qemu import MachineTest =20 from avocado.utils import network from avocado.utils import wait =20 =20 -class Migration(Test): +class Migration(MachineTest): """ :avocado: enable """ diff --git a/tests/acceptance/version.py b/tests/acceptance/version.py index 67c2192c93..e11661f780 100644 --- a/tests/acceptance/version.py +++ b/tests/acceptance/version.py @@ -9,10 +9,10 @@ # later. See the COPYING file in the top-level directory. =20 =20 -from avocado_qemu import Test +from avocado_qemu import MachineTest =20 =20 -class Version(Test): +class Version(MachineTest): """ :avocado: tags=3Dquick """ diff --git a/tests/acceptance/virtio_version.py b/tests/acceptance/virtio_v= ersion.py index 8b97453ff8..04c68e41e6 100644 --- a/tests/acceptance/virtio_version.py +++ b/tests/acceptance/virtio_version.py @@ -13,7 +13,7 @@ import os =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu import QEMUMachine -from avocado_qemu import Test +from avocado_qemu import MachineTest =20 # Virtio Device IDs: VIRTIO_NET =3D 1 @@ -55,7 +55,7 @@ def get_pci_interfaces(vm, devtype): interfaces =3D ('pci-express-device', 'conventional-pci-device') return [i for i in interfaces if devtype_implements(vm, devtype, i)] =20 -class VirtioVersionCheck(Test): +class VirtioVersionCheck(MachineTest): """ Check if virtio-version-specific device types result in the same device tree created by `disable-modern` and diff --git a/tests/acceptance/vnc.py b/tests/acceptance/vnc.py index 064ceabcc1..2c532dab5e 100644 --- a/tests/acceptance/vnc.py +++ b/tests/acceptance/vnc.py @@ -8,10 +8,10 @@ # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. =20 -from avocado_qemu import Test +from avocado_qemu import MachineTest =20 =20 -class Vnc(Test): +class Vnc(MachineTest): """ :avocado: tags=3Dvnc,quick """ --=20 2.20.1 From nobody Tue May 7 14:27:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561458119; cv=none; d=zoho.com; s=zohoarc; b=TLhjfy+dHBicdtbzlcThzuohnqyHbl3Dw5umguA4mrNuvpI7qs+PEY98kqSPHYv3/aha23NmIV2zkyMCUGd6IbfFRTuN23gWEX/t2XOLPm/lnByDAHdDLtqqbkPOuXzA/gC14p1/sbLq2F5jtZUnnvsn0SZfVXTQ3hd0Nphhsls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561458119; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gAhqM061kkO8R8YV+oMaBg6uZvAfoyorgxcC8DacCCo=; b=G/Tf8boV9TjWTGnRrrETq0PNlHVWuAA6azUcGruWr0mn6qLXfgqi13DJPhb2WypDAYuBOnJ7phi/9pmJP5H4D90ibpirhLYltJ5HmhclyYdPT+E+f45oJ2ahZa5yA+z9zRX5iYIV+HwJTy2iTxZMO0VMdHyLppUldIBiTmTnEZ8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561458119584593.0502794568615; Tue, 25 Jun 2019 03:21:59 -0700 (PDT) Received: from localhost ([::1]:58370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiaM-0001vF-H8 for importer@patchew.org; Tue, 25 Jun 2019 06:21:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34071) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiUp-0005qy-7u for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfiUn-0007Vc-JI for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50970) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfiUn-0007A3-BV for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 675803086262; Tue, 25 Jun 2019 10:15:51 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 903BB5D717; Tue, 25 Jun 2019 10:15:46 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 12:15:21 +0200 Message-Id: <20190625101524.13447-3-philmd@redhat.com> In-Reply-To: <20190625101524.13447-1-philmd@redhat.com> References: <20190625101524.13447-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 25 Jun 2019 10:15:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/5] tests/acceptance: Make pick_default_qemu_bin() more generic X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Maxime Coquelin , Alistair Francis , Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Make pick_default_qemu_bin() generic to find qemu-system or qemu-user binaries. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/avocado_qemu/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 84fe090458..6785c7399e 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -23,7 +23,7 @@ def is_readable_executable_file(path): return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK) =20 =20 -def pick_default_qemu_bin(arch=3DNone): +def pick_default_qemu_bin(path_fmt, bin_fmt, arch=3DNone): """ Picks the path of a QEMU binary, starting either in the current working directory or in the source tree root directory. @@ -39,8 +39,7 @@ def pick_default_qemu_bin(arch=3DNone): """ if arch is None: arch =3D os.uname()[4] - qemu_bin_relative_path =3D os.path.join("%s-softmmu" % arch, - "qemu-system-%s" % arch) + qemu_bin_relative_path =3D os.path.join(path_fmt % arch, bin_fmt % arc= h) if is_readable_executable_file(qemu_bin_relative_path): return qemu_bin_relative_path =20 @@ -51,14 +50,15 @@ def pick_default_qemu_bin(arch=3DNone): =20 =20 class Test(avocado.Test): - def setUp(self): + def base_setUp(self, path_fmt, bin_fmt): arches =3D self.tags.get('arch', []) if len(arches) =3D=3D 1: arch =3D arches.pop() else: arch =3D None self.arch =3D self.params.get('arch', default=3Darch) - default_qemu_bin =3D pick_default_qemu_bin(arch=3Dself.arch) + default_qemu_bin =3D pick_default_qemu_bin(path_fmt, bin_fmt, + arch=3Dself.arch) self.qemu_bin =3D self.params.get('qemu_bin', default=3Ddefault_qemu_bin) if self.qemu_bin is None: @@ -68,7 +68,7 @@ class Test(avocado.Test): class MachineTest(Test): def setUp(self): self._vms =3D {} - super().setUp() + self.base_setUp("%s-softmmu", "qemu-system-%s") =20 def _new_vm(self, *args): vm =3D QEMUMachine(self.qemu_bin) --=20 2.20.1 From nobody Tue May 7 14:27:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561457899; cv=none; d=zoho.com; s=zohoarc; b=Q42SHZeIA3KPARaFyPkzrNNzXUwDt301KB8DAgAW1RN38yxxVsEnyuWgvlySiKLpVfTDXlWfB+sO+a/RLJVkaOhQqYUd66cKJTXJRZ+gZ6uZHmZF18EEX3l0Ez/sMWCP0M1bjg3RhSfrvhuMF/bf8C3pDsM6j0jTMpT4SjS+KIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561457899; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=k/ANvfh9Waa/XhaQ3c8ScRgFs+rUUyh9PdHaGe1gCS0=; b=LJ8Of0lf0qqq58rMimuEbIRTYUGJd35CLTtdAGSI6+tW9QPWs4l9c/Kago5OH5wsViEbcnP/2lVhxS3ufuH9kNo/dPqGsu6KFoBjHDQqvQHX0WnXrYhFVfzauTpVcxhHpx0V9UskZZYFfPNy7QDohrdnr/DMX1mjF8UAVDpkR3E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561457899481458.4851215094127; Tue, 25 Jun 2019 03:18:19 -0700 (PDT) Received: from localhost ([::1]:58338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiWj-00079u-DR for importer@patchew.org; Tue, 25 Jun 2019 06:18:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34063) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiUo-0005qc-Pt for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfiUn-0007V6-96 for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfiUn-0007Fn-2y for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1B12281DE9; Tue, 25 Jun 2019 10:15:59 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2108B5D70D; Tue, 25 Jun 2019 10:15:51 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 12:15:22 +0200 Message-Id: <20190625101524.13447-4-philmd@redhat.com> In-Reply-To: <20190625101524.13447-1-philmd@redhat.com> References: <20190625101524.13447-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Jun 2019 10:15:59 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/5] tests/acceptance: Introduce LinuxUserTest base class X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Maxime Coquelin , Alistair Francis , Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Similarly to the MachineTest base class, this class contains methods common to linux-user tests. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/avocado_qemu/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 6785c7399e..0a9277c991 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -13,6 +13,7 @@ import sys import uuid =20 import avocado +from avocado.utils import process =20 SRC_ROOT_DIR =3D os.path.join(os.path.dirname(__file__), '..', '..', '..') sys.path.append(os.path.join(SRC_ROOT_DIR, 'python')) @@ -90,3 +91,11 @@ class MachineTest(Test): def tearDown(self): for vm in self._vms.values(): vm.shutdown() + + +class LinuxUserTest(Test): + def setUp(self): + self.base_setUp("%s-linux-user", "qemu-%s") + + def run(self, cmd): + return process.run("%s %s" % (self.qemu_bin, cmd)) --=20 2.20.1 From nobody Tue May 7 14:27:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561457903; cv=none; d=zoho.com; s=zohoarc; b=AYh8g1aNK1z107o1HDoLADL3uskZUBzEGwLZryqyuFBiMrcQoUxzA6itZ0p5PLIdhttmxqAMV+F1YL3BZqf3XwW1jLbWyEOXbocljcuvQek0PCT7nFqtDhaoYpPeqmTGO/hGQbTTByTBXNJAbdkhLMRX2szgeO3Z2Y1o44F8LMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561457903; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=P39zpIvutfO5e5Xq1apPys0kzPfHHTPCd1hOP/+4it4=; b=Hf+zsQ3QOeX0Oj64UU586SnNkwDqLdLquMGgbrwTt36U7KOxmGs3qLdZPB4gPQWRkFiXqcfhd/7OLtSnwIgk22vdCFRmS+dOiZffdSQFrlKjsM0XW94ix02RhXjGZ0eBM3TChqaEeAW4k0I74YtK4Bjby/7LOBGvWfOu1HLdFak= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561457903665380.27259531056654; Tue, 25 Jun 2019 03:18:23 -0700 (PDT) Received: from localhost ([::1]:58342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiWk-0007Ck-JE for importer@patchew.org; Tue, 25 Jun 2019 06:18:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34076) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiUp-0005r7-E4 for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfiUn-0007Vh-Jz for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53504) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfiUn-0007KI-BQ for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 77F8F2F8BDF; Tue, 25 Jun 2019 10:16:02 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94FE05B68D; Tue, 25 Jun 2019 10:15:59 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 12:15:23 +0200 Message-Id: <20190625101524.13447-5-philmd@redhat.com> In-Reply-To: <20190625101524.13447-1-philmd@redhat.com> References: <20190625101524.13447-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 25 Jun 2019 10:16:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/5] tests/acceptance: Add bFLT loader linux-user test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Maxime Coquelin , Alistair Francis , Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Add a very quick test that runs a busybox binary in bFLT format: $ avocado --show=3Dapp run tests/acceptance/load_bflt.py JOB ID : db94d5960ce564c50904d666a7e259148c27e88f JOB LOG : ~/avocado/job-results/job-2019-06-25T10.52-db94d59/job.log (1/1) tests/acceptance/load_bflt.py:LoadBFLT.test_stm32: PASS (0.15 s) RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | = CANCEL 0 JOB TIME : 0.54 s Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- This test currently fails on Aarch64 host, see LP#1833668 https://bugs.launchpad.net/qemu/+bug/1833668 --- tests/acceptance/load_bflt.py | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/acceptance/load_bflt.py diff --git a/tests/acceptance/load_bflt.py b/tests/acceptance/load_bflt.py new file mode 100644 index 0000000000..fdcaf8ad88 --- /dev/null +++ b/tests/acceptance/load_bflt.py @@ -0,0 +1,52 @@ +# Test the bFLT format +# +# Copyright (C) 2019 Philippe Mathieu-Daud=C3=A9 +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import bz2 +import subprocess + +from avocado_qemu import LinuxUserTest + + +class LoadBFLT(LinuxUserTest): + + def extract_cpio(self, cpio_path): + """ + Extracts a cpio archive into the test workdir + + :param cpio_path: path to the cpio archive + """ + cwd =3D os.getcwd() + os.chdir(self.workdir) + with bz2.open(cpio_path, 'rb') as archive_cpio: + subprocess.run(['cpio', '-i'], input=3Darchive_cpio.read(), + stderr=3Dsubprocess.DEVNULL) + os.chdir(cwd) + + def test_stm32(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Dlinux_user + :avocado: tags=3Dquick + """ + # See https://elinux.org/STM32#User_Space + rootfs_url =3D ('https://elinux.org/images/5/51/' + 'Stm32_mini_rootfs.cpio.bz2') + rootfs_hash =3D '9f065e6ba40cce7411ba757f924f30fcc57951e6' + rootfs_path_bz2 =3D self.fetch_asset(rootfs_url, asset_hash=3Droot= fs_hash) + busybox_path =3D self.workdir + "/bin/busybox" + + self.extract_cpio(rootfs_path_bz2) + + cmd =3D '' + res =3D self.run("%s %s" % (busybox_path, cmd)) + ver =3D 'BusyBox v1.24.0.git (2015-02-03 22:17:13 CET) multi-call = binary.' + self.assertIn(ver, res.stdout_text) + + cmd =3D 'uname -a' + res =3D self.run("%s %s" % (busybox_path, cmd)) + unm =3D 'armv7l GNU/Linux' + self.assertIn(unm, res.stdout_text) --=20 2.20.1 From nobody Tue May 7 14:27:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561458259; cv=none; d=zoho.com; s=zohoarc; b=FUnDfrfoIB+yCmQzdbLDxOL8tuwaoEk7yKCbshELx7+asE6VTJRno8fOYEuNicdwLYM1Uw+gGsz0COyL4USHBDV4u0k0Se13g6VI+Lbjcauer6CPAHvZDdoI/saMuhOs/oa59u++bqQKezLe68/dU2dp1/2srlPmAyg35gXVB5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561458259; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=99vvvvmq+ohFbreFx1LjLtFwk7p171CslydxGWWu0zI=; b=VQD1GewIPr1Qey7xhhxFUkoc9FWaJJhGSqk6I6KdeX+hFNB7FwyV4l84xMNCld2uenyEBKGIGe99VyJmum8r8tgRLyxd+YTnts+YIzKEhpc8NvKWqNGgGwfAaSjteWqmGRKS4Crex58AFCY2clmx3b43od/76WJtzkOC2HwZGLM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561458259737818.6986034712694; Tue, 25 Jun 2019 03:24:19 -0700 (PDT) Received: from localhost ([::1]:58418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hficY-0005Dg-PR for importer@patchew.org; Tue, 25 Jun 2019 06:24:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34067) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfiUp-0005ql-0y for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfiUn-0007VQ-G5 for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38644) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfiUn-0007UH-8S for qemu-devel@nongnu.org; Tue, 25 Jun 2019 06:16:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA4DE3091851; Tue, 25 Jun 2019 10:16:09 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3C7D5B68D; Tue, 25 Jun 2019 10:16:02 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 12:15:24 +0200 Message-Id: <20190625101524.13447-6-philmd@redhat.com> In-Reply-To: <20190625101524.13447-1-philmd@redhat.com> References: <20190625101524.13447-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 25 Jun 2019 10:16:12 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 5/5] .travis.yml: Let the avocado job run linux-user tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Maxime Coquelin , Alistair Francis , Cleber Rosa , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index aeb9b211cd..2ece761ac7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -231,7 +231,7 @@ matrix: =20 # Acceptance (Functional) tests - env: - - CONFIG=3D"--python=3D/usr/bin/python3 --target-list=3Dx86_64-sof= tmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmm= u,alpha-softmmu" + - CONFIG=3D"--python=3D/usr/bin/python3 --target-list=3Dx86_64-sof= tmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmm= u,alpha-softmmu,arm-linux-user" - TEST_CMD=3D"make check-acceptance" after_failure: - cat tests/results/latest/job.log --=20 2.20.1