From nobody Sat May 18 18:12:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1674045866; cv=none; d=zohomail.com; s=zohoarc; b=n1HXTGNAB6f3DusBlEnOtZeDcUptyyuI0QfPAjj39+dDrXOHTzEmPM8rai0BYppHuOb6lcILJdHfHAGjxxfGs65mODX4/lDkCqZSS8FfUyN29fhxS7Ytfi1OTbdsE03iR+TfUKNGNrmFSHzjNoXhx9Q+bCMXAqe8BVgEilL+Mzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674045866; h=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; bh=72g+RpKzaheKXfUuYSTQXNOokn2Y08u64N6tCSAziKc=; b=Wn2De7Qm3bEc4ti+G7aorSZP9xr6hYH+kS+NJKehg2NULzIVc7l0DsXB/zvL778V1nik4QqQzAQnBSmm88o9EigkAY8G6XgLwxaj8y33KVnHYPJVF4HSWxUkcCNsNWsrg6n963PCK8DzbiI/6WbZQ8a/1Oly1Z1xwI562ZE3d08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16740458660211012.8039800951844; Wed, 18 Jan 2023 04:44:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI7nN-0006FK-Ob; Wed, 18 Jan 2023 07:44:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI7nM-0006FC-V8 for qemu-devel@nongnu.org; Wed, 18 Jan 2023 07:44:00 -0500 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pI7nL-0006vA-BB for qemu-devel@nongnu.org; Wed, 18 Jan 2023 07:44:00 -0500 Received: by mail-ot1-x330.google.com with SMTP id j16-20020a056830271000b0067202045ee9so19567400otu.7 for ; Wed, 18 Jan 2023 04:43:58 -0800 (PST) Received: from grind.. ([191.17.222.2]) by smtp.gmail.com with ESMTPSA id cb2-20020a056830618200b0068460566f4bsm18158432otb.30.2023.01.18.04.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 04:43:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=72g+RpKzaheKXfUuYSTQXNOokn2Y08u64N6tCSAziKc=; b=oYjX1QkHDT8dQIsqfOqpRBHf3FJufNw2spQ8e3iOsRO7M/XeV6+X7m3FVdYdMU+zFK Wtga6h3LK+GlizF7rCJNwDSrkqjsAcQJT2As6jbt1Hd6Wi7o8kP45aCGSyt3kJ2n6s/T Xnz/S3Ci67LzG2zmH+cPF6JWmk8s4keyvym9O8+23YAmSCzVuv6onywIwNl7JPf+FY0E 0RShUWlsmJEWAeGZGATkJoDA9zXIh+a7cQBnwdbdjkHo4IA818YIkHCxUxpIADJEO/FH IidgTI5fhcse1bDhvUsrqpYqZb3Gb/tGeV8YGOmzpEVlNVvetu/78LjgoaVmHlfst0hw G+4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=72g+RpKzaheKXfUuYSTQXNOokn2Y08u64N6tCSAziKc=; b=6h/ajGqTisPBoTyg6xpJsr9B85C8eu5jcQ5cQOUZKwu0fbKp/DCTPB0gQgh/ql+Y/N XwXQAuDFSJBXAK6DDDL1IlkGhoyGCFtcFUTP2CI7VkDQ7KRhWM7ayqSt5IxbHsnbNrwp Y/6LCqzTB1EGMD54SiSb5kne95MYWYRPUpNz853G2ATsVFKkeVjIodBDku96x7Q9KD1r F2O7B3otWeeMmVJpv/J1WyY4G2M2RnrDfH4uo9rQspgONCv/sfudLf/SsJ+AAk7CTsWX UxqMn9WA0lY4fI+rGdq4pJutuRzmXItoSslCGDGzppddDBjuKQUlTIfSDd2HNnwpomwb ITpA== X-Gm-Message-State: AFqh2kpCJ/JZnsMvqCC7+yNz42GKaDLBWoN0ZcGQoWPE+S+IStcda2Pi hCXbWTIxpVjDCrW4DIMjuf/2ooDnAoEDQJUu/1M= X-Google-Smtp-Source: AMrXdXtF3WPhxzsjRvhCYXeIWPOwxOBDTfzFgevFxXi0iWOCdrkOCbKgvAkv8SWy7Gne6xeCEEhPKA== X-Received: by 2002:a9d:4805:0:b0:671:b52f:5c3a with SMTP id c5-20020a9d4805000000b00671b52f5c3amr3300341otf.34.1674045837600; Wed, 18 Jan 2023 04:43:57 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal Subject: [PATCH 1/3] avocado_qemu: enhance CANCEL message in QemuBaseTest:setUp() Date: Wed, 18 Jan 2023 09:43:46 -0300 Message-Id: <20230118124348.364771-2-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118124348.364771-1-dbarboza@ventanamicro.com> References: <20230118124348.364771-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=dbarboza@ventanamicro.com; helo=mail-ot1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1674045866500100002 Content-Type: text/plain; charset="utf-8" Trying to run 'make check-avocado' while having only non-x86_64 QEMU binaries built, in a x86_64 host machine, will give us the following cancel message: "CANCEL: No QEMU binary defined or found in the build tree" Which is not quite what's happening here. Avocado defaults to the host arch for every arch-agnostic test, and in the case mentioned above it cancelled the test because there were no qemu-system-x86_64 binary to be found. Change pick_default_qemu_bin() to return a (qemu_bin, arch) tuple, then use 'arch' in the CANCEL message. This will make the error more informative: "CANCEL: No QEMU binary defined or found in the build tree for arch x86_64" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Fabiano Rosas --- tests/avocado/avocado_qemu/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado= _qemu/__init__.py index 910f3ba1ea..8614ac3978 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -128,8 +128,8 @@ def pick_default_qemu_bin(bin_prefix=3D'qemu-system-', = arch=3DNone): ] for path in qemu_bin_paths: if is_readable_executable_file(path): - return path - return None + return path, arch + return None, arch =20 =20 def _console_interaction(test, success_message, failure_message, @@ -247,11 +247,13 @@ def setUp(self, bin_prefix): self.cpu =3D self.params.get('cpu', default=3Dself._get_unique_tag_val('cpu= ')) =20 - default_qemu_bin =3D pick_default_qemu_bin(bin_prefix, arch=3Dself= .arch) + default_qemu_bin, arch =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: - self.cancel("No QEMU binary defined or found in the build tree= ") + self.cancel("No QEMU binary defined or found in the " + "build tree for arch %s" % arch) =20 def fetch_asset(self, name, asset_hash=3DNone, algorithm=3DNone, --=20 2.39.0 From nobody Sat May 18 18:12:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1674045864; cv=none; d=zohomail.com; s=zohoarc; b=BUX8KxaiDVIINtinO9si+nzP57cpbP43kpryJ0VoqH7SqxYHdrwURtGjF6saTo+SFLulYo2UB+k0phtxZZFvPX1EYgwnQSuvbMzB+xD+XZOYdMRJFv6pzVCgde9WwK4PfZ/C3lFS2LfvbnVukF8Beg0nnMRaJIAmB3wWes34CQA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674045864; h=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; bh=VQ0HV4ABPoswzzyafBmNSldjR99NF5+QCvcSo1iG33k=; b=huFzLP6PyUL48lPniPzOD0e+ANVopUpdHPyhJNwXSsb1P/S1yFYYMyXBxJTnCy8iFlH3uBk3kTMo1svinNXK+mcZ8aSw25KZwWBquUynDs8kvLxCV7nTYbNhQoSQcG3qYKpgGPBfcwVGU9dU16QCaHFlbX1OnQg1JNBAFjisNRA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674045864715967.5232189175038; Wed, 18 Jan 2023 04:44:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI7nU-0006Gv-Ht; Wed, 18 Jan 2023 07:44:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI7nP-0006Fb-8N for qemu-devel@nongnu.org; Wed, 18 Jan 2023 07:44:03 -0500 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pI7nN-0006vJ-L8 for qemu-devel@nongnu.org; Wed, 18 Jan 2023 07:44:03 -0500 Received: by mail-oi1-x229.google.com with SMTP id d188so17331623oia.3 for ; Wed, 18 Jan 2023 04:44:01 -0800 (PST) Received: from grind.. ([191.17.222.2]) by smtp.gmail.com with ESMTPSA id cb2-20020a056830618200b0068460566f4bsm18158432otb.30.2023.01.18.04.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 04:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VQ0HV4ABPoswzzyafBmNSldjR99NF5+QCvcSo1iG33k=; b=VYNwuIltHyBfVGvE0hK8wptASl+yBg4e2/SMFC5mJbM7vW3IUFtOh2ZRUFrbATcu7C HkEOwo7XNSA6KHvwzx9E8ZuLfOxaaPVcwHtUIQN/Mud2xSRyPMfyknz1fEot9eDmLGdT 4ahKO+6bOHwGaxWD4SGvuD+8/Zfu59SQUYyf4yQY+bOYvsqxVEGPoZ8CiSJK0tgntQpR 6figEbm51Hh8JjJvZZcuRcusYrTqqe5qBg5XjozbtjQZgtlvLyIHF3qfHpXAebOotC5P r2X5dId3e7vfkeag80tCsqevYwWOjcrl1F5Bmitn5jCJ3lb1mbvSlxaUS0y80tOM0VyS UZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VQ0HV4ABPoswzzyafBmNSldjR99NF5+QCvcSo1iG33k=; b=Oyiu7f6xGIBUtCoHmS81rXIlqIL5OoR/U6MNsrpYZuUQ0WAlZYJv7+vWUu6p9OkwSh Y3ZqOmikBCzXlT41Xf32rVaLwTsV11fpZXP/Glxvl0Lbl23SvRQt5TI+MYX3Fhs8+OIJ BrAlg6S/9DZh4vhouQJJ3//kACshCz9xvza/ObA+Yes2Wd1lp/QrylPUmwJ/Mqk+KMGI uqw4DPkqKodGK43iej7T3cvFawN4ApBd3LibwkyhVqJBcQJ9Dl4K09+S4cu/z//fiBX8 TvCeWN2PwT2lpl9FCKHZ3LaJsIlnWrlPmECel9FNpBMjxBq9F4veYA+UloWbzThLVRGi L40Q== X-Gm-Message-State: AFqh2kqYbQw3cWbNlT/Yd4tNQpzpQvmKTFFapMQjw/ncxooI9S8m/Hdy ioq/xZjp22fvUwkJC9JvD0uC4rnhbj3BstVRiMU= X-Google-Smtp-Source: AMrXdXv6Y5aJmtiADk1CFAvSotmRiJqHNggQqcobwB39NwOPZsPu6zkndKQvGxa0ebsLVhnhs1Eukw== X-Received: by 2002:a05:6808:20a9:b0:363:8f75:a1bc with SMTP id s41-20020a05680820a900b003638f75a1bcmr4303782oiw.15.1674045840205; Wed, 18 Jan 2023 04:44:00 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal Subject: [PATCH 2/3] avocado_qemu: add AVOCADO_DEFAULT_ARCH for cross-arch tests Date: Wed, 18 Jan 2023 09:43:47 -0300 Message-Id: <20230118124348.364771-3-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118124348.364771-1-dbarboza@ventanamicro.com> References: <20230118124348.364771-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::229; envelope-from=dbarboza@ventanamicro.com; helo=mail-oi1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1674045866492100001 Content-Type: text/plain; charset="utf-8" All avocado tests that are arch agnostic (i.e. does not set an 'arch' tag) are run with arch=3DNone in pick_default_qemu_bin(), and then 'arch' is set to os.uname()[4], meaning that it will take the arch of the running host. This means that if one compiles QEMU binaries for non-x86 targets on an x86 machine, and then run 'make check-avocado', all arch agnostic tests will be cancelled because there's no qemu-system-x86_64 to be found. There is no particular reason to not allow these tests to be run with other arch binaries in a x86_64 host. Allow the developer to do it by adding a a new env variable called AVOCADO_DEFAULT_ARCH. Any 'arch' that is set by this variable will take precedence of setting it via os.uname()[4]. We can then run non-x86 binaries tests in a x86_64 host as follows: $ AVOCADO_DEFAULT_ARCH=3Driscv64 make check-avocado (...) RESULTS: PASS 11 | ERROR 0 | FAIL 0 | SKIP 1 | WARN 0 | INTERRUPT 0 | CANCE= L 0 Signed-off-by: Daniel Henrique Barboza --- docs/devel/testing.rst | 7 +++++++ tests/avocado/avocado_qemu/__init__.py | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index e10c47b5a7..95d0a3e626 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -1144,6 +1144,13 @@ the framework or by the test itself. At the framewo= rk level, it will currently influence the selection of a QEMU binary (when one is not explicitly given). =20 +When ``arch`` is not set, an env variable AVOCADO_DEFAULT_ARCH can +be used as default value if set. This allows hosts of different +architectures to run arch-agnostic tests using binaries from other +archs (i.e. a x86_64 host can use aarch64/riscv64 binaries as +default). If this variable isn't set, ``arch`` defaults to the +host system arch given by ``os.uname``. + Tests are also free to use this attribute value, for their own needs. A test may, for instance, use the same value when selecting the architecture of a kernel or disk image to boot a VM with. diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado= _qemu/__init__.py index 8614ac3978..bc42985cbb 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -107,14 +107,17 @@ def pick_default_qemu_bin(bin_prefix=3D'qemu-system-'= , arch=3DNone): directory or in the source tree root directory. =20 :param arch: the arch to use when looking for a QEMU binary (the target - will match the arch given). If None (the default), arch - will be the current host system arch (as given by - :func:`os.uname`). + will match the arch given). If None (the default), check + if the AVOCADO_DEFAULT_ARCH env var is set and use it as + arch. If it's not set, arch will be the current host + system arch (as given by :func:`os.uname`). :type arch: str :returns: the path to the default QEMU binary or None if one could not be found :rtype: str or None """ + if arch is None: + arch =3D os.getenv('AVOCADO_DEFAULT_ARCH') if arch is None: arch =3D os.uname()[4] # qemu binary path does not match arch for powerpc, handle it --=20 2.39.0 From nobody Sat May 18 18:12:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1674045887; cv=none; d=zohomail.com; s=zohoarc; b=lyrX9Eq8Y5N8aRM1HK+dytH144neFqUdp+CcEKhimAyDC7zjcGdBxq0kFgUi1CExSdv3c/Pxdh/Kweox/kOUCsLFKdm78T+fP+pmbYWcyHNbCcIlTBbtPynnE5ARsHgqlkEPTQBWcLCBXhCZFqQku7jp/X+wQdg5adFa8swIT3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674045887; h=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; bh=izrPO1t7qk2QErTGet6agoTah6eGiWvkSVHu+2Q1hXw=; b=iSWcQS/tIi7BJoZoE2QVdegBlwaOI4zGWFtmj1Z7wWEBZ1xkBL+o3fkx5W0X6u7juI3/7+mou55t1fF8d0A5XoNwEi46VZdWpASSbx1jRXR2qx23QkXJmVBK7MdxheSGB5ZNQVaKJIrnjgQOIvmnO3mp/RcWIaiCnoFJqqabvvk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167404588764863.68638486140435; Wed, 18 Jan 2023 04:44:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI7nW-0006IW-GC; Wed, 18 Jan 2023 07:44:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI7nS-0006Gw-6C for qemu-devel@nongnu.org; Wed, 18 Jan 2023 07:44:08 -0500 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pI7nQ-0006vb-HX for qemu-devel@nongnu.org; Wed, 18 Jan 2023 07:44:05 -0500 Received: by mail-ot1-x334.google.com with SMTP id cm26-20020a056830651a00b00684e5c0108dso5839292otb.9 for ; Wed, 18 Jan 2023 04:44:04 -0800 (PST) Received: from grind.. ([191.17.222.2]) by smtp.gmail.com with ESMTPSA id cb2-20020a056830618200b0068460566f4bsm18158432otb.30.2023.01.18.04.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 04:44:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=izrPO1t7qk2QErTGet6agoTah6eGiWvkSVHu+2Q1hXw=; b=kT040hH5gk22DsJypcyf/7mc5DmGDQKPxUW6VbGXXjD7AIbnfCoK5iQzfj0CMYYg6Y Y2gJsj+ULSBh3iRTonB7n6hnbwJd27f//sd29kgKLwsIZb4Uu6cKtn+HO1HWW/oDvmOD i6RLQ0/Z6EMOP8fTFokDaq6ibiX6av7uG5PIGNxS9Q3u4x6enUx2u5LPHOxewMdEzCWT k+37pcXyTvE6rYAUGjpdvY9MZ7IPS/rwyGBrp3nR7MI0AA59ezUQorMklQspCvMkMwLG sUFHiqynWwWZcUifa+l/LZBRotBSx3pReVNHBQV8kSNwDw+oI+fhfiN20zBALeAUHZHf 5A1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=izrPO1t7qk2QErTGet6agoTah6eGiWvkSVHu+2Q1hXw=; b=LD6FC0tyy44A2tO9fGrlgETs7d09OATx9VSPuSWGIC+0n5s6saRjq0x2RPw2recERQ DLtNnhJNEN8e950bWZB3V68Roe98hzn2guINM2FMLFfSiZ74yDS3vYJ+s5o/Pt/nKKEP gjZ3piVQG4NvaoDUakl/tuQNA3wsWUgO5stp3xtM/i7AcVVCkb3K2YRZafMQBp41A2Za cCgU6IFwxqkYPpcYifK0eJFNz4v8pOaQ1bjn1C+nwt6wC3RuiCzKXwcO5OvTNsfMk9Yb lqA7A7GdSZruUfA+31MIz9lhwUHLaWVT1+JzoSHt1KZgvxV3I+BjMtRoT3avE2LlRkSr 6K3g== X-Gm-Message-State: AFqh2koZOpcskYvYmuyHWDOczBHnBI/G1wZnhZZwQCR/TmOlYm3Ekqeo S9cY1+MsL9wJwZ3VGWCX+Uvw0EYjfM68Z7kX39U= X-Google-Smtp-Source: AMrXdXvB5Eq4MH7x3lcIFkcfnnoKnHrYFADRYpWQKvOGS2tHhQCUF+okoymMTtzTvJx7xwdr5dNYgg== X-Received: by 2002:a9d:7849:0:b0:684:98c9:36ea with SMTP id c9-20020a9d7849000000b0068498c936eamr3640134otm.2.1674045842655; Wed, 18 Jan 2023 04:44:02 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Beraldo Leal Subject: [PATCH 3/3] avocado_qemu: add AVOCADO_DEFAULT_MACHINE Date: Wed, 18 Jan 2023 09:43:48 -0300 Message-Id: <20230118124348.364771-4-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118124348.364771-1-dbarboza@ventanamicro.com> References: <20230118124348.364771-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::334; envelope-from=dbarboza@ventanamicro.com; helo=mail-ot1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1674045888598100004 Content-Type: text/plain; charset="utf-8" Allow users to control which machine to use in tests where no particular machine is specified. This is a good way to run tests in a machine that's not the arch default, e.g. for qemu-system-x86_64 tests can be run using a machine other than pc-i440fx. This env var has greater effect when used together with the recently added AVOCADO_DEFAULT_ARCH, allowing full control of what the tests should use if no default arch/machine is given. In this example, a check-avocado run will use the RISC-V 'virt' machine if no default arch/machine is set: AVOCADO_DEFAULT_ARCH=3Driscv64 AVOCADO_DEFAULT_MACHINE=3Dvirt make check-av= ocado Signed-off-by: Daniel Henrique Barboza --- docs/devel/testing.rst | 8 +++++--- tests/avocado/avocado_qemu/__init__.py | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 95d0a3e626..128b6ae964 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -1178,9 +1178,11 @@ The machine type that will be set to all QEMUMachine= instances created by the test. =20 The ``machine`` attribute will be set to the test parameter of the same -name. If one is not given explicitly, it will either be set to -``None``, or, if the test is tagged with one (and only one) -``:avocado: tags=3Dmachine:VALUE`` tag, it will be set to ``VALUE``. +name. If one is not given explicitly, an env variable +AVOCADO_DEFAULT_MACHINE can be used as default value if set. Otherwise +it will either be set to ``None``, or, if the test is tagged with one +(and only one) ``:avocado: tags=3Dmachine:VALUE`` tag, it will be set to +``VALUE``. =20 qemu_bin '''''''' diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado= _qemu/__init__.py index bc42985cbb..75eaaa9265 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -282,6 +282,9 @@ def setUp(self): self.machine =3D self.params.get('machine', default=3Dself._get_unique_tag_val(= 'machine')) =20 + if self.machine is None: + self.machine =3D os.getenv('AVOCADO_DEFAULT_MACHINE') + def require_accelerator(self, accelerator): """ Requires an accelerator to be available for the test to continue --=20 2.39.0