From nobody Mon Feb 9 09:46:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) client-ip=209.85.128.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632760285; cv=none; d=zohomail.com; s=zohoarc; b=chU1s636H/CTpgWoTxtwlkmZwPyxOy4ZcwV4+ITV9Zdm2y0kBFfui9yOOwzPBJLqw2T90QDYoC15U7gg8pB7AUpiUa7GpR+7hBSDc72AtGSSKf6xxN6Y/nswEUE2744UsLNx5N8WJo05pSPOKDA3a6ANfkeF06/kIwCNK1xEa1A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632760285; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OTf5iqe9z+S4b3dbtYhCloYbfDKwbKuQuHUgKiVeRVM=; b=TDKhlbVJ6seynRlWFx5MqEFn+RiOTshQTvZLplMofhXNihwwyoZncvYgZ6rRUi+SVrOXLRpJ5tUPadU71dwjxcG2WfIPnkbf+KB/6IUJjbwYttZnyk9uUvHTUY8yHotq6QCkajEyVpB4ICxF4/Y2zTK1QmQo5eNORZNu9wNRXJk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.zohomail.com with SMTPS id 1632760285614156.5473042229646; Mon, 27 Sep 2021 09:31:25 -0700 (PDT) Received: by mail-wm1-f41.google.com with SMTP id 205-20020a1c01d6000000b0030cd17ffcf8so1113505wmb.3 for ; Mon, 27 Sep 2021 09:31:25 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id s2sm16702131wrn.77.2021.09.27.09.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 09:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OTf5iqe9z+S4b3dbtYhCloYbfDKwbKuQuHUgKiVeRVM=; b=lGc4yxMd9oe4PrrXyMD2bPLKRXs60FtqmhJw952515zugPAJWmKmBl3mwDTxtM6zJL lcXFWywidu3auFFn98Wo/Y8zcuxB+qtX6gEWbca44LQ1zCI1lDbDWo2VX2p5LCEyEMoI eZXmpoPxTEH5lVNqrkXa32rqNSekMu+p3HoU3YihEVPqYAseLpNlSdm+oaM2azinR6sY 1ae6LmRzeY++QKU2HdWaeIkh3iikj+WvTvi/Wo7joheGfyZSSk79ezX/BofjqnjF+VYr gFPehN/8zK0PC7u1pIbWQRvMC61jFK/FdKj7cKvgWrmoKXL/tjEpH1dOUzDd4DESUhvg +3yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OTf5iqe9z+S4b3dbtYhCloYbfDKwbKuQuHUgKiVeRVM=; b=BTy+HIBzRTDmVrbDn6nuR3VDecrw2pFovRCx4SwrGNpyMLxVqC7YBfPhLHl7EjVx0O d5DgAm9YHbesZgcVvPo6hbliVinrZw83XueftyQPv6wLML3mhjScBQil7lYxA580obng Yve9ZPP93tqX2PiiqzB0KYa0YJHKx6LUz4EjQ1RWMqsV4roti5cR+Pxxk1TGCoz/sou0 LSzzbJEslIEh1tGfVTtzQ3zp/uiUoX0IuprB5VSCL1IqCQxgj+TolRlwrnFBb7iZyRGl x70zcIQyh1KLhM+09M/JZ8642GitwGUsqePSFJoibFx4qJIurYoyAxP5BV6AfcCcycxa QIag== X-Gm-Message-State: AOAM531VzN2cDOGDmKbajob23UZbrRGLuLy0LfIbFDdXGPRV5XmT7Ta7 bez4A8uKYnXvyoMyT42DjzM= X-Google-Smtp-Source: ABdhPJxU4m7VWUjrRt9R41o+xLGscQudGT7aHfwZSs/AsiL5Z7fHQtURKR+aYH6FdXFkR7Id4ZloBw== X-Received: by 2002:a7b:ce19:: with SMTP id m25mr831051wmc.152.1632760283800; Mon, 27 Sep 2021 09:31:23 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Willian Rampazzo , Laurent Vivier , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 1/6] tests/acceptance: Extract QemuBaseTest from Test Date: Mon, 27 Sep 2021 18:31:11 +0200 Message-Id: <20210927163116.1998349-2-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210927163116.1998349-1-f4bug@amsat.org> References: <20210927163116.1998349-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1632760287783100001 The Avocado Test::fetch_asset() is handy to download artifacts before running tests. The current class is named Test but only tests system emulation. As we want to test user emulation, refactor the common code as QemuBaseTest. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 72 +++++++++++++---------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 2c4fef3e149..8fcbed74849 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -175,7 +175,7 @@ def exec_command_and_wait_for_pattern(test, command, """ _console_interaction(test, success_message, failure_message, command += '\r') =20 -class Test(avocado.Test): +class QemuBaseTest(avocado.Test): def _get_unique_tag_val(self, tag_name): """ Gets a tag value, if unique for a key @@ -185,6 +185,46 @@ def _get_unique_tag_val(self, tag_name): return vals.pop() return None =20 + def setUp(self): + self.arch =3D self.params.get('arch', + default=3Dself._get_unique_tag_val('ar= ch')) + + self.cpu =3D self.params.get('cpu', + default=3Dself._get_unique_tag_val('cpu= ')) + + default_qemu_bin =3D pick_default_qemu_bin(arch=3Dself.arch) + self.qemu_bin =3D self.params.get('qemu_bin', + default=3Ddefault_qemu_bin) + if self.qemu_bin is None: + self.cancel("No QEMU binary defined or found in the build tree= ") + + def fetch_asset(self, name, + asset_hash=3DNone, algorithm=3DNone, + locations=3DNone, expire=3DNone, + find_only=3DFalse, cancel_on_missing=3DTrue): + return super(QemuBaseTest, self).fetch_asset(name, + asset_hash=3Dasset_hash, + algorithm=3Dalgorithm, + locations=3Dlocations, + expire=3Dexpire, + find_only=3Dfind_only, + cancel_on_missing=3Dcancel_on_missing) + + +class Test(QemuBaseTest): + """Facilitates system emulation tests. + + TODO: Rename this class as `QemuSystemTest`. + """ + + def setUp(self): + self._vms =3D {} + + super(Test, self).setUp() + + self.machine =3D self.params.get('machine', + default=3Dself._get_unique_tag_val(= 'machine')) + def require_accelerator(self, accelerator): """ Requires an accelerator to be available for the test to continue @@ -207,24 +247,6 @@ def require_accelerator(self, accelerator): self.cancel("%s accelerator does not seem to be " "available" % accelerator) =20 - def setUp(self): - self._vms =3D {} - - self.arch =3D self.params.get('arch', - default=3Dself._get_unique_tag_val('ar= ch')) - - self.cpu =3D self.params.get('cpu', - default=3Dself._get_unique_tag_val('cpu= ')) - - self.machine =3D self.params.get('machine', - default=3Dself._get_unique_tag_val(= 'machine')) - - default_qemu_bin =3D pick_default_qemu_bin(arch=3Dself.arch) - self.qemu_bin =3D self.params.get('qemu_bin', - default=3Ddefault_qemu_bin) - if self.qemu_bin is None: - self.cancel("No QEMU binary defined or found in the build tree= ") - def _new_vm(self, name, *args): self._sd =3D tempfile.TemporaryDirectory(prefix=3D"avo_qemu_sock_") vm =3D QEMUMachine(self.qemu_bin, base_temp_dir=3Dself.workdir, @@ -277,18 +299,6 @@ def tearDown(self): vm.shutdown() self._sd =3D None =20 - def fetch_asset(self, name, - asset_hash=3DNone, algorithm=3DNone, - locations=3DNone, expire=3DNone, - find_only=3DFalse, cancel_on_missing=3DTrue): - return super(Test, self).fetch_asset(name, - asset_hash=3Dasset_hash, - algorithm=3Dalgorithm, - locations=3Dlocations, - expire=3Dexpire, - find_only=3Dfind_only, - cancel_on_missing=3Dcancel_on_missing) - =20 class LinuxSSHMixIn: """Contains utility methods for interacting with a guest via SSH.""" --=20 2.31.1 From nobody Mon Feb 9 09:46:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632760290; cv=none; d=zohomail.com; s=zohoarc; b=IZvsvRcB4D6YrBFc+XcAc9fw2+uyMReBHNSiXh8L3/aL+Ex0xfaPpjDuatYlPJic+AOSBSM7ptXkAXZh8sA2B2G3ZZAzIU3FUIzXd3xZNzPv9MlDypbYXPNAyB8flLtRRihOkL7qq2+FsRYlpWEhBjibIp0tYpBWVxyBXUiPzo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632760290; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T1aPkKUrc80d/vqmLgc+PWq3pe5Uicwcn8ttvXrLTeU=; b=IU/DGMLqPbJH8h0Le118y1By5VRszK79tTkrB0IEElAsZb+UM/XzrIaADhWf5EyrLPWbHyVDnV+MD5gSVXociEDnrHx7BznfWDNgStyiDFyje7jqbU9/tdKr/yfYNmK6NWSXiYldB52hPa0N3X1DAg7f7/dwAkCkFUuIq+2Xkds= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1632760290247385.351753342046; Mon, 27 Sep 2021 09:31:30 -0700 (PDT) Received: by mail-wm1-f43.google.com with SMTP id c73-20020a1c9a4c000000b0030d040bb895so447274wme.2 for ; Mon, 27 Sep 2021 09:31:29 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id x5sm21242438wmk.32.2021.09.27.09.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 09:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T1aPkKUrc80d/vqmLgc+PWq3pe5Uicwcn8ttvXrLTeU=; b=FOnqWgbOkCQhcjkwn4FfWDxoBTEJ5m8sWco68AWUOC1dlk0SpdZ2A72Edkr2cuXkkh MWhliyTacJr28U3b2RCWEMcBhuOSDK770spxZyPUgUDDVn9sWLmubYGGZhC8bQAk//Wc NdUl028xnLXZMSxsIIq5lu/YRjsIkTaF7rjpb0AxCkQeFLSUE2rxd90bgrG041HJjHQf 1i0oJYx5jyZPM4OA/zMf+uNgL8j6tjRfjM3SYGKupGwXp1fZcfBwnNEVzt5ntKcVzOqp 20nSS+caITlgo5AYDiP2yNsLj3XzQ7hn+AA0gaKC92p+SQyyGAzYZGSMCypA2PBzDbQv yj3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=T1aPkKUrc80d/vqmLgc+PWq3pe5Uicwcn8ttvXrLTeU=; b=x3bbFmtPDTZgqrNeW7g6DEWEgJGqdua1Wef8TPp7APUoQtdsMFzQhbSnud6bcLfmdx 1Efs/5gZBk3ePF/xubvBlnNqP8tRS3HQH8GU8Qs7I44M8Oh/A/JOvs9oMEbUeKGvcNFa LyCDMF5dJur5EJxrbEFnfq2WhadtVL7VWE2ZjpIIceAQhO0ZLJn/LLeDQdcTNyF6Himr U/c+72dmQ6NeZDHxCoEFlxn9e6zbObL+8tRY49XJwRqlt674mO4v/O+wPqQJnILqxX7N 0BJ1RyYYkQGTBo6XNK99bCDNmcbbXQvCe1raSLcQUJCCO+BgfeYOnaKjBG/zD2AGXxMo hYVg== X-Gm-Message-State: AOAM533U9KLNUpZjiIyL27buljIeFnZu+e147BTuJ2GPeI6gJRfTobiN QugkbvozyLqMpXHmKGHO/0g= X-Google-Smtp-Source: ABdhPJznlZqOCkgEMrxGDYaocikq81fxFtsK9xSgVMuM1cqqXK0pAUCgiTLQUq0wzfUVgx7jxDlQng== X-Received: by 2002:a05:600c:350a:: with SMTP id h10mr1827114wmq.163.1632760288483; Mon, 27 Sep 2021 09:31:28 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Willian Rampazzo , Laurent Vivier , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 2/6] tests/acceptance: Make pick_default_qemu_bin() more generic Date: Mon, 27 Sep 2021 18:31:12 +0200 Message-Id: <20210927163116.1998349-3-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210927163116.1998349-1-f4bug@amsat.org> References: <20210927163116.1998349-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1632760291589100001 Make pick_default_qemu_bin() generic to find qemu-system or qemu-user binaries. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 8fcbed74849..2b9b5dd27fe 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -52,7 +52,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(bin_prefix=3D'qemu-system-', arch=3DNone): """ Picks the path of a QEMU binary, starting either in the current working directory or in the source tree root directory. @@ -71,7 +71,7 @@ def pick_default_qemu_bin(arch=3DNone): # qemu binary path does not match arch for powerpc, handle it if 'ppc64le' in arch: arch =3D 'ppc64' - qemu_bin_relative_path =3D "./qemu-system-%s" % arch + qemu_bin_relative_path =3D os.path.join(".", bin_prefix + arch) if is_readable_executable_file(qemu_bin_relative_path): return qemu_bin_relative_path =20 @@ -185,14 +185,14 @@ def _get_unique_tag_val(self, tag_name): return vals.pop() return None =20 - def setUp(self): + def setUp(self, bin_prefix): self.arch =3D self.params.get('arch', default=3Dself._get_unique_tag_val('ar= ch')) =20 self.cpu =3D self.params.get('cpu', default=3Dself._get_unique_tag_val('cpu= ')) =20 - default_qemu_bin =3D pick_default_qemu_bin(arch=3Dself.arch) + default_qemu_bin =3D pick_default_qemu_bin(bin_prefix, arch=3Dself= .arch) self.qemu_bin =3D self.params.get('qemu_bin', default=3Ddefault_qemu_bin) if self.qemu_bin is None: @@ -220,7 +220,7 @@ class Test(QemuBaseTest): def setUp(self): self._vms =3D {} =20 - super(Test, self).setUp() + super(Test, self).setUp('qemu-system-') =20 self.machine =3D self.params.get('machine', default=3Dself._get_unique_tag_val(= 'machine')) --=20 2.31.1 From nobody Mon Feb 9 09:46:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) client-ip=209.85.128.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632760295; cv=none; d=zohomail.com; s=zohoarc; b=eyGprRMy03Yuw4xNhMEtw7hlOQM9y7+Gj0RCtVyeU+2RJlFZAJ8B65vBPC12+KR3ClfjNUpn6yeSm0jIluG2XydC1r9dwKR/d93oWiwxSEZS7bYONG7fGpWjRt69by+VwZI5NKNUgSBLV45QgbSiOY0a/+bGtEFdNn6/j1eGuJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632760295; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rrZcRAqwbX1CgOU4/ghYIXImscGfB+p01+/+JsHL8L4=; b=Tpy5FISIZXsUHnpi8MxPPj3rHbohjwbtawwC2etTrsCpr8MXYu6b2gnAzTVOC45206hvuYKLpHomEoqC9+gqh+WhAdca0kmkxJX4D9qoit83VGCp7wbw9CeMeRgk+lQwHHEbXMi6Y6RuRogjcUw1CXO+QnyDAzxglexZQbQGDhQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.zohomail.com with SMTPS id 1632760295040349.9433433096166; Mon, 27 Sep 2021 09:31:35 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id b192so1019096wmb.2 for ; Mon, 27 Sep 2021 09:31:34 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id t16sm691286wry.0.2021.09.27.09.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 09:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rrZcRAqwbX1CgOU4/ghYIXImscGfB+p01+/+JsHL8L4=; b=fs+6upgVoe/3ZOqqYgzLYXU3AzouMLtbaC8RNg1yGELCQ9F5cp412j8o7Ha2h97kFA r/2kAGriD6Gz81zn2XV5vzhTrtglR1m3muwOtaC/Sm5GC48pfX3sKU1vlS+J6O+h6G+W NE9/MsWQ1khI2t7jgkhNmTWd5o1QcrK93Gm9AxbNQKnbiV9SVAD0zdOX15paesEBnb17 9nx3dPeEuXmBc25Hxurn0+Bipk5l7uq8PNlodqvhLGkA1D9yOdcmF73ZdLnhQDQZqWbv 5F0tRezhvlxIbv28bKiXNV939Z3KsXANMjYghIfcmK/8H8viSiYYQzOTpqfeEM7kkmxt Of/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rrZcRAqwbX1CgOU4/ghYIXImscGfB+p01+/+JsHL8L4=; b=47CGMn4yXChs4WXQ5/og4+/a2FW9Qn32pucWYXkFv/M8FoR8nK2mk2QIvEhsFE2LZ7 p5awTiTF1JdXuyq+0GMh3uFeFglRPF5Gg+/ZAO5n8iPbmhkDhLhkXBoYc8Out7egHHAi MptPUu1NAWH9jZHL7zNvb1f1Upaz0t7RB267YDFsG7HE0IgfjVgvK8D1ezPH4e7G/4Qr bPuFTvDnilyLqfYxNRJKTPpA3vzy6mzJGbYLTCMeV9A1yrIp28aSkhtm3ArXEmMj8EJf 7z4pu+eHsTGUBOOB93A5rIp7SPOPAfXSkICP5oCMa9120LQJZ3PhkkGQ1XVCr2jToLiq 5PtQ== X-Gm-Message-State: AOAM531AGvJ4mCna4Agwa1JKt9Z+hoUl4ZhO/aevS2CjAPgKSqEgm8oa M3eO52XqwlVZ2xX7sX4nND4= X-Google-Smtp-Source: ABdhPJxOLc9mOMQcnGywAfc/RxVO1EwPe5c8xjxKFiJ3u0/3RLS290LuyH8Kd/rIwaYczwRy3+U4yA== X-Received: by 2002:a05:600c:2282:: with SMTP id 2mr3018269wmf.47.1632760293268; Mon, 27 Sep 2021 09:31:33 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Willian Rampazzo , Laurent Vivier , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 3/6] tests/acceptance: Introduce QemuUserTest base class Date: Mon, 27 Sep 2021 18:31:13 +0200 Message-Id: <20210927163116.1998349-4-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210927163116.1998349-1-f4bug@amsat.org> References: <20210927163116.1998349-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1632760296176100001 Similarly to the 'System' Test base class with methods for testing system emulation, the QemuUserTest class contains methods useful to test user-mode emulation. Reviewed-by: Wainer dos Santos Moschetta Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 2b9b5dd27fe..2f59e171e49 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -20,6 +20,7 @@ from avocado.utils import cloudinit from avocado.utils import datadrainer from avocado.utils import network +from avocado.utils import process from avocado.utils import ssh from avocado.utils import vmimage from avocado.utils.path import find_command @@ -300,6 +301,23 @@ def tearDown(self): self._sd =3D None =20 =20 +class QemuUserTest(QemuBaseTest): + """Facilitates user-mode emulation tests.""" + + def setUp(self): + self._ldpath =3D [] + super(QemuUserTest, self).setUp('qemu-') + + def add_ldpath(self, ldpath): + self._ldpath +=3D [os.path.abspath(ldpath)] + + def run(self, bin_path, args=3D[]): + qemu_args =3D " ".join(["-L %s" % ldpath for ldpath in self._ldpat= h]) + bin_args =3D " ".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.""" =20 --=20 2.31.1 From nobody Mon Feb 9 09:46:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) client-ip=209.85.128.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632760300; cv=none; d=zohomail.com; s=zohoarc; b=DlmW1qeoav8kaA6ngUk1k54zMPWzXusld03E2f+HQDlvTbX0gXr1FRPwMswggyiBwG1KQpf9DFMiT2zZG+sbO+9xC2WsTV+kCXx04W8i4QX6XIRXi7qUemrSh6MAWUVWspPOjGB3Zdt8FDbO1KsFTWIrZ7xYGze5sfu67grine0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632760300; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MdnXHTIFHp39KUio8jeORJKWlV1pr/VnQAeVLDGF+MQ=; b=Co31eGr/Np2t/LOgeG1t1G6zGRcOTX58kt9CM6lVYtehuTQSzb/DCSLIagh5SB+EvH1/TDcze31tNsuoHOLho9schDDgHEnFrZz68rr0EFmd3ttNcGYs2THMoqzSNnfY3t6Gs3rgmR4UXxSW8bnnjHNkF4Sn+WzmyGKeDJDuQSc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.zohomail.com with SMTPS id 1632760300066256.4667416859063; Mon, 27 Sep 2021 09:31:40 -0700 (PDT) Received: by mail-wm1-f45.google.com with SMTP id r83-20020a1c4456000000b0030cfc00ca5fso1114754wma.2 for ; Mon, 27 Sep 2021 09:31:39 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id v18sm16746695wml.44.2021.09.27.09.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 09:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MdnXHTIFHp39KUio8jeORJKWlV1pr/VnQAeVLDGF+MQ=; b=B+m4SAM8KZHFquOBqXBM0Byv2k1NUIYLu6O6sKbEc/mWUlaoZ2Ow3Gb5trOJ+TUBPo tydLSSwhwOOUGpaCC2ADJIFCblCJpeCBxszHCa4GelDRQyFDpU6wilmaqVL+PTXc8U8A iJQmtnq7ALTntDo7VT90I2muD2LxFGWOdMUyvSwjRBaJYqi4NIiKHOWfgEoadDor9DHL K8iSaVeGILwSWZorJ+PVf2/4MVfUdz78bY47n0tUrTF3O1FPiqbm0Wljh9tysKRUAyjp 0/JBwtoa6ia15nfMLjnT5Q8eIU03D5NRXUXVsvjf1YE/3sS5T/M+zKxnYcgOowp0xjNJ eASQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MdnXHTIFHp39KUio8jeORJKWlV1pr/VnQAeVLDGF+MQ=; b=jhYL5MaZ5Sa1L5+95NC41fgMCy6k+DGZv7FwdLhxZxFXaw9OTvOpTQF4Fb2Kvk6j4O QAcaE7S06rhiBfvNJOLsRU2+hnxPt70QUXTo7hqtGZLV+uOiRwucViQXwYU0r3y7vrzz bNAxF8/jTQ04DUI2F4gM4h0SKxxve/K1wZrKKcdgBj0GWZtveL8INwUrh2NqdovMx/0Y OXPaLjdJZntCMdxhTFker3/OJtqZttJzFDgWCDMgEO7nyJx5yf0p+TxUOiAcqGGifb7T dUu4a/NoN0oen2q9p3uhab8xGSslQzQLstRD832MjGRBPA7pamZJiUX+IDhtVC31ACgK DPww== X-Gm-Message-State: AOAM531b0j1xsOwfFOoZkfppX44zXwGdN4LCWD1Hex3LtYmF8HRDOLvE KAhRRc/JYXA7voTg1m5KX/4= X-Google-Smtp-Source: ABdhPJwII28ZkqFHDiKA6/B5i5s5h8EavJ8uGTcEgsoPc3AIsNhPN4iQ9inGotwybPxFxtgK1PTPWA== X-Received: by 2002:a05:600c:21c8:: with SMTP id x8mr798423wmj.163.1632760298051; Mon, 27 Sep 2021 09:31:38 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Willian Rampazzo , Laurent Vivier , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 4/6] tests/acceptance: Share useful helpers from virtiofs_submounts test Date: Mon, 27 Sep 2021 18:31:14 +0200 Message-Id: <20210927163116.1998349-5-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210927163116.1998349-1-f4bug@amsat.org> References: <20210927163116.1998349-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1632760300850100001 Move the useful has_cmd()/has_cmds() helpers from the virtiofs test to the avocado_qemu public class. Reviewed-by: Wainer dos Santos Moschetta Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 57 ++++++++++++++++++++++ tests/acceptance/virtiofs_submounts.py | 59 +---------------------- 2 files changed, 59 insertions(+), 57 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 2f59e171e49..a497a24f823 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -11,6 +11,7 @@ import logging import os import shutil +import subprocess import sys import uuid import tempfile @@ -49,6 +50,62 @@ tcg_available, ) =20 +def has_cmd(name, args=3DNone): + """ + This function is for use in a @avocado.skipUnless decorator, e.g.: + + @skipUnless(*has_cmd('sudo -n', ('sudo', '-n', 'true'))) + def test_something_that_needs_sudo(self): + ... + """ + + if args is None: + args =3D ('which', name) + + try: + _, stderr, exitcode =3D run_cmd(args) + except Exception as e: + exitcode =3D -1 + stderr =3D str(e) + + if exitcode !=3D 0: + cmd_line =3D ' '.join(args) + err =3D f'{name} required, but "{cmd_line}" failed: {stderr.strip(= )}' + return (False, err) + else: + return (True, '') + +def has_cmds(*cmds): + """ + This function is for use in a @avocado.skipUnless decorator and + allows checking for the availability of multiple commands, e.g.: + + @skipUnless(*has_cmds(('cmd1', ('cmd1', '--some-parameter')), + 'cmd2', 'cmd3')) + def test_something_that_needs_cmd1_and_cmd2(self): + ... + """ + + for cmd in cmds: + if isinstance(cmd, str): + cmd =3D (cmd,) + + ok, errstr =3D has_cmd(*cmd) + if not ok: + return (False, errstr) + + return (True, '') + +def run_cmd(args): + subp =3D subprocess.Popen(args, + stdout=3Dsubprocess.PIPE, + stderr=3Dsubprocess.PIPE, + universal_newlines=3DTrue) + stdout, stderr =3D subp.communicate() + ret =3D subp.returncode + + return (stdout, stderr, ret) + def is_readable_executable_file(path): return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK) =20 diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 21ad7d792e7..e6dc32ffd4e 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -6,67 +6,12 @@ =20 from avocado import skipUnless from avocado_qemu import LinuxTest, BUILD_DIR +from avocado_qemu import has_cmds +from avocado_qemu import run_cmd from avocado_qemu import wait_for_console_pattern from avocado.utils import ssh =20 =20 -def run_cmd(args): - subp =3D subprocess.Popen(args, - stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.PIPE, - universal_newlines=3DTrue) - stdout, stderr =3D subp.communicate() - ret =3D subp.returncode - - return (stdout, stderr, ret) - -def has_cmd(name, args=3DNone): - """ - This function is for use in a @avocado.skipUnless decorator, e.g.: - - @skipUnless(*has_cmd('sudo -n', ('sudo', '-n', 'true'))) - def test_something_that_needs_sudo(self): - ... - """ - - if args is None: - args =3D ('which', name) - - try: - _, stderr, exitcode =3D run_cmd(args) - except Exception as e: - exitcode =3D -1 - stderr =3D str(e) - - if exitcode !=3D 0: - cmd_line =3D ' '.join(args) - err =3D f'{name} required, but "{cmd_line}" failed: {stderr.strip(= )}' - return (False, err) - else: - return (True, '') - -def has_cmds(*cmds): - """ - This function is for use in a @avocado.skipUnless decorator and - allows checking for the availability of multiple commands, e.g.: - - @skipUnless(*has_cmds(('cmd1', ('cmd1', '--some-parameter')), - 'cmd2', 'cmd3')) - def test_something_that_needs_cmd1_and_cmd2(self): - ... - """ - - for cmd in cmds: - if isinstance(cmd, str): - cmd =3D (cmd,) - - ok, errstr =3D has_cmd(*cmd) - if not ok: - return (False, errstr) - - return (True, '') - - class VirtiofsSubmountsTest(LinuxTest): """ :avocado: tags=3Darch:x86_64 --=20 2.31.1 From nobody Mon Feb 9 09:46:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) client-ip=209.85.221.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632760304; cv=none; d=zohomail.com; s=zohoarc; b=Q+eVYS1ck7PKW9bNpw9Hz1tsr30p2ZZFmp54GuJPu9DHRsGh5/AgFs9dErWjoVgnzh0PgNeFAOpqHjhtGQBvuOePbBmlqOy1rDRQUsXH4wgJXb9tx2PInW9oFELbs2azSX8cAs6VnfTsIzqUqEExPKJ90TmdbI1elRzO1QSg7Es= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632760304; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UMcabUUT2V3YtrSUdazOXLcQv5cKyuk2eIlpKelVaGY=; b=fh5xtgh0E1KmMUxPDnrmNNyTeCI7ygzqQgtlD/9dTEKGvl6OSj5QQU9ChYD4ojjOVW4ssiUGhL6YSkuFZbOQC3N/mDZ8V+XqUQkjqBJLaw1R1oE3678Z/8qjY/KpS/MkOY1UoPzljyVGDQMLcyfkfiUJiBpgY4NOOM/U6mOhWVo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.zohomail.com with SMTPS id 163276030448515.170284622226404; Mon, 27 Sep 2021 09:31:44 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id x20so8321553wrg.10 for ; Mon, 27 Sep 2021 09:31:43 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id c30sm17238730wrb.74.2021.09.27.09.31.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 09:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UMcabUUT2V3YtrSUdazOXLcQv5cKyuk2eIlpKelVaGY=; b=j7xN9IET1ta4BGWLbVCvF5ywKwzXrRQbKrPKTZ3fT5DkUFYwE8UKOsuxE/KPln3m5C CzkVd3uEYECnwg7BmfMwXpHgC4NlYnhGmwOvYSQ4bFAseNO7MnRqx2yutoLmffoWuyYt Egkt8uoCOrdRnXBrfbtGpHkMypiH3EKyLe7CPE0tca1mXZKBfmAnXJIoruqMrAgMj+Hd 8m486OzPoS1TyCCni9UbqshwJwAsLOxQOUqmAbEtS4hEL5oLT37RLN1q9kpN6uSsNrJA Uw37wu84fjfbbMJcF1Jbh4QiX7L+D3Wqr+p2A/rvnoSLea+gaCxL9csFbpqWYDAg5iS+ +TMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UMcabUUT2V3YtrSUdazOXLcQv5cKyuk2eIlpKelVaGY=; b=v0AB56zKFCjQy5bcoSf8E1xNXHcsFhIqCo9htPMVj1kPixra34j2y1FNOMG1GutSYT 0MNoewjJowUK+M6zleGoM1woxwLE9i9viChCmMybnZzGMc5EJmsoO0ygHuzjIlDIVuvq gIvF2esSMeFtGuq1I8B5VRPUVhNn923V4r6lvXeEgDAA3/a/fMfpkYLkgzUwh+RzWulz /nabFOfNHkSh4YKOeUUfWAZR69OqBKtA8ELg5S0HB5mA6RYwm+Mn82+pS4iSxsSlf+Oa CxYQu6k/ay5V9ILDssCNyGLENC0gS9l697oA1uYtBJJh5xKdD67sMJwvoU7wqa2QWKKI vRrw== X-Gm-Message-State: AOAM532iN3lMyI4Ea2Veeu5s7yGpevGnDrOqICzExXm0igDTKDdHji5L W1oSXmn7Oo4074weMTkWPtQ= X-Google-Smtp-Source: ABdhPJzO6/KIIgyOzz0s6sImlZTeOCl9W1SBRl387kZkZjtkYtTSs/fcrEQDjFeb+CyexfWwtf+iFQ== X-Received: by 2002:adf:ff8f:: with SMTP id j15mr885816wrr.115.1632760302728; Mon, 27 Sep 2021 09:31:42 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Willian Rampazzo , Laurent Vivier , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 5/6] tests/acceptance: Add bFLT loader linux-user test Date: Mon, 27 Sep 2021 18:31:15 +0200 Message-Id: <20210927163116.1998349-6-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210927163116.1998349-1-f4bug@amsat.org> References: <20210927163116.1998349-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1632760306573100001 Add a very quick test that runs a busybox binary in bFLT format: $ AVOCADO_ALLOW_UNTRUSTED_CODE=3D1 \ avocado --show=3Dapp run -t linux_user 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 Reviewed-by: Willian Rampazzo Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/load_bflt.py | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 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 00000000000..f071a979d8e --- /dev/null +++ b/tests/acceptance/load_bflt.py @@ -0,0 +1,54 @@ +# Test the bFLT loader 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 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 =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) + + @skipUnless(*has_cmd('cpio')) + @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') + 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) + + res =3D self.run(busybox_path) + ver =3D 'BusyBox v1.24.0.git (2015-02-03 22:17:13 CET) multi-call = binary.' + self.assertIn(ver, res.stdout_text) + + res =3D self.run(busybox_path, ['uname', '-a']) + unm =3D 'armv7l GNU/Linux' + self.assertIn(unm, res.stdout_text) --=20 2.31.1 From nobody Mon Feb 9 09:46:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) client-ip=209.85.221.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1632760310; cv=none; d=zohomail.com; s=zohoarc; b=SQnW8sOFx0V9MKTw66g3Ecmt4rjBr0Y2CRNBZ0ZjMcorVlbJ1/mEppBXFOi1hN7SEAuCTwDc3JxWKRT1bmKWaAZanAr1EB1uX5F9RerM2k5d7PE0rinDQ/SbhXAdJt/Tx2mOJHTYVNnNSV+rbZ+qyuLdTqFfy6B9ReFIEMXf0u4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632760310; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cUq4xl4nW+7Tp/ISXBRxs5olh27djrkmsp59yEYwwd4=; b=kGN+SYdA6YwiFkIx0vrDxS0NN2bA9UEingD+57/CbRzIhgZZmQOSIAK3y67nzJL9/Kg+pnLg18LkDK88uRton2GU4ShNoyZTAGdTEIMDgAz1yr2IHJhxb69em7rT72+sMgalXgCk9jorG5pxoXuX0Qb76e+LFXgbnkn3a627u/g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.zohomail.com with SMTPS id 1632760309885186.39672647644977; Mon, 27 Sep 2021 09:31:49 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id x20so8321982wrg.10 for ; Mon, 27 Sep 2021 09:31:48 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id n11sm4279wmq.19.2021.09.27.09.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 09:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cUq4xl4nW+7Tp/ISXBRxs5olh27djrkmsp59yEYwwd4=; b=KVxbygAlrftAANDaoA7MYCdirbtjmFVb/H32SgOYSDdKGtLUPpzo47LPAWRtWk1Sy+ hSV+tYTVf5iWc8Ey6VDYk56taRnm0e0f2jYrTV4iVOxEP1qKmk9NDsGYtahK7DP2kRvR e2NqvXN8NgL1edHc8gbvMqLiyw+yYRu53wYEV6oi+Lf5brOW/H4+Mp9Lwc6XoUEHYtW8 +63fhgvaFIzw1QoIRQ3JuuxgzRdatvy/hlqsoBw7pXdP4QV2O3al9OF0TyAL5T+0NNiT 8TLU18fPgwSCJJ858KjXsnNsChd08sV/3CT7oLjM43AehRjvIWfNI62dIiYvkO1RVUqu AyLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cUq4xl4nW+7Tp/ISXBRxs5olh27djrkmsp59yEYwwd4=; b=cqD+KekYrNBr1iEnRWD3S32ouTrBN7g1YK/A0bN/97AAM3Aodv/6X3JvqxWEa0d/Zz 8Yp9VoRAQhzT2myxSY4ENMkJYekssyqDh2VwLuLA31o710V2LGMdFgtzE57ojThPBCGQ MH0Vkz/LdsT8j4VPfF5n3mi3APso1VmsCgdGR8C6muk6aF5EJdaQhKMFquRixy/heDM8 L1GFxmau0D0Hms18TXqH6AQ7ir0DV9yfz2frCTqokkLzU7bzRJsIiK06r1doiXqoHYUs ENq183inYHgiUif1Pnyc+cNod8NEJ7XymZ7IqEziunTp12iHp1zmvQWvidcVbGmM4flW HKCA== X-Gm-Message-State: AOAM533zATtr8L5eIeedNLmoffaLblzF9AQ+tL5FTVKJA88FuD/n5iXN LkksUu0Bckgh6+8U+2U5kK8= X-Google-Smtp-Source: ABdhPJy8SKOScrPUR6fVUTw2vgZScS9BLpfgqktNIY/Kc9eVEd/L7ohA3pJn96/U0H/nVpgyrn2nsQ== X-Received: by 2002:a05:6000:144d:: with SMTP id v13mr845240wrx.303.1632760307527; Mon, 27 Sep 2021 09:31:47 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Willian Rampazzo , Laurent Vivier , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 6/6] tests/acceptance: Rename avocado_qemu.Test -> QemuSystemTest Date: Mon, 27 Sep 2021 18:31:16 +0200 Message-Id: <20210927163116.1998349-7-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210927163116.1998349-1-f4bug@amsat.org> References: <20210927163116.1998349-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1632760312444100001 To run user-mode emulation tests, we introduced the avocado_qemu.QemuUserTest which inherits from avocado_qemu.QemuBaseTest. System-mode emulation tests are based on the avocado_qemu.Test class, which also inherits avocado_qemu.QemuBaseTest. To avoid confusion, rename it as avocado_qemu.QemuSystemTest. Suggested-by: Wainer dos Santos Moschetta Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 21 +++++++++----------- tests/acceptance/boot_linux_console.py | 4 ++-- tests/acceptance/cpu_queries.py | 4 ++-- tests/acceptance/empty_cpu_model.py | 4 ++-- tests/acceptance/info_usernet.py | 4 ++-- tests/acceptance/linux_initrd.py | 4 ++-- tests/acceptance/linux_ssh_mips_malta.py | 5 +++-- tests/acceptance/machine_arm_canona1100.py | 4 ++-- tests/acceptance/machine_arm_integratorcp.py | 4 ++-- tests/acceptance/machine_arm_n8x0.py | 4 ++-- tests/acceptance/machine_avr6.py | 4 ++-- tests/acceptance/machine_m68k_nextcube.py | 4 ++-- tests/acceptance/machine_microblaze.py | 4 ++-- tests/acceptance/machine_mips_fuloong2e.py | 4 ++-- tests/acceptance/machine_mips_loongson3v.py | 4 ++-- tests/acceptance/machine_mips_malta.py | 4 ++-- tests/acceptance/machine_ppc.py | 4 ++-- tests/acceptance/machine_rx_gdbsim.py | 4 ++-- tests/acceptance/machine_s390_ccw_virtio.py | 4 ++-- tests/acceptance/machine_sparc_leon3.py | 4 ++-- tests/acceptance/migration.py | 4 ++-- tests/acceptance/multiprocess.py | 4 ++-- tests/acceptance/pc_cpu_hotplug_props.py | 4 ++-- tests/acceptance/ppc_prep_40p.py | 4 ++-- tests/acceptance/version.py | 4 ++-- tests/acceptance/virtio-gpu.py | 4 ++-- tests/acceptance/virtio_check_params.py | 4 ++-- tests/acceptance/virtio_version.py | 4 ++-- tests/acceptance/vnc.py | 4 ++-- tests/acceptance/x86_cpu_model_versions.py | 4 ++-- 30 files changed, 68 insertions(+), 70 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index a497a24f823..1abec2abaca 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -183,7 +183,7 @@ def interrupt_interactive_console_until_pattern(test, s= uccess_message, =20 :param test: an Avocado test containing a VM that will have its console read and probed for a success or failure message - :type test: :class:`avocado_qemu.Test` + :type test: :class:`avocado_qemu.QemuSystemTest` :param success_message: if this message appears, test succeeds :param failure_message: if this message appears, test fails :param interrupt_string: a string to send to the console before trying @@ -199,7 +199,7 @@ def wait_for_console_pattern(test, success_message, fai= lure_message=3DNone, =20 :param test: an Avocado test containing a VM that will have its console read and probed for a success or failure message - :type test: :class:`avocado_qemu.Test` + :type test: :class:`avocado_qemu.QemuSystemTest` :param success_message: if this message appears, test succeeds :param failure_message: if this message appears, test fails """ @@ -211,7 +211,7 @@ def exec_command(test, command): the content. =20 :param test: an Avocado test containing a VM. - :type test: :class:`avocado_qemu.Test` + :type test: :class:`avocado_qemu.QemuSystemTest` :param command: the command to send :type command: str """ @@ -226,7 +226,7 @@ def exec_command_and_wait_for_pattern(test, command, =20 :param test: an Avocado test containing a VM that will have its console read and probed for a success or failure message - :type test: :class:`avocado_qemu.Test` + :type test: :class:`avocado_qemu.QemuSystemTest` :param command: the command to send :param success_message: if this message appears, test succeeds :param failure_message: if this message appears, test fails @@ -269,16 +269,13 @@ def fetch_asset(self, name, cancel_on_missing=3Dcancel_on_missing) =20 =20 -class Test(QemuBaseTest): - """Facilitates system emulation tests. - - TODO: Rename this class as `QemuSystemTest`. - """ +class QemuSystemTest(QemuBaseTest): + """Facilitates system emulation tests.""" =20 def setUp(self): self._vms =3D {} =20 - super(Test, self).setUp('qemu-system-') + super(QemuSystemTest, self).setUp('qemu-system-') =20 self.machine =3D self.params.get('machine', default=3Dself._get_unique_tag_val(= 'machine')) @@ -515,11 +512,11 @@ def default_kernel_params(self): return self._info.get('kernel_params', None) =20 =20 -class LinuxTest(Test, LinuxSSHMixIn): +class LinuxTest(QemuSystemTest, LinuxSSHMixIn): """Facilitates having a cloud-image Linux based available. =20 For tests that indend to interact with guests, this is a better choice - to start with than the more vanilla `Test` class. + to start with than the more vanilla `QemuSystemTest` class. """ =20 timeout =3D 900 diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot= _linux_console.py index 0a49c0e2760..80740452f54 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -15,7 +15,7 @@ =20 from avocado import skip from avocado import skipUnless -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import exec_command from avocado_qemu import exec_command_and_wait_for_pattern from avocado_qemu import interrupt_interactive_console_until_pattern @@ -46,7 +46,7 @@ def image_pow2ceil_expand(path): with open(path, 'ab+') as fd: fd.truncate(size_aligned) =20 -class LinuxKernelTest(Test): +class LinuxKernelTest(QemuSystemTest): KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' =20 def wait_for_console_pattern(self, success_message, vm=3DNone): diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries= .py index cc9e380cc7f..cf69f69b116 100644 --- a/tests/acceptance/cpu_queries.py +++ b/tests/acceptance/cpu_queries.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. =20 -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest =20 -class QueryCPUModelExpansion(Test): +class QueryCPUModelExpansion(QemuSystemTest): """ 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 a1e59e45e4e..22f504418d2 100644 --- a/tests/acceptance/empty_cpu_model.py +++ b/tests/acceptance/empty_cpu_model.py @@ -7,9 +7,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. -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest =20 -class EmptyCPUModel(Test): +class EmptyCPUModel(QemuSystemTest): def test(self): self.vm.add_args('-S', '-display', 'none', '-machine', 'none', '-c= pu', '') self.vm.set_qmp_monitor(enabled=3DFalse) diff --git a/tests/acceptance/info_usernet.py b/tests/acceptance/info_usern= et.py index 9c1fd903a0b..dc01f74150c 100644 --- a/tests/acceptance/info_usernet.py +++ b/tests/acceptance/info_usernet.py @@ -8,12 +8,12 @@ # 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 QemuSystemTest =20 from qemu.utils import get_info_usernet_hostfwd_port =20 =20 -class InfoUsernet(Test): +class InfoUsernet(QemuSystemTest): =20 def test_hostfwd(self): self.vm.add_args('-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0= -:22') diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_init= rd.py index a249e2f14a2..25fba6a28a7 100644 --- a/tests/acceptance/linux_initrd.py +++ b/tests/acceptance/linux_initrd.py @@ -12,11 +12,11 @@ import logging import tempfile =20 -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado import skipIf =20 =20 -class LinuxInitrd(Test): +class LinuxInitrd(QemuSystemTest): """ 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 4de19474188..c0f0be5adee 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -12,7 +12,8 @@ import time =20 from avocado import skipUnless -from avocado_qemu import Test, LinuxSSHMixIn +from avocado_qemu import LinuxSSHMixIn +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado.utils import process from avocado.utils import archive @@ -21,7 +22,7 @@ =20 @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') @skipUnless(ssh.SSH_CLIENT_BINARY, 'No SSH client available') -class LinuxSSH(Test, LinuxSSHMixIn): +class LinuxSSH(QemuSystemTest, LinuxSSHMixIn): =20 timeout =3D 150 # Not for 'configure --enable-debug --enable-debug-tcg' =20 diff --git a/tests/acceptance/machine_arm_canona1100.py b/tests/acceptance/= machine_arm_canona1100.py index 0e5c43dbcf8..182a0b05134 100644 --- a/tests/acceptance/machine_arm_canona1100.py +++ b/tests/acceptance/machine_arm_canona1100.py @@ -8,11 +8,11 @@ # 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 QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado.utils import archive =20 -class CanonA1100Machine(Test): +class CanonA1100Machine(QemuSystemTest): """Boots the barebox firmware and checks that the console is operation= al""" =20 timeout =3D 90 diff --git a/tests/acceptance/machine_arm_integratorcp.py b/tests/acceptanc= e/machine_arm_integratorcp.py index 49c8ebff78b..1ffe1073ef8 100644 --- a/tests/acceptance/machine_arm_integratorcp.py +++ b/tests/acceptance/machine_arm_integratorcp.py @@ -12,7 +12,7 @@ import logging =20 from avocado import skipUnless -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern =20 =20 @@ -29,7 +29,7 @@ CV2_AVAILABLE =3D False =20 =20 -class IntegratorMachine(Test): +class IntegratorMachine(QemuSystemTest): =20 timeout =3D 90 =20 diff --git a/tests/acceptance/machine_arm_n8x0.py b/tests/acceptance/machin= e_arm_n8x0.py index e5741f2d8d1..12e9a6803ba 100644 --- a/tests/acceptance/machine_arm_n8x0.py +++ b/tests/acceptance/machine_arm_n8x0.py @@ -11,10 +11,10 @@ import os =20 from avocado import skipUnless -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern =20 -class N8x0Machine(Test): +class N8x0Machine(QemuSystemTest): """Boots the Linux kernel and checks that the console is operational""" =20 timeout =3D 90 diff --git a/tests/acceptance/machine_avr6.py b/tests/acceptance/machine_av= r6.py index 6baf4e9c7f3..7536d83356f 100644 --- a/tests/acceptance/machine_avr6.py +++ b/tests/acceptance/machine_avr6.py @@ -19,9 +19,9 @@ =20 import time =20 -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest =20 -class AVR6Machine(Test): +class AVR6Machine(QemuSystemTest): timeout =3D 5 =20 def test_freertos(self): diff --git a/tests/acceptance/machine_m68k_nextcube.py b/tests/acceptance/m= achine_m68k_nextcube.py index 09e2745cc52..6790e7d9cd1 100644 --- a/tests/acceptance/machine_m68k_nextcube.py +++ b/tests/acceptance/machine_m68k_nextcube.py @@ -8,7 +8,7 @@ import os import time =20 -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado import skipUnless =20 from tesseract_utils import tesseract_available, tesseract_ocr @@ -20,7 +20,7 @@ PIL_AVAILABLE =3D False =20 =20 -class NextCubeMachine(Test): +class NextCubeMachine(QemuSystemTest): """ :avocado: tags=3Darch:m68k :avocado: tags=3Dmachine:next-cube diff --git a/tests/acceptance/machine_microblaze.py b/tests/acceptance/mach= ine_microblaze.py index 7f6d18495d8..4928920f960 100644 --- a/tests/acceptance/machine_microblaze.py +++ b/tests/acceptance/machine_microblaze.py @@ -5,11 +5,11 @@ # 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 QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado.utils import archive =20 -class MicroblazeMachine(Test): +class MicroblazeMachine(QemuSystemTest): =20 timeout =3D 90 =20 diff --git a/tests/acceptance/machine_mips_fuloong2e.py b/tests/acceptance/= machine_mips_fuloong2e.py index 0ac285e2af1..89291f47b24 100644 --- a/tests/acceptance/machine_mips_fuloong2e.py +++ b/tests/acceptance/machine_mips_fuloong2e.py @@ -10,10 +10,10 @@ import os =20 from avocado import skipUnless -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern =20 -class MipsFuloong2e(Test): +class MipsFuloong2e(QemuSystemTest): =20 timeout =3D 60 =20 diff --git a/tests/acceptance/machine_mips_loongson3v.py b/tests/acceptance= /machine_mips_loongson3v.py index 85b131a40f0..5194cf18c9c 100644 --- a/tests/acceptance/machine_mips_loongson3v.py +++ b/tests/acceptance/machine_mips_loongson3v.py @@ -11,10 +11,10 @@ import time =20 from avocado import skipUnless -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern =20 -class MipsLoongson3v(Test): +class MipsLoongson3v(QemuSystemTest): timeout =3D 60 =20 @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code= ') diff --git a/tests/acceptance/machine_mips_malta.py b/tests/acceptance/mach= ine_mips_malta.py index b67d8cb141c..f1895d59f35 100644 --- a/tests/acceptance/machine_mips_malta.py +++ b/tests/acceptance/machine_mips_malta.py @@ -12,7 +12,7 @@ import logging =20 from avocado import skipUnless -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado.utils import archive from avocado import skipIf @@ -33,7 +33,7 @@ =20 @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') -class MaltaMachineFramebuffer(Test): +class MaltaMachineFramebuffer(QemuSystemTest): =20 timeout =3D 30 =20 diff --git a/tests/acceptance/machine_ppc.py b/tests/acceptance/machine_ppc= .py index a836e2496f1..67e24fa4f7c 100644 --- a/tests/acceptance/machine_ppc.py +++ b/tests/acceptance/machine_ppc.py @@ -6,10 +6,10 @@ # later. See the COPYING file in the top-level directory. =20 from avocado.utils import archive -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern =20 -class PpcMachine(Test): +class PpcMachine(QemuSystemTest): =20 timeout =3D 90 KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' diff --git a/tests/acceptance/machine_rx_gdbsim.py b/tests/acceptance/machi= ne_rx_gdbsim.py index 32b737b6d85..6cd8704b016 100644 --- a/tests/acceptance/machine_rx_gdbsim.py +++ b/tests/acceptance/machine_rx_gdbsim.py @@ -11,13 +11,13 @@ import os =20 from avocado import skipIf -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import exec_command_and_wait_for_pattern from avocado_qemu import wait_for_console_pattern from avocado.utils import archive =20 =20 -class RxGdbSimMachine(Test): +class RxGdbSimMachine(QemuSystemTest): =20 timeout =3D 30 KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance= /machine_s390_ccw_virtio.py index 4028c99afce..bd03d7160b4 100644 --- a/tests/acceptance/machine_s390_ccw_virtio.py +++ b/tests/acceptance/machine_s390_ccw_virtio.py @@ -13,12 +13,12 @@ import tempfile =20 from avocado import skipIf -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import exec_command_and_wait_for_pattern from avocado_qemu import wait_for_console_pattern from avocado.utils import archive =20 -class S390CCWVirtioMachine(Test): +class S390CCWVirtioMachine(QemuSystemTest): KERNEL_COMMON_COMMAND_LINE =3D 'printk.time=3D0 ' =20 timeout =3D 120 diff --git a/tests/acceptance/machine_sparc_leon3.py b/tests/acceptance/mac= hine_sparc_leon3.py index 2405cd7a0d7..e61b223185a 100644 --- a/tests/acceptance/machine_sparc_leon3.py +++ b/tests/acceptance/machine_sparc_leon3.py @@ -5,12 +5,12 @@ # 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 QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado import skip =20 =20 -class Leon3Machine(Test): +class Leon3Machine(QemuSystemTest): =20 timeout =3D 60 =20 diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py index 792639cb693..584d6ef53f5 100644 --- a/tests/acceptance/migration.py +++ b/tests/acceptance/migration.py @@ -11,7 +11,7 @@ =20 =20 import tempfile -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado import skipUnless =20 from avocado.utils import network @@ -19,7 +19,7 @@ from avocado.utils.path import find_command =20 =20 -class Migration(Test): +class Migration(QemuSystemTest): """ :avocado: tags=3Dmigration """ diff --git a/tests/acceptance/multiprocess.py b/tests/acceptance/multiproce= ss.py index 96627f022a8..80a3b8f442b 100644 --- a/tests/acceptance/multiprocess.py +++ b/tests/acceptance/multiprocess.py @@ -7,12 +7,12 @@ import os import socket =20 -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado_qemu import exec_command from avocado_qemu import exec_command_and_wait_for_pattern =20 -class Multiprocess(Test): +class Multiprocess(QemuSystemTest): """ :avocado: tags=3Dmultiprocess """ diff --git a/tests/acceptance/pc_cpu_hotplug_props.py b/tests/acceptance/pc= _cpu_hotplug_props.py index 2e86d5017a5..52b878188ed 100644 --- a/tests/acceptance/pc_cpu_hotplug_props.py +++ b/tests/acceptance/pc_cpu_hotplug_props.py @@ -20,9 +20,9 @@ # License along with this library; if not, see . # =20 -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest =20 -class OmittedCPUProps(Test): +class OmittedCPUProps(QemuSystemTest): """ :avocado: tags=3Darch:x86_64 :avocado: tags=3Dcpu:qemu64 diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_4= 0p.py index 2993ee3b078..cbcb7d06ad6 100644 --- a/tests/acceptance/ppc_prep_40p.py +++ b/tests/acceptance/ppc_prep_40p.py @@ -9,11 +9,11 @@ =20 from avocado import skipIf from avocado import skipUnless -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern =20 =20 -class IbmPrep40pMachine(Test): +class IbmPrep40pMachine(QemuSystemTest): =20 timeout =3D 60 =20 diff --git a/tests/acceptance/version.py b/tests/acceptance/version.py index 79b923d4fc0..ded7f039c1b 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 QemuSystemTest =20 =20 -class Version(Test): +class Version(QemuSystemTest): """ :avocado: tags=3Dquick """ diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py index 4acc1e6d5fd..2a249a3a2c1 100644 --- a/tests/acceptance/virtio-gpu.py +++ b/tests/acceptance/virtio-gpu.py @@ -4,8 +4,8 @@ # later. See the COPYING file in the top-level directory. =20 =20 -from avocado_qemu import Test from avocado_qemu import BUILD_DIR +from avocado_qemu import QemuSystemTest from avocado_qemu import wait_for_console_pattern from avocado_qemu import exec_command_and_wait_for_pattern from avocado_qemu import is_readable_executable_file @@ -27,7 +27,7 @@ def pick_default_vug_bin(): return bld_dir_path =20 =20 -class VirtioGPUx86(Test): +class VirtioGPUx86(QemuSystemTest): """ :avocado: tags=3Dvirtio-gpu :avocado: tags=3Darch:x86_64 diff --git a/tests/acceptance/virtio_check_params.py b/tests/acceptance/vir= tio_check_params.py index 87e6c839d14..e869690473a 100644 --- a/tests/acceptance/virtio_check_params.py +++ b/tests/acceptance/virtio_check_params.py @@ -24,7 +24,7 @@ =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu.machine import QEMUMachine -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest from avocado import skip =20 #list of machine types and virtqueue properties to test @@ -41,7 +41,7 @@ 'driver=3Dnull-co,id=3Ddrive0,if=3Dnon= e']} =20 =20 -class VirtioMaxSegSettingsCheck(Test): +class VirtioMaxSegSettingsCheck(QemuSystemTest): @staticmethod def make_pattern(props): pattern_items =3D ['{0} =3D \w+'.format(prop) for prop in props] diff --git a/tests/acceptance/virtio_version.py b/tests/acceptance/virtio_v= ersion.py index 33593c29dd0..208910bb844 100644 --- a/tests/acceptance/virtio_version.py +++ b/tests/acceptance/virtio_version.py @@ -13,7 +13,7 @@ =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu.machine import QEMUMachine -from avocado_qemu import Test +from avocado_qemu import QemuSystemTest =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(QemuSystemTest): """ 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 22656bbcc2b..e6ebdf5d1ee 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 QemuSystemTest =20 =20 -class Vnc(Test): +class Vnc(QemuSystemTest): """ :avocado: tags=3Dvnc,quick """ diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/= x86_cpu_model_versions.py index 0e9feda62d4..a6edf74c1cc 100644 --- a/tests/acceptance/x86_cpu_model_versions.py +++ b/tests/acceptance/x86_cpu_model_versions.py @@ -24,7 +24,7 @@ import avocado_qemu import re =20 -class X86CPUModelAliases(avocado_qemu.Test): +class X86CPUModelAliases(avocado_qemu.QemuSystemTest): """ Validation of PC CPU model versions and CPU model aliases =20 @@ -239,7 +239,7 @@ def test_none_alias(self): self.validate_aliases(cpus) =20 =20 -class CascadelakeArchCapabilities(avocado_qemu.Test): +class CascadelakeArchCapabilities(avocado_qemu.QemuSystemTest): """ Validation of Cascadelake arch-capabilities =20 --=20 2.31.1