From patchwork Tue Jul 13 21:19:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504858 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dJn1xqq2; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYYC1qJfz9sX2 for ; Wed, 14 Jul 2021 07:24:15 +1000 (AEST) Received: from localhost ([::1]:60406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Psy-0006dW-VG for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:24:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pp4-0008VF-99 for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44234) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pp0-0007XU-0d for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o/hmecJHLqWZ/BY8YWnw3VpukSO4hxCzqvER0n9EBPk=; b=dJn1xqq2ls9d6feHKlXE45hEGZrb8ylbfzO15pMMGgZKhmwmbSwovhiKviADXNqejp9LCK ubms1HY+Ek9A8Rswn3Nc26/2+wyUy6GlWJ66COQfUYfLo3zQprowQVnTC4yPOtOzqo6EbH kxhQT4eIM+V05AdYlwPn07EMjVr/paI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-42-NpgRYWq_PeOXNyFr-_uV_g-1; Tue, 13 Jul 2021 17:19:58 -0400 X-MC-Unique: NpgRYWq_PeOXNyFr-_uV_g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E09AA1084F4B; Tue, 13 Jul 2021 21:19:55 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 600DC19C44; Tue, 13 Jul 2021 21:19:46 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 01/23] Acceptance Tests: use the job work directory for created VMs Date: Tue, 13 Jul 2021 17:19:01 -0400 Message-Id: <20210713211923.3809241-2-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The QEMUMachine uses a base temporary directory for all temporary needs. By setting it to the Avocado's workdir, it's possible to keep the temporary files during debugging sessions much more easily by setting the "--keep-tmp" command line option. Reference: https://avocado-framework.readthedocs.io/en/85.0/api/test/avocado.html#avocado.Test.workdir Reference: https://avocado-framework.readthedocs.io/en/85.0/config/index.html#run-keep-tmp Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: John Snow Message-Id: <20210211220146.2525771-4-crosa@redhat.com> Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 93c4b9851f..693c226d91 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -221,7 +221,8 @@ def setUp(self): def _new_vm(self, *args): self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_") - vm = QEMUMachine(self.qemu_bin, sock_dir=self._sd.name) + vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir, + sock_dir=self._sd.name) if args: vm.add_args(*args) return vm From patchwork Tue Jul 13 21:19:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fB3UHC9E; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYcG33nXz9sXJ for ; Wed, 14 Jul 2021 07:26:54 +1000 (AEST) Received: from localhost ([::1]:40958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3PvY-0004bP-4t for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:26:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PpK-0000Fa-59 for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PpG-0007ns-Nm for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5WjdnKvlhDKw/K0bGSWT2bC924E+aJKhN61S3ckmz/c=; b=fB3UHC9EYFhmmVTdfTgtTa05clkOeuSaQqFpd/9KxhvJRBIigK3C0zMKpIsLtVHk6Y1s5n I/HhXpQcC8KKVeZvhbmX0B6Lixthe34X0q7Dyc534B5i/IcXqO9baSe5DCtOQGZM8mkB54 0kmR90KXOYSJscGz+7M6LgKLXuVxLFQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-fprFwuLMNGO2qHz9dF8DlA-1; Tue, 13 Jul 2021 17:20:20 -0400 X-MC-Unique: fprFwuLMNGO2qHz9dF8DlA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 88122804300; Tue, 13 Jul 2021 21:20:18 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A5B019C45; Tue, 13 Jul 2021 21:19:55 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 02/23] Acceptance Tests: log information when creating QEMUMachine Date: Tue, 13 Jul 2021 17:19:02 -0400 Message-Id: <20210713211923.3809241-3-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Including its base temporary directory, given that information useful for debugging can be put there. Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta Message-Id: <20210211220146.2525771-5-crosa@redhat.com> Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 693c226d91..4ce09de4fa 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -219,10 +219,12 @@ def setUp(self): if self.qemu_bin is None: self.cancel("No QEMU binary defined or found in the build tree") - def _new_vm(self, *args): + def _new_vm(self, name, *args): self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_") vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir, sock_dir=self._sd.name) + self.log.debug('QEMUMachine "%s" created', name) + self.log.debug('QEMUMachine "%s" temp_dir: %s', name, vm.temp_dir) if args: vm.add_args(*args) return vm @@ -235,7 +237,7 @@ def get_vm(self, *args, name=None): if not name: name = str(uuid.uuid4()) if self._vms.get(name) is None: - self._vms[name] = self._new_vm(*args) + self._vms[name] = self._new_vm(name, *args) if self.machine is not None: self._vms[name].set_machine(self.machine) return self._vms[name] From patchwork Tue Jul 13 21:19:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504855 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GFq6GFPa; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYVc64rXz9sX3 for ; Wed, 14 Jul 2021 07:22:00 +1000 (AEST) Received: from localhost ([::1]:53792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Pqo-0001sO-GG for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:21:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppe-00013F-2V for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppb-000814-2k for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OS8v8CG+34mphZBpB0HybgdUv1BniMG/SDhz9sxy3DQ=; b=GFq6GFPaN1VpqQY59DwMqacYSZaC2x8N1QsBhxOVAEG+RYp3zQSdvw527ekDWVl0lXbc6T 3xVRu8EFmC+URy3rCZ4tM4dYBp2rsip5yPemcn6zAliC/oDOVsl8Ei8jbbPfQP8gOmETAM vkJg4SpoyZ7D2IniB8UB7fNGXl8exIw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-151-_rGCbJSxO0GpXpu42Le2Tg-1; Tue, 13 Jul 2021 17:20:34 -0400 X-MC-Unique: _rGCbJSxO0GpXpu42Le2Tg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9CC431005E46; Tue, 13 Jul 2021 21:20:31 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5A9119C44; Tue, 13 Jul 2021 21:20:18 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 03/23] Acceptance Tests: distinguish between temp and logs dir Date: Tue, 13 Jul 2021 17:19:03 -0400 Message-Id: <20210713211923.3809241-4-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Logs can be very important to debug issues, and currently QEMUMachine instances will remove logs that are created under the temporary directories. With this change, the stdout and stderr generated by the QEMU process started by QEMUMachine will always be kept along the test results directory. Signed-off-by: Cleber Rosa Message-Id: <20210211220146.2525771-6-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta Signed-off-by: Cleber Rosa --- python/qemu/machine/machine.py | 17 ++++++++++++++--- tests/acceptance/avocado_qemu/__init__.py | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index d47ab3d896..94846dd71b 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -96,7 +96,8 @@ def __init__(self, socket_scm_helper: Optional[str] = None, sock_dir: Optional[str] = None, drain_console: bool = False, - console_log: Optional[str] = None): + console_log: Optional[str] = None, + log_dir: Optional[str] = None): ''' Initialize a QEMUMachine @@ -110,6 +111,7 @@ def __init__(self, @param sock_dir: where to create socket (defaults to base_temp_dir) @param drain_console: (optional) True to drain console socket to buffer @param console_log: (optional) path to console log file + @param log_dir: where to create and keep log files @note: Qemu process is not started until launch() is used. ''' # pylint: disable=too-many-arguments @@ -123,6 +125,7 @@ def __init__(self, self._name = name or "qemu-%d" % os.getpid() self._base_temp_dir = base_temp_dir self._sock_dir = sock_dir or self._base_temp_dir + self._log_dir = log_dir self._socket_scm_helper = socket_scm_helper if monitor_address is not None: @@ -314,8 +317,6 @@ def _base_args(self) -> List[str]: return args def _pre_launch(self) -> None: - self._qemu_log_path = os.path.join(self.temp_dir, self._name + ".log") - if self._console_set: self._remove_files.append(self._console_address) @@ -332,6 +333,7 @@ def _pre_launch(self) -> None: # NOTE: Make sure any opened resources are *definitely* freed in # _post_shutdown()! # pylint: disable=consider-using-with + self._qemu_log_path = os.path.join(self.log_dir, self._name + ".log") self._qemu_log_file = open(self._qemu_log_path, 'wb') def _post_launch(self) -> None: @@ -770,3 +772,12 @@ def temp_dir(self) -> str: self._temp_dir = tempfile.mkdtemp(prefix="qemu-machine-", dir=self._base_temp_dir) return self._temp_dir + + @property + def log_dir(self) -> str: + """ + Returns a directory to be used for writing logs + """ + if self._log_dir is None: + return self.temp_dir + return self._log_dir diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 4ce09de4fa..420c00f1a9 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -222,9 +222,10 @@ def setUp(self): def _new_vm(self, name, *args): self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_") vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir, - sock_dir=self._sd.name) + sock_dir=self._sd.name, log_dir=self.logdir) self.log.debug('QEMUMachine "%s" created', name) self.log.debug('QEMUMachine "%s" temp_dir: %s', name, vm.temp_dir) + self.log.debug('QEMUMachine "%s" log_dir: %s', name, vm.log_dir) if args: vm.add_args(*args) return vm From patchwork Tue Jul 13 21:19:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UuYHDAh5; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYfd6w0Sz9sX3 for ; Wed, 14 Jul 2021 07:28:57 +1000 (AEST) Received: from localhost ([::1]:49520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3PxX-0001vE-Km for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:28:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PpZ-0000uv-Vg for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PpX-0007y2-LJ for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lVrCW+9bkJ3UiipuCQw08Ayt4tSHmF98EV0Ie7W1YCU=; b=UuYHDAh5uW6gXpQtd/o1Y5zlfK2ventnCunDPNaKQOU94MeQrRO8Ee7bpAtY3UOYcV498/ Pevs9c6rr6YrWVedyIXGTc2btm6TODajpiBuvJdk59q31AlZLHyuCPTxcMYqFNr1Z/Pn44 YCGJVonh0JujsgpR3GqSHplGry8jI4c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-TutVqvu3NpO1rV8Y1yYjPA-1; Tue, 13 Jul 2021 17:20:36 -0400 X-MC-Unique: TutVqvu3NpO1rV8Y1yYjPA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53EA85074B; Tue, 13 Jul 2021 21:20:34 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6E5F19C44; Tue, 13 Jul 2021 21:20:31 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 04/23] Acceptance Tests: rename attribute holding the distro image checksum Date: Tue, 13 Jul 2021 17:19:04 -0400 Message-Id: <20210713211923.3809241-5-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This renames the attribute that holds the checksum for the image Linux distribution image used. The current name of the attribute is not very descriptive. Also, in preparation for making the distribution used configurable, which will add distro related parameters, attributes and tags, let's make the naming of those more uniform. Signed-off-by: Cleber Rosa Message-Id: <20210414221457.1653745-2-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Eric Auger Reviewed-by: Willian Rampazzo Reviewed-by: Philippe Mathieu-Daudé [CR: split long lines] Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 4 ++-- tests/acceptance/boot_linux.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 420c00f1a9..0e62c15c60 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -312,7 +312,7 @@ class LinuxTest(Test, LinuxSSHMixIn): """ timeout = 900 - chksum = None + distro_checksum = None username = 'root' password = 'password' @@ -360,7 +360,7 @@ def download_boot(self): try: boot = vmimage.get( 'fedora', arch=image_arch, version='31', - checksum=self.chksum, + checksum=self.distro_checksum, algorithm='sha256', cache_dir=self.cache_dirs[0], snapshot_dir=self.workdir) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 4c8a5994b2..3901c23690 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -20,7 +20,8 @@ class BootLinuxX8664(LinuxTest): :avocado: tags=arch:x86_64 """ - chksum = 'e3c1b309d9203604922d6e255c2c5d098a309c2d46215d8fc026954f3c5c27a0' + distro_checksum = ('e3c1b309d9203604922d6e255c2c5d09' + '8a309c2d46215d8fc026954f3c5c27a0') def test_pc_i440fx_tcg(self): """ @@ -66,7 +67,8 @@ class BootLinuxAarch64(LinuxTest): :avocado: tags=machine:gic-version=2 """ - chksum = '1e18d9c0cf734940c4b5d5ec592facaed2af0ad0329383d5639c997fdf16fe49' + distro_checksum = ('1e18d9c0cf734940c4b5d5ec592facae' + 'd2af0ad0329383d5639c997fdf16fe49') def add_common_args(self): self.vm.add_args('-bios', @@ -119,7 +121,8 @@ class BootLinuxPPC64(LinuxTest): :avocado: tags=arch:ppc64 """ - chksum = '7c3528b85a3df4b2306e892199a9e1e43f991c506f2cc390dc4efa2026ad2f58' + distro_checksum = ('7c3528b85a3df4b2306e892199a9e1e4' + '3f991c506f2cc390dc4efa2026ad2f58') def test_pseries_tcg(self): """ @@ -136,7 +139,8 @@ class BootLinuxS390X(LinuxTest): :avocado: tags=arch:s390x """ - chksum = '4caaab5a434fd4d1079149a072fdc7891e354f834d355069ca982fdcaf5a122d' + distro_checksum = ('4caaab5a434fd4d1079149a072fdc789' + '1e354f834d355069ca982fdcaf5a122d') @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') def test_s390_ccw_virtio_tcg(self): From patchwork Tue Jul 13 21:19:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I/d7rox9; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYVm5s9rz9sX2 for ; Wed, 14 Jul 2021 07:22:08 +1000 (AEST) Received: from localhost ([::1]:54266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Pqw-0002G6-FR for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:22:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppd-0000zr-4S for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PpZ-00080A-N6 for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=THmLqQsKEXOZbRKhS9beyVzcLcgkjletg78pbbNWyqE=; b=I/d7rox9QWGCfd1IA33t2hex23EywHHc6lhpkh5r7J6SUo9psykh/mMXcsaTTldGlhwLmo wmeQB9cRPo7NDGbl+PEaPscL9zhhQj8omiFwPsRJLjUZj95eLtV2+pF97l1/lx8lb32rN3 UhzWz+o4mnaKN4AOW05Za7fiF8ifugY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-189-oqOCcSalMbupp5Khgj-0Ew-1; Tue, 13 Jul 2021 17:20:39 -0400 X-MC-Unique: oqOCcSalMbupp5Khgj-0Ew-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF1211084F54; Tue, 13 Jul 2021 21:20:36 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7218A19C44; Tue, 13 Jul 2021 21:20:34 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 05/23] Acceptance Tests: move definition of distro checksums to the framework Date: Tue, 13 Jul 2021 17:19:05 -0400 Message-Id: <20210713211923.3809241-6-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Instead of having, by default, the checksum in the tests, and the definition of tests in the framework, let's keep them together. A central definition for distributions is available, and it should allow other known distros to be added more easily. No behavior change is expected here, and tests can still define a distro_checksum value if for some reason they want to override the known distribution information. Signed-off-by: Cleber Rosa Message-Id: <20210414221457.1653745-3-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Acked-by: Eric Auger [CR: split long lines] Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 39 +++++++++++++++++++++-- tests/acceptance/boot_linux.py | 12 ------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 0e62c15c60..3a144cded4 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -304,6 +304,35 @@ def ssh_command(self, command): return stdout_lines, stderr_lines +#: A collection of known distros and their respective image checksum +KNOWN_DISTROS = { + 'fedora': { + '31': { + 'x86_64': + {'checksum': ('e3c1b309d9203604922d6e255c2c5d09' + '8a309c2d46215d8fc026954f3c5c27a0')}, + 'aarch64': + {'checksum': ('1e18d9c0cf734940c4b5d5ec592facae' + 'd2af0ad0329383d5639c997fdf16fe49')}, + 'ppc64': + {'checksum': ('7c3528b85a3df4b2306e892199a9e1e4' + '3f991c506f2cc390dc4efa2026ad2f58')}, + 's390x': + {'checksum': ('4caaab5a434fd4d1079149a072fdc789' + '1e354f834d355069ca982fdcaf5a122d')}, + } + } + } + + +def get_known_distro_checksum(distro, distro_version, arch): + try: + return KNOWN_DISTROS.get(distro).get(distro_version).\ + get(arch).get('checksum') + except AttributeError: + return None + + class LinuxTest(Test, LinuxSSHMixIn): """Facilitates having a cloud-image Linux based available. @@ -353,14 +382,20 @@ def download_boot(self): vmimage.QEMU_IMG = qemu_img self.log.info('Downloading/preparing boot image') + distro = 'fedora' + distro_version = '31' + known_distro_checksum = get_known_distro_checksum(distro, + distro_version, + self.arch) + distro_checksum = self.distro_checksum or known_distro_checksum # Fedora 31 only provides ppc64le images image_arch = self.arch if image_arch == 'ppc64': image_arch = 'ppc64le' try: boot = vmimage.get( - 'fedora', arch=image_arch, version='31', - checksum=self.distro_checksum, + distro, arch=image_arch, version=distro_version, + checksum=distro_checksum, algorithm='sha256', cache_dir=self.cache_dirs[0], snapshot_dir=self.workdir) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 3901c23690..34c4366366 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -20,9 +20,6 @@ class BootLinuxX8664(LinuxTest): :avocado: tags=arch:x86_64 """ - distro_checksum = ('e3c1b309d9203604922d6e255c2c5d09' - '8a309c2d46215d8fc026954f3c5c27a0') - def test_pc_i440fx_tcg(self): """ :avocado: tags=machine:pc @@ -67,9 +64,6 @@ class BootLinuxAarch64(LinuxTest): :avocado: tags=machine:gic-version=2 """ - distro_checksum = ('1e18d9c0cf734940c4b5d5ec592facae' - 'd2af0ad0329383d5639c997fdf16fe49') - def add_common_args(self): self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios', @@ -121,9 +115,6 @@ class BootLinuxPPC64(LinuxTest): :avocado: tags=arch:ppc64 """ - distro_checksum = ('7c3528b85a3df4b2306e892199a9e1e4' - '3f991c506f2cc390dc4efa2026ad2f58') - def test_pseries_tcg(self): """ :avocado: tags=machine:pseries @@ -139,9 +130,6 @@ class BootLinuxS390X(LinuxTest): :avocado: tags=arch:s390x """ - distro_checksum = ('4caaab5a434fd4d1079149a072fdc789' - '1e354f834d355069ca982fdcaf5a122d') - @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') def test_s390_ccw_virtio_tcg(self): """ From patchwork Tue Jul 13 21:19:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504859 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=blBoumVk; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYZR4YDdz9sX2 for ; Wed, 14 Jul 2021 07:25:18 +1000 (AEST) Received: from localhost ([::1]:35654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Pty-0000dG-Jh for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:25:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppg-00017K-BC for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30401) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppc-00083U-TF for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7I/gsK3Fum/jvHVEyzJdD3/PNj9ftt2gW1TCv6cq5vU=; b=blBoumVkHk2qVAn45DOX9n9U+J6t3ubwJjqzcTj1fml4jP/1j6o2zBpoz8Hodyh2tx+w2z X96+Kke6dJQVLbb5QNNW9+L/LRxk4eJLl92EPwNKAnxKNY3vAhYxUChZO5kSmkzpJUtYV5 upBd91Fm2IZUkZ1O0RsocM9OuINpboA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-3wywiKNXMBu_9ZqYd_LMPA-1; Tue, 13 Jul 2021 17:20:41 -0400 X-MC-Unique: 3wywiKNXMBu_9ZqYd_LMPA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 469D01007273; Tue, 13 Jul 2021 21:20:39 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE5ED19C44; Tue, 13 Jul 2021 21:20:36 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 06/23] Acceptance Tests: support choosing specific distro and version Date: Tue, 13 Jul 2021 17:19:06 -0400 Message-Id: <20210713211923.3809241-7-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The tests based on the LinuxTest class give the test writer a ready to use guest operating system, currently pinned to Fedora 31. With this change, it's now possible to choose different distros and versions, similar to how other tags and parameter can be set for the target arch, accelerator, etc. One of the reasons for this work, is that some development features depend on updates on the guest side. For instance the tests on virtiofs_submounts.py, require newer kernels, and may benefit from running, say on Fedora 34, without the need for a custom kernel. Please notice that the pre-caching of the Fedora 31 images done during the early stages of `make check-acceptance` (before the tests are actually executed) are not expanded here to cover every new image added. But, the tests will download other needed images (and cache them) during the first execution. Signed-off-by: Cleber Rosa Message-Id: <20210414221457.1653745-4-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo Signed-off-by: Cleber Rosa --- docs/devel/testing.rst | 65 +++++++++++++++++++++++ tests/acceptance/avocado_qemu/__init__.py | 47 ++++++++++++---- 2 files changed, 102 insertions(+), 10 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 4e42392810..19cbf532ae 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -922,6 +922,39 @@ The preserved value of the ``qemu_bin`` parameter or the result of the dynamic probe for a QEMU binary in the current working directory or source tree. +LinuxTest +~~~~~~~~~ + +Besides the attributes present on the ``avocado_qemu.Test`` base +class, the ``avocado_qemu.LinuxTest`` adds the following attributes: + +distro +...... + +The name of the Linux distribution used as the guest image for the +test. The name should match the **Provider** column on the list +of images supported by the avocado.utils.vmimage library: + +https://avocado-framework.readthedocs.io/en/latest/guides/writer/libs/vmimage.html#supported-images + +distro_version +.............. + +The version of the Linux distribution as the guest image for the +test. The name should match the **Version** column on the list +of images supported by the avocado.utils.vmimage library: + +https://avocado-framework.readthedocs.io/en/latest/guides/writer/libs/vmimage.html#supported-images + +distro_checksum +............... + +The sha256 hash of the guest image file used for the test. + +If this value is not set in the code or by a test parameter (with the +same name), no validation on the integrity of the image will be +performed. + Parameter reference ------------------- @@ -962,6 +995,38 @@ qemu_bin The exact QEMU binary to be used on QEMUMachine. +LinuxTest +~~~~~~~~~ + +Besides the parameters present on the ``avocado_qemu.Test`` base +class, the ``avocado_qemu.LinuxTest`` adds the following parameters: + +distro +...... + +The name of the Linux distribution used as the guest image for the +test. The name should match the **Provider** column on the list +of images supported by the avocado.utils.vmimage library: + +https://avocado-framework.readthedocs.io/en/latest/guides/writer/libs/vmimage.html#supported-images + +distro_version +.............. + +The version of the Linux distribution as the guest image for the +test. The name should match the **Version** column on the list +of images supported by the avocado.utils.vmimage library: + +https://avocado-framework.readthedocs.io/en/latest/guides/writer/libs/vmimage.html#supported-images + +distro_checksum +............... + +The sha256 hash of the guest image file used for the test. + +If this value is not set in the code or by this parameter no +validation on the integrity of the image will be performed. + Skipping tests -------------- The Avocado framework provides Python decorators which allow for easily skip diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 3a144cded4..1f1728ab83 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -345,8 +345,39 @@ class LinuxTest(Test, LinuxSSHMixIn): username = 'root' password = 'password' + def _set_distro(self): + distro = self.params.get( + 'distro', + default=self._get_unique_tag_val('distro')) + if not distro: + distro = 'fedora' + self.distro = distro + + distro_version = self.params.get( + 'distro_version', + default=self._get_unique_tag_val('distro_version')) + if not distro_version: + distro_version = '31' + self.distro_version = distro_version + + # The distro checksum behaves differently than distro name and + # version. First, it does not respect a tag with the same + # name, given that it's not expected to be used for filtering + # (distro name versions are the natural choice). Second, the + # order of precedence is: parameter, attribute and then value + # from KNOWN_DISTROS. + distro_checksum = self.params.get('distro_checksum', + default=self.distro_checksum) + if not distro_checksum: + distro_checksum = get_known_distro_checksum(self.distro, + self.distro_version, + self.arch) + if distro_checksum: + self.distro_checksum = distro_checksum + def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'): super(LinuxTest, self).setUp() + self._set_distro() self.vm.add_args('-smp', '2') self.vm.add_args('-m', '1024') # The following network device allows for SSH connections @@ -382,20 +413,16 @@ def download_boot(self): vmimage.QEMU_IMG = qemu_img self.log.info('Downloading/preparing boot image') - distro = 'fedora' - distro_version = '31' - known_distro_checksum = get_known_distro_checksum(distro, - distro_version, - self.arch) - distro_checksum = self.distro_checksum or known_distro_checksum # Fedora 31 only provides ppc64le images image_arch = self.arch - if image_arch == 'ppc64': - image_arch = 'ppc64le' + if self.distro == 'fedora': + if image_arch == 'ppc64': + image_arch = 'ppc64le' + try: boot = vmimage.get( - distro, arch=image_arch, version=distro_version, - checksum=distro_checksum, + self.distro, arch=image_arch, version=self.distro_version, + checksum=self.distro_checksum, algorithm='sha256', cache_dir=self.cache_dirs[0], snapshot_dir=self.workdir) From patchwork Tue Jul 13 21:19:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CUYXJskt; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYdX280Mz9sX2 for ; Wed, 14 Jul 2021 07:28:00 +1000 (AEST) Received: from localhost ([::1]:45568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Pwb-0007li-Vo for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:27:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppq-0001kW-Dr for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppo-0008Bd-NN for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:20:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dObAmHePKlBhssvuYSm7yPTQOhbUAmlem4+csh72HAU=; b=CUYXJsktXEN8Aa5HjmrH4R5XTURNjQ5Uy8E10mK1haq8BTAdx39KvEdnH7Ifx4po6FDsNz xJfWQHbN6zoneWU/kKzfAxkkPNtnthg5nf06BFIEUFdgWuHqZDM/3l6MXyxWoZJtESnh9t BUknikZO0iU9mQ6ayKmkWZoS93PVIPg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-mn3Ms-AbMLClCHMfJe3Pkg-1; Tue, 13 Jul 2021 17:20:54 -0400 X-MC-Unique: mn3Ms-AbMLClCHMfJe3Pkg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30B5818414A0; Tue, 13 Jul 2021 21:20:52 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 727DF17F72; Tue, 13 Jul 2021 21:20:39 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 07/23] tests/acceptance: Ignore binary data sent on serial console Date: Tue, 13 Jul 2021 17:19:07 -0400 Message-Id: <20210713211923.3809241-8-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé If a guest sends binary data on the serial console, we get: File "tests/acceptance/avocado_qemu/__init__.py", line 92, in _console_interaction msg = console.readline().strip() File "/usr/lib64/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 2: invalid start byte Since we use the console with readline(), fix it the easiest way possible: ignore binary data (all current tests compare text string anyway). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210515134555.307404-2-f4bug@amsat.org> Reviewed-by: Wainer dos Santos Moschetta Tested-by: Wainer dos Santos Moschetta Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 1f1728ab83..c3163af3b7 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -86,14 +86,17 @@ def _console_interaction(test, success_message, failure_message, assert not keep_sending or send_string if vm is None: vm = test.vm - console = vm.console_socket.makefile() + console = vm.console_socket.makefile(mode='rb', encoding='utf-8') console_logger = logging.getLogger('console') while True: if send_string: vm.console_socket.sendall(send_string.encode()) if not keep_sending: send_string = None # send only once - msg = console.readline().strip() + try: + msg = console.readline().decode().strip() + except UnicodeDecodeError: + msg = None if not msg: continue console_logger.debug(msg) From patchwork Tue Jul 13 21:19:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504871 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LbvzM5Ff; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYlM185Tz9sX1 for ; Wed, 14 Jul 2021 07:33:02 +1000 (AEST) Received: from localhost ([::1]:59222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q1U-00007I-Hl for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:33:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppu-00022L-OT for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54014) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pps-0008EO-MU for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UK5a17W+X7crhERhK6kAeWAmsiRofQ74sUVXfii3LxI=; b=LbvzM5FfbY/ACa7TkbeyDRa7s+2sb9qsPfODHeCcNYubuzUiOs6DYEDWdDUjjQN8bwS/ZV DeryzcUGd1taRpsCzvWHa5wkFY6ifoUHoke2CThZUu5IWs2sQ/3Y1WDI+5LW9Rd8j8PVN4 z7kzxYB1c3co0tgPGnht7KPkBnFh3Uo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-5Y87oJ-eOMGVcSH0BqTNxg-1; Tue, 13 Jul 2021 17:20:56 -0400 X-MC-Unique: 5Y87oJ-eOMGVcSH0BqTNxg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB896802921; Tue, 13 Jul 2021 21:20:54 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 510D919C44; Tue, 13 Jul 2021 21:20:52 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 08/23] avocado_qemu: Fix KNOWN_DISTROS map into the LinuxDistro class Date: Tue, 13 Jul 2021 17:19:08 -0400 Message-Id: <20210713211923.3809241-9-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Willian Rampazzo As the KNOWN_DISTROS grows, more loosely methods will be created in the avocado_qemu/__init__.py file. Let's refactor the code so that KNOWN_DISTROS and related methods are packaged in a class Signed-off-by: Wainer dos Santos Moschetta Signed-off-by: Eric Auger Message-Id: <20210706131729.30749-2-eric.auger@redhat.com> [CR: moved aarch64 definition from patch 2 to 1] [CR: protect get() when arch is not defined] [CR: split long lines] Acked-by: Wainer dos Santos Moschetta Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 86 +++++++++++++---------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index c3163af3b7..256befafc4 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -306,34 +306,50 @@ def ssh_command(self, command): f'Guest command failed: {command}') return stdout_lines, stderr_lines +class LinuxDistro: + """Represents a Linux distribution -#: A collection of known distros and their respective image checksum -KNOWN_DISTROS = { - 'fedora': { - '31': { - 'x86_64': - {'checksum': ('e3c1b309d9203604922d6e255c2c5d09' - '8a309c2d46215d8fc026954f3c5c27a0')}, - 'aarch64': - {'checksum': ('1e18d9c0cf734940c4b5d5ec592facae' - 'd2af0ad0329383d5639c997fdf16fe49')}, - 'ppc64': - {'checksum': ('7c3528b85a3df4b2306e892199a9e1e4' - '3f991c506f2cc390dc4efa2026ad2f58')}, - 's390x': - {'checksum': ('4caaab5a434fd4d1079149a072fdc789' - '1e354f834d355069ca982fdcaf5a122d')}, + Holds information of known distros. + """ + #: A collection of known distros and their respective image checksum + KNOWN_DISTROS = { + 'fedora': { + '31': { + 'x86_64': + {'checksum': ('e3c1b309d9203604922d6e255c2c5d09' + '8a309c2d46215d8fc026954f3c5c27a0')}, + 'aarch64': + {'checksum': ('1e18d9c0cf734940c4b5d5ec592facae' + 'd2af0ad0329383d5639c997fdf16fe49')}, + 'ppc64': + {'checksum': ('7c3528b85a3df4b2306e892199a9e1e4' + '3f991c506f2cc390dc4efa2026ad2f58')}, + 's390x': + {'checksum': ('4caaab5a434fd4d1079149a072fdc789' + '1e354f834d355069ca982fdcaf5a122d')}, } } } + def __init__(self, name, version, arch): + self.name = name + self.version = version + self.arch = arch + try: + info = self.KNOWN_DISTROS.get(name).get(version).get(arch) + except AttributeError: + # Unknown distro + info = None + self._info = info or {} -def get_known_distro_checksum(distro, distro_version, arch): - try: - return KNOWN_DISTROS.get(distro).get(distro_version).\ - get(arch).get('checksum') - except AttributeError: - return None + @property + def checksum(self): + """Gets the cloud-image file checksum""" + return self._info.get('checksum', None) + + @checksum.setter + def checksum(self, value): + self._info['checksum'] = value class LinuxTest(Test, LinuxSSHMixIn): @@ -344,24 +360,24 @@ class LinuxTest(Test, LinuxSSHMixIn): """ timeout = 900 - distro_checksum = None + distro = None username = 'root' password = 'password' def _set_distro(self): - distro = self.params.get( + distro_name = self.params.get( 'distro', default=self._get_unique_tag_val('distro')) - if not distro: - distro = 'fedora' - self.distro = distro + if not distro_name: + distro_name = 'fedora' distro_version = self.params.get( 'distro_version', default=self._get_unique_tag_val('distro_version')) if not distro_version: distro_version = '31' - self.distro_version = distro_version + + self.distro = LinuxDistro(distro_name, distro_version, self.arch) # The distro checksum behaves differently than distro name and # version. First, it does not respect a tag with the same @@ -370,13 +386,9 @@ def _set_distro(self): # order of precedence is: parameter, attribute and then value # from KNOWN_DISTROS. distro_checksum = self.params.get('distro_checksum', - default=self.distro_checksum) - if not distro_checksum: - distro_checksum = get_known_distro_checksum(self.distro, - self.distro_version, - self.arch) + default=None) if distro_checksum: - self.distro_checksum = distro_checksum + self.distro.checksum = distro_checksum def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'): super(LinuxTest, self).setUp() @@ -418,14 +430,14 @@ def download_boot(self): self.log.info('Downloading/preparing boot image') # Fedora 31 only provides ppc64le images image_arch = self.arch - if self.distro == 'fedora': + if self.distro.name == 'fedora': if image_arch == 'ppc64': image_arch = 'ppc64le' try: boot = vmimage.get( - self.distro, arch=image_arch, version=self.distro_version, - checksum=self.distro_checksum, + self.distro.name, arch=image_arch, version=self.distro.version, + checksum=self.distro.checksum, algorithm='sha256', cache_dir=self.cache_dirs[0], snapshot_dir=self.workdir) From patchwork Tue Jul 13 21:19:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gy9WwOH2; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYXR6TDLz9sX2 for ; Wed, 14 Jul 2021 07:23:35 +1000 (AEST) Received: from localhost ([::1]:58288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3PsL-0005A9-FC for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:23:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppx-00027O-N7 for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppu-0008Fo-Ok for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S5dZ8DclsjkpdzCUuxjcyTgqtpLFUVUhRxkTUrExvOw=; b=gy9WwOH2Fs0IYWuuIIG8Kjt9VzjlFQl433kHQ3IyEUXLbF3v2JdOjQeX2T50bUb/5mim1a 5agT7mmSxTSe95vOd/VUs0v7XnUVCo0iE1RkqILYzaklSctLDDLMnUUzJSteVuDEiwr/Sl 1LUjN1reZEMV7kl44OD9S8xlqDK+d8U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-324-zWyC23B-PMCR7cZ374EWgg-1; Tue, 13 Jul 2021 17:20:59 -0400 X-MC-Unique: zWyC23B-PMCR7cZ374EWgg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 02FE8100B3AC; Tue, 13 Jul 2021 21:20:57 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B158519C59; Tue, 13 Jul 2021 21:20:54 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 09/23] Acceptance Tests: Add default kernel params and pxeboot url to the KNOWN_DISTROS collection Date: Tue, 13 Jul 2021 17:19:09 -0400 Message-Id: <20210713211923.3809241-10-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Willian Rampazzo When running LinuxTests we may need to run the guest with custom params. It is practical to store the pxeboot URL and the default kernel params so that the tests just need to fetch those and augment the kernel params. Signed-off-by: Eric Auger Reviewed-by: Willian Rampazzo Message-Id: <20210706131729.30749-3-eric.auger@redhat.com> [CR: split long lines] Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 58 +++++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 256befafc4..1de1edce0d 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -317,17 +317,59 @@ class LinuxDistro: '31': { 'x86_64': {'checksum': ('e3c1b309d9203604922d6e255c2c5d09' - '8a309c2d46215d8fc026954f3c5c27a0')}, + '8a309c2d46215d8fc026954f3c5c27a0'), + 'pxeboot_url': ('https://archives.fedoraproject.org/' + 'pub/archive/fedora/linux/releases/31/' + 'Everything/x86_64/os/images/pxeboot/'), + 'kernel_params': ('root=UUID=b1438b9b-2cab-4065-a99a-' + '08a96687f73c ro no_timer_check ' + 'net.ifnames=0 console=tty1 ' + 'console=ttyS0,115200n8'), + }, 'aarch64': {'checksum': ('1e18d9c0cf734940c4b5d5ec592facae' - 'd2af0ad0329383d5639c997fdf16fe49')}, + 'd2af0ad0329383d5639c997fdf16fe49'), + 'pxeboot_url': 'https://archives.fedoraproject.org/' + 'pub/archive/fedora/linux/releases/31/' + 'Everything/aarch64/os/images/pxeboot/', + 'kernel_params': ('root=UUID=b6950a44-9f3c-4076-a9c2-' + '355e8475b0a7 ro earlyprintk=pl011,0x9000000' + ' ignore_loglevel no_timer_check' + ' printk.time=1 rd_NO_PLYMOUTH' + ' console=ttyAMA0'), + }, 'ppc64': {'checksum': ('7c3528b85a3df4b2306e892199a9e1e4' '3f991c506f2cc390dc4efa2026ad2f58')}, 's390x': {'checksum': ('4caaab5a434fd4d1079149a072fdc789' '1e354f834d355069ca982fdcaf5a122d')}, - } + }, + '32': { + 'aarch64': + {'checksum': ('b367755c664a2d7a26955bbfff985855' + 'adfa2ca15e908baf15b4b176d68d3967'), + 'pxeboot_url': ('http://dl.fedoraproject.org/pub/fedora/linux/' + 'releases/32/Server/aarch64/os/images/' + 'pxeboot/'), + 'kernel_params': ('root=UUID=3df75b65-be8d-4db4-8655-' + '14d95c0e90c5 ro no_timer_check net.ifnames=0' + ' console=tty1 console=ttyS0,115200n8'), + }, + }, + '33': { + 'aarch64': + {'checksum': ('e7f75cdfd523fe5ac2ca9eeece68edc1' + 'a81f386a17f969c1d1c7c87031008a6b'), + 'pxeboot_url': ('http://dl.fedoraproject.org/pub/fedora/linux/' + 'releases/33/Server/aarch64/os/images/' + 'pxeboot/'), + 'kernel_params': ('root=UUID=d20b3ffa-6397-4a63-a734-' + '1126a0208f8a ro no_timer_check net.ifnames=0' + ' console=tty1 console=ttyS0,115200n8' + ' console=tty0'), + }, + }, } } @@ -351,6 +393,16 @@ def checksum(self): def checksum(self, value): self._info['checksum'] = value + @property + def pxeboot_url(self): + """Gets the repository url where pxeboot files can be found""" + return self._info.get('pxeboot_url', None) + + @property + def default_kernel_params(self): + """Gets the default kernel parameters""" + return self._info.get('kernel_params', None) + class LinuxTest(Test, LinuxSSHMixIn): """Facilitates having a cloud-image Linux based available. From patchwork Tue Jul 13 21:19:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504860 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SAX6PyGC; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYbb4R6fz9sX2 for ; Wed, 14 Jul 2021 07:26:19 +1000 (AEST) Received: from localhost ([::1]:38960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Puz-0002t5-BQ for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:26:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppz-0002AL-3w for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Ppv-0008Gc-Qc for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/5TXKC1dQEU+Xky60erz3/gHcfcWsiMRRr6v27umNWU=; b=SAX6PyGC8V3XRYSS5RE5r6ybj9KFHQVXs4OrHsU1clYL8XtzVdxy+ve7/aNJY22kdidNyG 7Ar0Fn7Wk4wAOmqeCzPzj9l2wPel8PxB4RlkNoryozfbsknaybML34xva6LVDFwugrX0lJ 1bNwwN2uClpjHWueVDSmLsmsqbCLZVU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-aqCCbEMmN22sgMgKfZkL2w-1; Tue, 13 Jul 2021 17:21:01 -0400 X-MC-Unique: aqCCbEMmN22sgMgKfZkL2w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75AB68015F5; Tue, 13 Jul 2021 21:20:59 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21AF219C44; Tue, 13 Jul 2021 21:20:57 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 10/23] avocado_qemu: Add SMMUv3 tests Date: Tue, 13 Jul 2021 17:19:10 -0400 Message-Id: <20210713211923.3809241-11-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger Add new tests checking the good behavior of the SMMUv3 protecting 2 virtio pci devices (block and net). We check the guest boots and we are able to install a package. Different guest configs are tested: standard, passthrough an strict=0. This is tested with both fedora 31 and 33. The former uses a 5.3 kernel without range invalidation whereas the latter uses a 5.8 kernel that features range invalidation. Signed-off-by: Eric Auger Reviewed-by: Willian Rampazzo Reviewed-by: Wainer dos Santos Moschetta Tested-by: Wainer dos Santos Moschetta Message-Id: <20210706131729.30749-4-eric.auger@redhat.com> [CR: split long lines] [CR: added MAINTAINERS entry] Signed-off-by: Cleber Rosa --- MAINTAINERS | 1 + tests/acceptance/smmu.py | 137 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 tests/acceptance/smmu.py diff --git a/MAINTAINERS b/MAINTAINERS index c340bb02b0..148153d74f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -171,6 +171,7 @@ L: qemu-arm@nongnu.org S: Maintained F: hw/arm/smmu* F: include/hw/arm/smmu* +F: tests/acceptance/smmu.py AVR TCG CPUs M: Michael Rolnik diff --git a/tests/acceptance/smmu.py b/tests/acceptance/smmu.py new file mode 100644 index 0000000000..b3c4de6bf4 --- /dev/null +++ b/tests/acceptance/smmu.py @@ -0,0 +1,137 @@ +# SMMUv3 Functional tests +# +# Copyright (c) 2021 Red Hat, Inc. +# +# Author: +# Eric Auger +# +# 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 os + +from avocado import skipIf +from avocado_qemu import LinuxTest, BUILD_DIR + +@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') +class SMMU(LinuxTest): + """ + :avocado: tags=accel:kvm + :avocado: tags=cpu:host + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt + :avocado: tags=distro:fedora + :avocado: tags=smmu + """ + + IOMMU_ADDON = ',iommu_platform=on,disable-modern=off,disable-legacy=on' + kernel_path = None + initrd_path = None + kernel_params = None + + def set_up_boot(self): + path = self.download_boot() + self.vm.add_args('-device', 'virtio-blk-pci,bus=pcie.0,scsi=off,' + + 'drive=drv0,id=virtio-disk0,bootindex=1,' + 'werror=stop,rerror=stop' + self.IOMMU_ADDON) + self.vm.add_args('-drive', + 'file=%s,if=none,cache=writethrough,id=drv0' % path) + + def setUp(self): + super(SMMU, self).setUp(None, 'virtio-net-pci' + self.IOMMU_ADDON) + + def common_vm_setup(self, custom_kernel=False): + self.require_accelerator("kvm") + self.vm.add_args("-accel", "kvm") + self.vm.add_args("-cpu", "host") + self.vm.add_args("-machine", "iommu=smmuv3") + self.vm.add_args("-d", "guest_errors") + self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios', + 'edk2-aarch64-code.fd')) + self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0') + self.vm.add_args('-object', + 'rng-random,id=rng0,filename=/dev/urandom') + + if custom_kernel is False: + return + + kernel_url = self.distro.pxeboot_url + 'vmlinuz' + initrd_url = self.distro.pxeboot_url + 'initrd.img' + self.kernel_path = self.fetch_asset(kernel_url) + self.initrd_path = self.fetch_asset(initrd_url) + + def run_and_check(self): + if self.kernel_path: + self.vm.add_args('-kernel', self.kernel_path, + '-append', self.kernel_params, + '-initrd', self.initrd_path) + self.launch_and_wait() + self.ssh_command('cat /proc/cmdline') + self.ssh_command('dnf -y install numactl-devel') + + + # 5.3 kernel without RIL # + + def test_smmu_noril(self): + """ + :avocado: tags=smmu_noril + :avocado: tags=smmu_noril_tests + :avocado: tags=distro_version:31 + """ + self.common_vm_setup() + self.run_and_check() + + def test_smmu_noril_passthrough(self): + """ + :avocado: tags=smmu_noril_passthrough + :avocado: tags=smmu_noril_tests + :avocado: tags=distro_version:31 + """ + self.common_vm_setup(True) + self.kernel_params = (self.distro.default_kernel_params + + ' iommu.passthrough=on') + self.run_and_check() + + def test_smmu_noril_nostrict(self): + """ + :avocado: tags=smmu_noril_nostrict + :avocado: tags=smmu_noril_tests + :avocado: tags=distro_version:31 + """ + self.common_vm_setup(True) + self.kernel_params = (self.distro.default_kernel_params + + ' iommu.strict=0') + self.run_and_check() + + # 5.8 kernel featuring range invalidation + # >= v5.7 kernel + + def test_smmu_ril(self): + """ + :avocado: tags=smmu_ril + :avocado: tags=smmu_ril_tests + :avocado: tags=distro_version:33 + """ + self.common_vm_setup() + self.run_and_check() + + def test_smmu_ril_passthrough(self): + """ + :avocado: tags=smmu_ril_passthrough + :avocado: tags=smmu_ril_tests + :avocado: tags=distro_version:33 + """ + self.common_vm_setup(True) + self.kernel_params = (self.distro.default_kernel_params + + ' iommu.passthrough=on') + self.run_and_check() + + def test_smmu_ril_nostrict(self): + """ + :avocado: tags=smmu_ril_nostrict + :avocado: tags=smmu_ril_tests + :avocado: tags=distro_version:33 + """ + self.common_vm_setup(True) + self.kernel_params = (self.distro.default_kernel_params + + ' iommu.strict=0') + self.run_and_check() From patchwork Tue Jul 13 21:19:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504861 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QDrXrTDK; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYbb5YDWz9sX3 for ; Wed, 14 Jul 2021 07:26:19 +1000 (AEST) Received: from localhost ([::1]:38830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Puz-0002nm-CK for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:26:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PqG-0002gZ-2Q for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PqC-0008Su-IV for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JtX7+yJJi9eBr6Yjxo5IXUWuTnmp8evQVTVARjL0NOU=; b=QDrXrTDK7TxQ/jvJJWp1wm2Kkpa9ezfpwSbaFJrqnXReB83dN7hE1y5q7PCy1pEUmPWfZt vGZDLkJ1NcwuirNbvH66+eSZQ/XiFzSP4ULO4+E+ruvHN6cMEvGlAuTXPgAgJezHKtPMx1 NCf1pm7Av5gpljuMpqqa6bxZ1UB9yIc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-TYmfDntyMKalfrS6Fcf_RQ-1; Tue, 13 Jul 2021 17:21:18 -0400 X-MC-Unique: TYmfDntyMKalfrS6Fcf_RQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D5A0100B3B4; Tue, 13 Jul 2021 21:21:16 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85DCF19C44; Tue, 13 Jul 2021 21:20:59 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 11/23] avocado_qemu: Add Intel iommu tests Date: Tue, 13 Jul 2021 17:19:11 -0400 Message-Id: <20210713211923.3809241-12-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Peter Xu , Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger Add Intel IOMMU functional tests based on fedora 31. Different configs are checked: - strict - caching mode, strict - passthrough. Signed-off-by: Eric Auger Signed-off-by: Willian Rampazzo Tested-by: Wainer dos Santos Moschetta Acked-by: Peter Xu Message-Id: <20210706131729.30749-5-eric.auger@redhat.com> [CR: split long lines] Signed-off-by: Cleber Rosa --- tests/acceptance/intel_iommu.py | 119 ++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 tests/acceptance/intel_iommu.py diff --git a/tests/acceptance/intel_iommu.py b/tests/acceptance/intel_iommu.py new file mode 100644 index 0000000000..474d62f6bf --- /dev/null +++ b/tests/acceptance/intel_iommu.py @@ -0,0 +1,119 @@ +# INTEL_IOMMU Functional tests +# +# Copyright (c) 2021 Red Hat, Inc. +# +# Author: +# Eric Auger +# +# 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 os + +from avocado import skipIf +from avocado_qemu import LinuxTest + +@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab') +class IntelIOMMU(LinuxTest): + """ + :avocado: tags=arch:x86_64 + :avocado: tags=distro:fedora + :avocado: tags=distro_version:31 + :avocado: tags=machine:q35 + :avocado: tags=accel:kvm + :avocado: tags=intel_iommu + """ + + IOMMU_ADDON = ',iommu_platform=on,disable-modern=off,disable-legacy=on' + kernel_path = None + initrd_path = None + kernel_params = None + + def set_up_boot(self): + path = self.download_boot() + self.vm.add_args('-device', 'virtio-blk-pci,bus=pcie.0,scsi=off,' + + 'drive=drv0,id=virtio-disk0,bootindex=1,' + 'werror=stop,rerror=stop' + self.IOMMU_ADDON) + self.vm.add_args('-device', 'virtio-gpu-pci' + self.IOMMU_ADDON) + self.vm.add_args('-drive', + 'file=%s,if=none,cache=writethrough,id=drv0' % path) + + def setUp(self): + super(IntelIOMMU, self).setUp(None, 'virtio-net-pci' + self.IOMMU_ADDON) + + def add_common_args(self): + self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0') + self.vm.add_args('-object', + 'rng-random,id=rng0,filename=/dev/urandom') + + def common_vm_setup(self, custom_kernel=None): + self.require_accelerator("kvm") + self.add_common_args() + self.vm.add_args("-accel", "kvm") + + if custom_kernel is None: + return + + kernel_url = self.distro.pxeboot_url + 'vmlinuz' + initrd_url = self.distro.pxeboot_url + 'initrd.img' + self.kernel_path = self.fetch_asset(kernel_url) + self.initrd_path = self.fetch_asset(initrd_url) + + def run_and_check(self): + if self.kernel_path: + self.vm.add_args('-kernel', self.kernel_path, + '-append', self.kernel_params, + '-initrd', self.initrd_path) + self.launch_and_wait() + self.ssh_command('cat /proc/cmdline') + self.ssh_command('dmesg | grep -e DMAR -e IOMMU') + self.ssh_command('find /sys/kernel/iommu_groups/ -type l') + self.ssh_command('dnf -y install numactl-devel') + + def test_intel_iommu(self): + """ + :avocado: tags=intel_iommu_intremap + """ + + self.common_vm_setup(True) + self.vm.add_args('-device', 'intel-iommu,intremap=on') + self.vm.add_args('-machine', 'kernel_irqchip=split') + + self.kernel_params = (self.distro.default_kernel_params + + ' quiet intel_iommu=on') + self.run_and_check() + + def test_intel_iommu_strict(self): + """ + :avocado: tags=intel_iommu_strict + """ + + self.common_vm_setup(True) + self.vm.add_args('-device', 'intel-iommu,intremap=on') + self.vm.add_args('-machine', 'kernel_irqchip=split') + self.kernel_params = (self.distro.default_kernel_params + + ' quiet intel_iommu=on,strict') + self.run_and_check() + + def test_intel_iommu_strict_cm(self): + """ + :avocado: tags=intel_iommu_strict_cm + """ + + self.common_vm_setup(True) + self.vm.add_args('-device', 'intel-iommu,intremap=on,caching-mode=on') + self.vm.add_args('-machine', 'kernel_irqchip=split') + self.kernel_params = (self.distro.default_kernel_params + + ' quiet intel_iommu=on,strict') + self.run_and_check() + + def test_intel_iommu_pt(self): + """ + :avocado: tags=intel_iommu_pt + """ + + self.common_vm_setup(True) + self.vm.add_args('-device', 'intel-iommu,intremap=on') + self.vm.add_args('-machine', 'kernel_irqchip=split') + self.kernel_params = (self.distro.default_kernel_params + + ' quiet intel_iommu=on iommu=pt') + self.run_and_check() From patchwork Tue Jul 13 21:19:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bwsvmX9x; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYqM6M4Hz9sX2 for ; Wed, 14 Jul 2021 07:36:31 +1000 (AEST) Received: from localhost ([::1]:44796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q4r-0000wG-Ih for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:36:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PqJ-0002uQ-QP for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PqH-00004q-Og for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t5bMoV8DVyKDKClunF8PHt3LKrK6DZFobxjtihc5tp4=; b=bwsvmX9xOY2XEHOo16IrNq6anq645ZTBISO5F71Qf6Scm6P0FkpNic0Mp0aUhpdD3Xe2P1 V6MSvpQJ6bRG1lq5iA91Xapl1UcrD++9iyvtr38v9pPFcuCuIX8SzgpH/qoU/rwHH4bqKY KL10veat+dP4EwxBVc0GbLZPluJWdUc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-557-Xf6dxCVFPQe39GKnYlLu3w-1; Tue, 13 Jul 2021 17:21:21 -0400 X-MC-Unique: Xf6dxCVFPQe39GKnYlLu3w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6C411084F4B; Tue, 13 Jul 2021 21:21:18 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79CE519C44; Tue, 13 Jul 2021 21:21:16 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 12/23] tests/acceptance: Tag NetBSD tests as 'os:netbsd' Date: Tue, 13 Jul 2021 17:19:12 -0400 Message-Id: <20210713211923.3809241-13-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , Niek Linnenbank , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Avocado allows us to select set of tests using tags. When wanting to run all tests using a NetBSD guest OS, it is convenient to have them tagged, add the 'os:netbsd' tag. It allows one to run the NetBSD tests with: $ avocado --show=app,console run -t os:netbsd tests/acceptance/ Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210623180021.898286-4-f4bug@amsat.org> Reviewed-by: Niek Linnenbank Reviewed-by: Willian Rampazzo Reviewed-by: Cleber Rosa [PMD: ammend the commit message with example command] Signed-off-by: Cleber Rosa --- tests/acceptance/boot_linux_console.py | 1 + tests/acceptance/ppc_prep_40p.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 3ae11a7a8f..0a8222f17d 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -905,6 +905,7 @@ def test_arm_orangepi_uboot_netbsd9(self): :avocado: tags=arch:arm :avocado: tags=machine:orangepi-pc :avocado: tags=device:sd + :avocado: tags=os:netbsd """ # This test download a 304MB compressed image and expand it to 2GB deb_url = ('http://snapshot.debian.org/archive/debian/' diff --git a/tests/acceptance/ppc_prep_40p.py b/tests/acceptance/ppc_prep_40p.py index 96ba13b894..2993ee3b07 100644 --- a/tests/acceptance/ppc_prep_40p.py +++ b/tests/acceptance/ppc_prep_40p.py @@ -27,6 +27,7 @@ def test_factory_firmware_and_netbsd(self): """ :avocado: tags=arch:ppc :avocado: tags=machine:40p + :avocado: tags=os:netbsd :avocado: tags=slowness:high """ bios_url = ('http://ftpmirror.your.org/pub/misc/' @@ -64,6 +65,7 @@ def test_openbios_and_netbsd(self): """ :avocado: tags=arch:ppc :avocado: tags=machine:40p + :avocado: tags=os:netbsd """ drive_url = ('https://cdn.netbsd.org/pub/NetBSD/iso/7.1.2/' 'NetBSD-7.1.2-prep.iso') From patchwork Tue Jul 13 21:19:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Yn8a9cp5; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYfd27VZz9sX2 for ; Wed, 14 Jul 2021 07:28:57 +1000 (AEST) Received: from localhost ([::1]:49464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3PxW-0001sk-Va for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:28:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PqT-0003Kg-Pp for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PqS-0000CP-8v for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UhXgC4zJbg4b1kov60jazcjIPEWd3z4BiZLh6vYghKM=; b=Yn8a9cp5vwJ1GfkVz7GKrWtZ24g/EgO2uZneEuQ28y8eUAgVT8vlrTTtmB/BBsMigvk68U YHkIhnGx3bE0B/KUKiKH/NL5uaawLNDbljfs/8HuXo2J63PzzNWQmJbdkpOVn2OZYmy7/w 7Yzt/N62pWZvWlGilDtvKBLd5XyE7mQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-1_lTN5I8N8WcwGseGd1A_A-1; Tue, 13 Jul 2021 17:21:34 -0400 X-MC-Unique: 1_lTN5I8N8WcwGseGd1A_A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 08C5418414A0; Tue, 13 Jul 2021 21:21:32 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0EBF019C44; Tue, 13 Jul 2021 21:21:18 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 13/23] tests/acceptance: Automatic set -cpu to the test vm Date: Tue, 13 Jul 2021 17:19:13 -0400 Message-Id: <20210713211923.3809241-14-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta This introduces a new feature to the functional tests: automatic setting of the '-cpu VALUE' option to the created vm if the test is tagged with 'cpu:VALUE'. The 'cpu' property is made available to the test object as well. For example, for a simple test as: def test(self): """ :avocado: tags=cpu:host """ self.assertEqual(self.cpu, "host") self.vm.launch() The resulting QEMU evocation will be like: qemu-system-x86_64 -display none -vga none \ -chardev socket,id=mon,path=/var/tmp/avo_qemu_sock_pdgzbgd_/qemu-1135557-monitor.sock \ -mon chardev=mon,mode=control -cpu host Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Reviewed-by: Willian Rampazzo Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20210430133414.39905-2-wainersm@redhat.com> Signed-off-by: Cleber Rosa --- docs/devel/testing.rst | 17 +++++++++++++++++ tests/acceptance/avocado_qemu/__init__.py | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 19cbf532ae..8f572255d3 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -904,6 +904,17 @@ 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=arch:VALUE`` tag, it will be set to ``VALUE``. +cpu +~~~ + +The cpu model that will be set to all QEMUMachine instances created +by the test. + +The ``cpu`` 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=cpu:VALUE`` tag, it will be set to ``VALUE``. + machine ~~~~~~~ @@ -983,6 +994,12 @@ architecture of a kernel or disk image to boot a VM with. This parameter has a direct relation with the ``arch`` attribute. If not given, it will default to None. +cpu +~~~ + +The cpu model that will be set to all QEMUMachine instances created +by the test. + machine ~~~~~~~ diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 1de1edce0d..3a218057b3 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -213,6 +213,9 @@ def setUp(self): self.arch = self.params.get('arch', default=self._get_unique_tag_val('arch')) + self.cpu = self.params.get('cpu', + default=self._get_unique_tag_val('cpu')) + self.machine = self.params.get('machine', default=self._get_unique_tag_val('machine')) @@ -242,6 +245,8 @@ def get_vm(self, *args, name=None): name = str(uuid.uuid4()) if self._vms.get(name) is None: self._vms[name] = self._new_vm(name, *args) + if self.cpu is not None: + self._vms[name].add_args('-cpu', self.cpu) if self.machine is not None: self._vms[name].set_machine(self.machine) return self._vms[name] From patchwork Tue Jul 13 21:19:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KonnLPEN; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYgs1k0lz9sX3 for ; Wed, 14 Jul 2021 07:30:01 +1000 (AEST) Received: from localhost ([::1]:51828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3PyY-0003XS-Sc for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:29:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PqY-0003Np-Ch for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57403) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PqV-0000Em-2L for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VXdPZlAI6IeP711DAhs2nOIOrrqgzKNYegZ/vaXgSrs=; b=KonnLPENrgVVAx90KyD7oBZEbefalyD9p8Kh2Cdu56G3RLcHMTRJFplrY4zL1QJGYjtr8p OUV1BIp/QHaBgDlh9qSoZkeW1xXDNDVRg4SJe0L0RDF5YWmKDeexOl5htJofiD9sqorI+S nFPX4opsIPhmR0WtdObW8muykhDumco= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187-kaA4uqGIOYCrp9wUR5pacg-1; Tue, 13 Jul 2021 17:21:36 -0400 X-MC-Unique: kaA4uqGIOYCrp9wUR5pacg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FCF11084F4B; Tue, 13 Jul 2021 21:21:34 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2809F19C44; Tue, 13 Jul 2021 21:21:32 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 14/23] tests/acceptance: Fix mismatch on cpu tagged tests Date: Tue, 13 Jul 2021 17:19:14 -0400 Message-Id: <20210713211923.3809241-15-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta There are test cases on machine_mips_malta.py and tcg_plugins.py files where the cpu tag does not correspond to the value actually given to the QEMU binary. This fixed those tests tags. Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Reviewed-by: Willian Rampazzo Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20210430133414.39905-3-wainersm@redhat.com> Signed-off-by: Cleber Rosa --- tests/acceptance/machine_mips_malta.py | 6 +++--- tests/acceptance/tcg_plugins.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/machine_mips_malta.py b/tests/acceptance/machine_mips_malta.py index 7c9a4ee4d2..b1fd075f51 100644 --- a/tests/acceptance/machine_mips_malta.py +++ b/tests/acceptance/machine_mips_malta.py @@ -96,7 +96,7 @@ def test_mips_malta_i6400_framebuffer_logo_1core(self): """ :avocado: tags=arch:mips64el :avocado: tags=machine:malta - :avocado: tags=cpu:i6400 + :avocado: tags=cpu:I6400 """ self.do_test_i6400_framebuffer_logo(1) @@ -105,7 +105,7 @@ def test_mips_malta_i6400_framebuffer_logo_7cores(self): """ :avocado: tags=arch:mips64el :avocado: tags=machine:malta - :avocado: tags=cpu:i6400 + :avocado: tags=cpu:I6400 :avocado: tags=mips:smp """ self.do_test_i6400_framebuffer_logo(7) @@ -115,7 +115,7 @@ def test_mips_malta_i6400_framebuffer_logo_8cores(self): """ :avocado: tags=arch:mips64el :avocado: tags=machine:malta - :avocado: tags=cpu:i6400 + :avocado: tags=cpu:I6400 :avocado: tags=mips:smp """ self.do_test_i6400_framebuffer_logo(8) diff --git a/tests/acceptance/tcg_plugins.py b/tests/acceptance/tcg_plugins.py index c21bf9e52a..aa6e18b62d 100644 --- a/tests/acceptance/tcg_plugins.py +++ b/tests/acceptance/tcg_plugins.py @@ -68,7 +68,7 @@ def test_aarch64_virt_insn(self): :avocado: tags=accel:tcg :avocado: tags=arch:aarch64 :avocado: tags=machine:virt - :avocado: tags=cpu:cortex-a57 + :avocado: tags=cpu:cortex-a53 """ kernel_path = self._grab_aarch64_kernel() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + @@ -95,7 +95,7 @@ def test_aarch64_virt_insn_icount(self): :avocado: tags=accel:tcg :avocado: tags=arch:aarch64 :avocado: tags=machine:virt - :avocado: tags=cpu:cortex-a57 + :avocado: tags=cpu:cortex-a53 """ kernel_path = self._grab_aarch64_kernel() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + @@ -121,7 +121,7 @@ def test_aarch64_virt_mem_icount(self): :avocado: tags=accel:tcg :avocado: tags=arch:aarch64 :avocado: tags=machine:virt - :avocado: tags=cpu:cortex-a57 + :avocado: tags=cpu:cortex-a53 """ kernel_path = self._grab_aarch64_kernel() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + From patchwork Tue Jul 13 21:19:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BAa9CO3q; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYtM3m09z9sXJ for ; Wed, 14 Jul 2021 07:39:07 +1000 (AEST) Received: from localhost ([::1]:53330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q7N-0006ch-78 for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:39:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqg-0003TE-Je for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqb-0000M5-PW for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jIPqrucXgCQLRwS3ADnW9VQVQAYQkQWhk23O+X1mY7w=; b=BAa9CO3q/j8BNMrdW5+g/7HcI27tJq39RKEOg7tYtMyCkqgm/YpCHn/n67brDi3DDiOEgV 0H8lMgLF9eqXA1212BTpC79R2WIZSC+p9Hu/T3OP1GZwp50yRKqJL/w7U1HNUzdPshv4vE Ozhnc0bVrr/z8cKnBjCMzL9fy/IddhU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-541-PV9AiBsxPZG7R1dC6e0p4A-1; Tue, 13 Jul 2021 17:21:39 -0400 X-MC-Unique: PV9AiBsxPZG7R1dC6e0p4A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E0936802C80; Tue, 13 Jul 2021 21:21:36 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F0DD19C44; Tue, 13 Jul 2021 21:21:34 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 15/23] tests/acceptance: Let the framework handle "cpu:VALUE" tagged tests Date: Tue, 13 Jul 2021 17:19:15 -0400 Message-Id: <20210713211923.3809241-16-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta The tests that are already tagged with "cpu:VALUE" don't need to add "-cpu VALUE" to the list of arguments of the vm object because the avocado_qemu framework is able to handle it automatically. Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Reviewed-by: Willian Rampazzo Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20210430133414.39905-4-wainersm@redhat.com> Signed-off-by: Cleber Rosa --- tests/acceptance/boot_linux.py | 3 --- tests/acceptance/boot_xen.py | 1 - tests/acceptance/machine_mips_malta.py | 1 - tests/acceptance/replay_kernel.py | 8 +++----- tests/acceptance/reverse_debugging.py | 2 +- tests/acceptance/tcg_plugins.py | 9 ++++----- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 34c4366366..ab19146d1e 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -79,7 +79,6 @@ def test_virt_tcg_gicv2(self): """ self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") - self.vm.add_args("-cpu", "max") self.vm.add_args("-machine", "virt,gic-version=2") self.add_common_args() self.launch_and_wait(set_up_ssh_connection=False) @@ -92,7 +91,6 @@ def test_virt_tcg_gicv3(self): """ self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") - self.vm.add_args("-cpu", "max") self.vm.add_args("-machine", "virt,gic-version=3") self.add_common_args() self.launch_and_wait(set_up_ssh_connection=False) @@ -104,7 +102,6 @@ def test_virt_kvm(self): """ self.require_accelerator("kvm") self.vm.add_args("-accel", "kvm") - self.vm.add_args("-cpu", "host") self.vm.add_args("-machine", "virt,gic-version=host") self.add_common_args() self.launch_and_wait(set_up_ssh_connection=False) diff --git a/tests/acceptance/boot_xen.py b/tests/acceptance/boot_xen.py index 75c2d44492..3479b5233b 100644 --- a/tests/acceptance/boot_xen.py +++ b/tests/acceptance/boot_xen.py @@ -48,7 +48,6 @@ def launch_xen(self, xen_path): xen_command_line = self.XEN_COMMON_COMMAND_LINE self.vm.add_args('-machine', 'virtualization=on', - '-cpu', 'cortex-a57', '-m', '768', '-kernel', xen_path, '-append', xen_command_line, diff --git a/tests/acceptance/machine_mips_malta.py b/tests/acceptance/machine_mips_malta.py index b1fd075f51..b67d8cb141 100644 --- a/tests/acceptance/machine_mips_malta.py +++ b/tests/acceptance/machine_mips_malta.py @@ -62,7 +62,6 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count): kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'clocksource=GIC console=tty0 console=ttyS0') self.vm.add_args('-kernel', kernel_path, - '-cpu', 'I6400', '-smp', '%u' % cpu_cores_count, '-vga', 'std', '-append', kernel_command_line) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_kernel.py index 71facdaa75..75f80506c1 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -156,8 +156,7 @@ def test_aarch64_virt(self): 'console=ttyAMA0') console_pattern = 'VFS: Cannot open root device' - self.run_rr(kernel_path, kernel_command_line, console_pattern, - args=('-cpu', 'cortex-a53')) + self.run_rr(kernel_path, kernel_command_line, console_pattern) def test_arm_virt(self): """ @@ -301,7 +300,7 @@ def test_ppc64_e500(self): tar_url = ('https://www.qemu-advent-calendar.org' '/2018/download/day19.tar.xz') file_path = self.fetch_asset(tar_url, asset_hash=tar_hash) - self.do_test_advcal_2018(file_path, 'uImage', ('-cpu', 'e5500')) + self.do_test_advcal_2018(file_path, 'uImage') def test_ppc_g3beige(self): """ @@ -348,8 +347,7 @@ def test_xtensa_lx60(self): tar_url = ('https://www.qemu-advent-calendar.org' '/2018/download/day02.tar.xz') file_path = self.fetch_asset(tar_url, asset_hash=tar_hash) - self.do_test_advcal_2018(file_path, 'santas-sleigh-ride.elf', - args=('-cpu', 'dc233c')) + self.do_test_advcal_2018(file_path, 'santas-sleigh-ride.elf') @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') class ReplayKernelSlow(ReplayKernelBase): diff --git a/tests/acceptance/reverse_debugging.py b/tests/acceptance/reverse_debugging.py index be01aca217..d2921e70c3 100644 --- a/tests/acceptance/reverse_debugging.py +++ b/tests/acceptance/reverse_debugging.py @@ -207,4 +207,4 @@ def test_aarch64_virt(self): kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) self.reverse_debugging( - args=('-kernel', kernel_path, '-cpu', 'cortex-a53')) + args=('-kernel', kernel_path)) diff --git a/tests/acceptance/tcg_plugins.py b/tests/acceptance/tcg_plugins.py index aa6e18b62d..9ca1515c3b 100644 --- a/tests/acceptance/tcg_plugins.py +++ b/tests/acceptance/tcg_plugins.py @@ -25,7 +25,7 @@ class PluginKernelBase(LinuxKernelTest): KERNEL_COMMON_COMMAND_LINE = 'printk.time=1 panic=-1 ' def run_vm(self, kernel_path, kernel_command_line, - plugin, plugin_log, console_pattern, args): + plugin, plugin_log, console_pattern, args=None): vm = self.get_vm() vm.set_console() @@ -80,8 +80,7 @@ def test_aarch64_virt_insn(self): self.run_vm(kernel_path, kernel_command_line, "tests/plugin/libinsn.so", plugin_log.name, - console_pattern, - args=('-cpu', 'cortex-a53')) + console_pattern) with plugin_log as lf, \ mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s: @@ -108,7 +107,7 @@ def test_aarch64_virt_insn_icount(self): self.run_vm(kernel_path, kernel_command_line, "tests/plugin/libinsn.so", plugin_log.name, console_pattern, - args=('-cpu', 'cortex-a53', '-icount', 'shift=1')) + args=('-icount', 'shift=1')) with plugin_log as lf, \ mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s: @@ -134,7 +133,7 @@ def test_aarch64_virt_mem_icount(self): self.run_vm(kernel_path, kernel_command_line, "tests/plugin/libmem.so,arg=both", plugin_log.name, console_pattern, - args=('-cpu', 'cortex-a53', '-icount', 'shift=1')) + args=('-icount', 'shift=1')) with plugin_log as lf, \ mmap.mmap(lf.fileno(), 0, access=mmap.ACCESS_READ) as s: From patchwork Tue Jul 13 21:19:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504874 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=heBsZsNa; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYls0Hsjz9sX2 for ; Wed, 14 Jul 2021 07:33:29 +1000 (AEST) Received: from localhost ([::1]:33204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q1u-0001d2-Kn for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:33:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqi-0003Td-6y for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqe-0000Op-EV for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:21:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=snt2gY+1Tn6roJs4CdC0FTTEVPWvkwPrgfRH/7pXsGU=; b=heBsZsNa7g0nbDkVt6qrpNc8oqr6QpO/1l+loA06SzJEnsN09QaXrF/X/Wef1nwEkATrsS gkYW5+Dy/Izlzz2RMeD1D7/j0dqR+Zh437fYsmgcBki3PtxjdG+bi3C0uJIc2AC9lTqtKb m7TLNJ9cUTt2qwnx5nx7i0ZtqppDa88= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-129-vbfEFe9dOHaQ3kP_vUmGFQ-1; Tue, 13 Jul 2021 17:21:41 -0400 X-MC-Unique: vbfEFe9dOHaQ3kP_vUmGFQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7694B343CD; Tue, 13 Jul 2021 21:21:39 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CFC519C44; Tue, 13 Jul 2021 21:21:36 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 16/23] tests/acceptance: Tagging tests with "cpu:VALUE" Date: Tue, 13 Jul 2021 17:19:16 -0400 Message-Id: <20210713211923.3809241-17-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta The existing tests which are passing "-cpu VALUE" argument to the vm object are now properly "cpu:VALUE" tagged, so letting the avocado_qemu framework to handle that automatically. Reviewed-by: Cleber Rosa Reviewed-by: Willian Rampazzo Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20210430133414.39905-5-wainersm@redhat.com> Signed-off-by: Cleber Rosa --- tests/acceptance/boot_linux_console.py | 13 ++++++++----- tests/acceptance/pc_cpu_hotplug_props.py | 2 +- tests/acceptance/replay_kernel.py | 9 ++++++--- tests/acceptance/virtio-gpu.py | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 0a8222f17d..5248c8097d 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -239,6 +239,7 @@ def test_mips64el_malta_5KEc_cpio(self): :avocado: tags=arch:mips64el :avocado: tags=machine:malta :avocado: tags=endian:little + :avocado: tags=cpu:5KEc """ kernel_url = ('https://github.com/philmd/qemu-testing-blob/' 'raw/9ad2df38/mips/malta/mips64el/' @@ -258,8 +259,7 @@ def test_mips64el_malta_5KEc_cpio(self): kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0 console=tty ' + 'rdinit=/sbin/init noreboot') - self.vm.add_args('-cpu', '5KEc', - '-kernel', kernel_path, + self.vm.add_args('-kernel', kernel_path, '-initrd', initrd_path, '-append', kernel_command_line, '-no-reboot') @@ -287,7 +287,6 @@ def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash): + 'mem=256m@@0x0 ' + 'console=ttyS0') self.vm.add_args('-no-reboot', - '-cpu', 'I7200', '-kernel', kernel_path, '-append', kernel_command_line) self.vm.launch() @@ -299,6 +298,7 @@ def test_mips_malta32el_nanomips_4k(self): :avocado: tags=arch:mipsel :avocado: tags=machine:malta :avocado: tags=endian:little + :avocado: tags=cpu:I7200 """ kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' @@ -311,6 +311,7 @@ def test_mips_malta32el_nanomips_16k_up(self): :avocado: tags=arch:mipsel :avocado: tags=machine:malta :avocado: tags=endian:little + :avocado: tags=cpu:I7200 """ kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' @@ -323,6 +324,7 @@ def test_mips_malta32el_nanomips_64k_dbg(self): :avocado: tags=arch:mipsel :avocado: tags=machine:malta :avocado: tags=endian:little + :avocado: tags=cpu:I7200 """ kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' @@ -335,6 +337,7 @@ def test_aarch64_virt(self): :avocado: tags=arch:aarch64 :avocado: tags=machine:virt :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a53 """ kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' '/linux/releases/29/Everything/aarch64/os/images/pxeboot' @@ -1168,9 +1171,9 @@ def test_ppc64_e500(self): """ :avocado: tags=arch:ppc64 :avocado: tags=machine:ppce500 + :avocado: tags=cpu:e5500 """ tar_hash = '6951d86d644b302898da2fd701739c9406527fe1' - self.vm.add_args('-cpu', 'e5500') self.do_test_advcal_2018('19', tar_hash, 'uImage') def test_ppc_g3beige(self): @@ -1212,7 +1215,7 @@ def test_xtensa_lx60(self): """ :avocado: tags=arch:xtensa :avocado: tags=machine:lx60 + :avocado: tags=cpu:dc233c """ tar_hash = '49e88d9933742f0164b60839886c9739cb7a0d34' - self.vm.add_args('-cpu', 'dc233c') self.do_test_advcal_2018('02', tar_hash, 'santas-sleigh-ride.elf') diff --git a/tests/acceptance/pc_cpu_hotplug_props.py b/tests/acceptance/pc_cpu_hotplug_props.py index f48f68fc6b..2e86d5017a 100644 --- a/tests/acceptance/pc_cpu_hotplug_props.py +++ b/tests/acceptance/pc_cpu_hotplug_props.py @@ -25,11 +25,11 @@ class OmittedCPUProps(Test): """ :avocado: tags=arch:x86_64 + :avocado: tags=cpu:qemu64 """ def test_no_die_id(self): self.vm.add_args('-nodefaults', '-S') self.vm.add_args('-smp', '1,sockets=2,cores=2,threads=2,maxcpus=8') - self.vm.add_args('-cpu', 'qemu64') self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0') self.vm.launch() self.assertEquals(len(self.vm.command('query-cpus-fast')), 2) diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_kernel.py index 75f80506c1..bb32b31240 100644 --- a/tests/acceptance/replay_kernel.py +++ b/tests/acceptance/replay_kernel.py @@ -392,6 +392,7 @@ def test_mips64el_malta_5KEc_cpio(self): :avocado: tags=machine:malta :avocado: tags=endian:little :avocado: tags=slowness:high + :avocado: tags=cpu:5KEc """ kernel_url = ('https://github.com/philmd/qemu-testing-blob/' 'raw/9ad2df38/mips/malta/mips64el/' @@ -412,7 +413,7 @@ def test_mips64el_malta_5KEc_cpio(self): 'rdinit=/sbin/init noreboot') console_pattern = 'Boot successful.' self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5, - args=('-initrd', initrd_path, '-cpu', '5KEc')) + args=('-initrd', initrd_path)) def do_test_mips_malta32el_nanomips(self, kernel_path_xz): kernel_path = self.workdir + "kernel" @@ -424,14 +425,14 @@ def do_test_mips_malta32el_nanomips(self, kernel_path_xz): 'mem=256m@@0x0 ' 'console=ttyS0') console_pattern = 'Kernel command line: %s' % kernel_command_line - self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5, - args=('-cpu', 'I7200')) + self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5) def test_mips_malta32el_nanomips_4k(self): """ :avocado: tags=arch:mipsel :avocado: tags=machine:malta :avocado: tags=endian:little + :avocado: tags=cpu:I7200 """ kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' @@ -445,6 +446,7 @@ def test_mips_malta32el_nanomips_16k_up(self): :avocado: tags=arch:mipsel :avocado: tags=machine:malta :avocado: tags=endian:little + :avocado: tags=cpu:I7200 """ kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' @@ -458,6 +460,7 @@ def test_mips_malta32el_nanomips_64k_dbg(self): :avocado: tags=arch:mipsel :avocado: tags=machine:malta :avocado: tags=endian:little + :avocado: tags=cpu:I7200 """ kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py index e7979343e9..589332c1b7 100644 --- a/tests/acceptance/virtio-gpu.py +++ b/tests/acceptance/virtio-gpu.py @@ -60,6 +60,7 @@ def test_virtio_vga_virgl(self): """ :avocado: tags=arch:x86_64 :avocado: tags=device:virtio-vga + :avocado: tags=cpu:host """ kernel_command_line = ( self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash" @@ -72,7 +73,6 @@ def test_virtio_vga_virgl(self): initrd_path = self.fetch_asset(self.INITRD_URL) self.vm.set_console() - self.vm.add_args("-cpu", "host") self.vm.add_args("-m", "2G") self.vm.add_args("-machine", "pc,accel=kvm") self.vm.add_args("-device", "virtio-vga,virgl=on") @@ -101,6 +101,7 @@ def test_vhost_user_vga_virgl(self): """ :avocado: tags=arch:x86_64 :avocado: tags=device:vhost-user-vga + :avocado: tags=cpu:host """ kernel_command_line = ( self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash" @@ -140,7 +141,6 @@ def test_vhost_user_vga_virgl(self): ) self.vm.set_console() - self.vm.add_args("-cpu", "host") self.vm.add_args("-m", "2G") self.vm.add_args("-object", "memory-backend-memfd,id=mem,size=2G") self.vm.add_args("-machine", "pc,memory-backend=mem,accel=kvm") From patchwork Tue Jul 13 21:19:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Dl/IGe1N; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYlN2zNpz9sX1 for ; Wed, 14 Jul 2021 07:33:04 +1000 (AEST) Received: from localhost ([::1]:59464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q1W-0000HR-4G for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:33:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqr-0003tp-AB for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqn-0000Vw-Rl for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lMX7ki4cnbCXlmpVeEr19Jl9NrQG84YK8sEiItrl4SU=; b=Dl/IGe1Nk7G8TeFdChLt2u2unzAdWTGLKozOhvJZR6jdElMUHnpGS9WSvCXRDnRyRp8GDf pAvslP47mpbs78Rnwzc1rOuBcV9zd1tnPV0q8TQ96WLf73ECQ2zDL42kaGn0Gh8j1o8I9x fB3hTfS9LdLns3ndwzyWIxsiJHEizGQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-295-scmEGFtzO_uDP9e8vNDNPg-1; Tue, 13 Jul 2021 17:21:55 -0400 X-MC-Unique: scmEGFtzO_uDP9e8vNDNPg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4FC081084F4B; Tue, 13 Jul 2021 21:21:53 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9203E19C44; Tue, 13 Jul 2021 21:21:39 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 17/23] python/qemu: Add args property to the QEMUMachine class Date: Tue, 13 Jul 2021 17:19:17 -0400 Message-Id: <20210713211923.3809241-18-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta This added the args property to QEMUMachine so that users of the class can access and handle the list of arguments to be given to the QEMU binary. Reviewed-by: Cleber Rosa Reviewed-by: Willian Rampazzo Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20210430133414.39905-6-wainersm@redhat.com> Signed-off-by: Cleber Rosa --- python/qemu/machine/machine.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 94846dd71b..971ed7e8c6 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -316,6 +316,11 @@ def _base_args(self) -> List[str]: args.extend(['-device', device]) return args + @property + def args(self) -> List[str]: + """Returns the list of arguments given to the QEMU binary.""" + return self._args + def _pre_launch(self) -> None: if self._console_set: self._remove_files.append(self._console_address) From patchwork Tue Jul 13 21:19:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CSBgz1cu; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYpp0dgtz9sX2 for ; Wed, 14 Jul 2021 07:36:02 +1000 (AEST) Received: from localhost ([::1]:41944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q4N-0007OW-Ol for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:35:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqt-0003w6-3r for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqr-0000Y3-1Q for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EL0S1BsutMs8Xb80zGucKtSMGZAlWUUZ9gPC25goyNY=; b=CSBgz1cuvXIsFrpRW6FwqKYPNt7ZFn68xvt2dICpycugAHvg9PyAaEPyqAnq0qgSTyognR Z7XPp6v8LqopihXVsThJ/xiPxzOda8f4UdqLZ5FdhgiXcIgYLRuS6JbHm8C7Q8tpKhv5Sp smZNi6HhX37wBU6Bko6HJSoTRjLlwA0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-aeqxeJ0BO8e2eOMEhP_WMA-1; Tue, 13 Jul 2021 17:21:58 -0400 X-MC-Unique: aeqxeJ0BO8e2eOMEhP_WMA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D663B100B3AD; Tue, 13 Jul 2021 21:21:55 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FC4A19C44; Tue, 13 Jul 2021 21:21:53 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 18/23] tests/acceptance: Add set_vm_arg() to the Test class Date: Tue, 13 Jul 2021 17:19:18 -0400 Message-Id: <20210713211923.3809241-19-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta The set_vm_arg method is added to avocado_qemu.Test class on this change. Use that method to set (or replace) an argument to the list of arguments given to the QEMU binary. Suggested-by: Cleber Rosa Signed-off-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo Message-Id: <20210430133414.39905-7-wainersm@redhat.com> Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 3a218057b3..2c4fef3e14 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -251,6 +251,27 @@ def get_vm(self, *args, name=None): self._vms[name].set_machine(self.machine) return self._vms[name] + def set_vm_arg(self, arg, value): + """ + Set an argument to list of extra arguments to be given to the QEMU + binary. If the argument already exists then its value is replaced. + + :param arg: the QEMU argument, such as "-cpu" in "-cpu host" + :type arg: str + :param value: the argument value, such as "host" in "-cpu host" + :type value: str + """ + if not arg or not value: + return + if arg not in self.vm.args: + self.vm.args.extend([arg, value]) + else: + idx = self.vm.args.index(arg) + 1 + if idx < len(self.vm.args): + self.vm.args[idx] = value + else: + self.vm.args.append(value) + def tearDown(self): for vm in self._vms.values(): vm.shutdown() From patchwork Tue Jul 13 21:19:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L5hTwZVI; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYpn4bcNz9sX1 for ; Wed, 14 Jul 2021 07:36:01 +1000 (AEST) Received: from localhost ([::1]:41768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q4N-0007Ht-AE for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:35:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqu-0003xH-Ok for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqs-0000Yz-UR for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zsU0FTFf2rMachGGbCL/tF0cIh/ZF+yOJZdnct0Lkq0=; b=L5hTwZVI8mG6pa4qDOgSxUME5sEqzrdWBpvRoDfHZ1Ta52T07r/AmUhLGla1zQsLBTxoTL TdO+fqRcXWX8Z37IcvhYfmtlEAFF3MiEcMzpGsTzOpH+2UD3dgiNSQQwAefroKMlNyBiz/ x7IuQ+QOa0Wic79Ngl5DjPwWUFPGnu4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-ePkmP2fKMMO6JuY_FgbEWw-1; Tue, 13 Jul 2021 17:22:00 -0400 X-MC-Unique: ePkmP2fKMMO6JuY_FgbEWw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 54D4E100B3AC; Tue, 13 Jul 2021 21:21:58 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 036FA19C44; Tue, 13 Jul 2021 21:21:55 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 19/23] tests/acceptance: Handle cpu tag on x86_cpu_model_versions tests Date: Tue, 13 Jul 2021 17:19:19 -0400 Message-Id: <20210713211923.3809241-20-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta Some test cases on x86_cpu_model_versions.py are corner cases because they need to pass extra options to the -cpu argument. Once the avocado_qemu framework will set -cpu automatically, the value should be reset. This changed those tests so to call set_vm_arg() to overwrite the -cpu value. Signed-off-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo Message-Id: <20210430133414.39905-8-wainersm@redhat.com> Signed-off-by: Cleber Rosa --- tests/acceptance/x86_cpu_model_versions.py | 40 +++++++++++++++++----- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/tests/acceptance/x86_cpu_model_versions.py b/tests/acceptance/x86_cpu_model_versions.py index 77ed8597a4..0e9feda62d 100644 --- a/tests/acceptance/x86_cpu_model_versions.py +++ b/tests/acceptance/x86_cpu_model_versions.py @@ -252,10 +252,13 @@ def get_cpu_prop(self, prop): def test_4_1(self): """ :avocado: tags=machine:pc-i440fx-4.1 + :avocado: tags=cpu:Cascadelake-Server """ # machine-type only: self.vm.add_args('-S') - self.vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off') + self.set_vm_arg('-cpu', + 'Cascadelake-Server,x-force-features=on,check=off,' + 'enforce=off') self.vm.launch() self.assertFalse(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server should not have arch-capabilities') @@ -263,9 +266,12 @@ def test_4_1(self): def test_4_0(self): """ :avocado: tags=machine:pc-i440fx-4.0 + :avocado: tags=cpu:Cascadelake-Server """ self.vm.add_args('-S') - self.vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off') + self.set_vm_arg('-cpu', + 'Cascadelake-Server,x-force-features=on,check=off,' + 'enforce=off') self.vm.launch() self.assertFalse(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server should not have arch-capabilities') @@ -273,10 +279,13 @@ def test_4_0(self): def test_set_4_0(self): """ :avocado: tags=machine:pc-i440fx-4.0 + :avocado: tags=cpu:Cascadelake-Server """ # command line must override machine-type if CPU model is not versioned: self.vm.add_args('-S') - self.vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off,+arch-capabilities') + self.set_vm_arg('-cpu', + 'Cascadelake-Server,x-force-features=on,check=off,' + 'enforce=off,+arch-capabilities') self.vm.launch() self.assertTrue(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server,+arch-capabilities should have arch-capabilities') @@ -284,9 +293,12 @@ def test_set_4_0(self): def test_unset_4_1(self): """ :avocado: tags=machine:pc-i440fx-4.1 + :avocado: tags=cpu:Cascadelake-Server """ self.vm.add_args('-S') - self.vm.add_args('-cpu', 'Cascadelake-Server,x-force-features=on,check=off,enforce=off,-arch-capabilities') + self.set_vm_arg('-cpu', + 'Cascadelake-Server,x-force-features=on,check=off,' + 'enforce=off,-arch-capabilities') self.vm.launch() self.assertFalse(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server,-arch-capabilities should not have arch-capabilities') @@ -294,10 +306,13 @@ def test_unset_4_1(self): def test_v1_4_0(self): """ :avocado: tags=machine:pc-i440fx-4.0 + :avocado: tags=cpu:Cascadelake-Server """ # versioned CPU model overrides machine-type: self.vm.add_args('-S') - self.vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off') + self.set_vm_arg('-cpu', + 'Cascadelake-Server-v1,x-force-features=on,check=off,' + 'enforce=off') self.vm.launch() self.assertFalse(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server-v1 should not have arch-capabilities') @@ -305,9 +320,12 @@ def test_v1_4_0(self): def test_v2_4_0(self): """ :avocado: tags=machine:pc-i440fx-4.0 + :avocado: tags=cpu:Cascadelake-Server """ self.vm.add_args('-S') - self.vm.add_args('-cpu', 'Cascadelake-Server-v2,x-force-features=on,check=off,enforce=off') + self.set_vm_arg('-cpu', + 'Cascadelake-Server-v2,x-force-features=on,check=off,' + 'enforce=off') self.vm.launch() self.assertTrue(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server-v2 should have arch-capabilities') @@ -315,10 +333,13 @@ def test_v2_4_0(self): def test_v1_set_4_0(self): """ :avocado: tags=machine:pc-i440fx-4.0 + :avocado: tags=cpu:Cascadelake-Server """ # command line must override machine-type and versioned CPU model: self.vm.add_args('-S') - self.vm.add_args('-cpu', 'Cascadelake-Server-v1,x-force-features=on,check=off,enforce=off,+arch-capabilities') + self.set_vm_arg('-cpu', + 'Cascadelake-Server-v1,x-force-features=on,check=off,' + 'enforce=off,+arch-capabilities') self.vm.launch() self.assertTrue(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.0 + Cascadelake-Server-v1,+arch-capabilities should have arch-capabilities') @@ -326,9 +347,12 @@ def test_v1_set_4_0(self): def test_v2_unset_4_1(self): """ :avocado: tags=machine:pc-i440fx-4.1 + :avocado: tags=cpu:Cascadelake-Server """ self.vm.add_args('-S') - self.vm.add_args('-cpu', 'Cascadelake-Server-v2,x-force-features=on,check=off,enforce=off,-arch-capabilities') + self.set_vm_arg('-cpu', + 'Cascadelake-Server-v2,x-force-features=on,check=off,' + 'enforce=off,-arch-capabilities') self.vm.launch() self.assertFalse(self.get_cpu_prop('arch-capabilities'), 'pc-i440fx-4.1 + Cascadelake-Server-v2,-arch-capabilities should not have arch-capabilities') From patchwork Tue Jul 13 21:19:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Kftn5TqX; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYlp1rKhz9sX2 for ; Wed, 14 Jul 2021 07:33:26 +1000 (AEST) Received: from localhost ([::1]:32934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q1r-0001Rt-VJ for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:33:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqx-000440-1q for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Pqv-0000ay-Dy for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8VEQG7uRmU1E/VwX2Tg7eiPcHjc2JykR0vK+XzqfOgY=; b=Kftn5TqXHrGq06/Nqzic7Bn7mlfpnBFlm/Cn3X4Xd1twgEQVCDH5K+4Y6jj8lZouSAoMab bejGnYYLFY9DA0AbVYa+EZCx+45gP4mPffpoubGVKIr2f+DE+LJ9BExu1KYjdZvRl9w/BK LonbHt/2j4lbz9BxCmGDLyctgjnLTOo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-ZnyprlTUMD6sFsIYQmTQYA-1; Tue, 13 Jul 2021 17:22:03 -0400 X-MC-Unique: ZnyprlTUMD6sFsIYQmTQYA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D63D3802C87; Tue, 13 Jul 2021 21:22:00 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7578E19C44; Tue, 13 Jul 2021 21:21:58 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 20/23] python: Configure tox to skip missing interpreters Date: Tue, 13 Jul 2021 17:19:20 -0400 Message-Id: <20210713211923.3809241-21-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta Currently tox tests against the installed interpreters, however if any supported interpreter is absent then it will return fail. It seems not reasonable to expect developers to have all supported interpreters installed on their systems. Luckily tox can be configured to skip missing interpreters. This changed the tox setup so that missing interpreters are skipped by default. On the CI, however, we still want to enforce it tests against all supported. This way on CI the --skip-missing-interpreters=false option is passed to tox. Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20210630184546.456582-1-wainersm@redhat.com> Reviewed-by: Willian Rampazzo Reviewed-by: John Snow Signed-off-by: Cleber Rosa --- .gitlab-ci.d/static_checks.yml | 1 + python/Makefile | 5 ++++- python/setup.cfg | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.d/static_checks.yml b/.gitlab-ci.d/static_checks.yml index b01f6ec231..96dbd9e310 100644 --- a/.gitlab-ci.d/static_checks.yml +++ b/.gitlab-ci.d/static_checks.yml @@ -43,6 +43,7 @@ check-python-tox: - make -C python check-tox variables: GIT_DEPTH: 1 + QEMU_TOX_EXTRA_ARGS: --skip-missing-interpreters=false needs: job: python-container allow_failure: true diff --git a/python/Makefile b/python/Makefile index ac46ae33e7..fe27a3e12e 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,4 +1,5 @@ QEMU_VENV_DIR=.dev-venv +QEMU_TOX_EXTRA_ARGS ?= .PHONY: help help: @@ -15,6 +16,8 @@ help: @echo " These tests use the newest dependencies." @echo " Requires: Python 3.6 - 3.10, and tox." @echo " Hint (Fedora): 'sudo dnf install python3-tox python3.10'" + @echo " The variable QEMU_TOX_EXTRA_ARGS can be use to pass extra" + @echo " arguments to tox". @echo "" @echo "make check-dev:" @echo " Run tests in a venv against your default python3 version." @@ -87,7 +90,7 @@ check: .PHONY: check-tox check-tox: - @tox + @tox $(QEMU_TOX_EXTRA_ARGS) .PHONY: clean clean: diff --git a/python/setup.cfg b/python/setup.cfg index 11f71d5312..14bab90288 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -121,6 +121,7 @@ multi_line_output=3 [tox:tox] envlist = py36, py37, py38, py39, py310 +skip_missing_interpreters = true [testenv] allowlist_externals = make From patchwork Tue Jul 13 21:19:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BSPGEz0S; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYpl2XNMz9sX2 for ; Wed, 14 Jul 2021 07:35:58 +1000 (AEST) Received: from localhost ([::1]:41598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q4J-0007B7-Pn for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:35:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PrB-0004Ki-MQ for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PrA-0000j0-5d for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sWGl7pEtJ1J3FHqvu3ZJ1mgZQaatUycxUYwgyMO1Jyg=; b=BSPGEz0S3UoUec944Y79rqrAt7zVDPb+O2iR7gemMMYENcAN8g7w/qu2D6Pjo6nLre1HXu sFK2dOEl7rIZw0tq6ZIeZ5X5RI7BzPQ+ZjQA4eAQPlchW9wNzDvuqVKNKj8qWh2ZbdbJcL i7fmekYzqc0MP0BE4OorKAaaw8xgkq4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-203-ZSDzdpYbMRiDE69Y2FwJOg-1; Tue, 13 Jul 2021 17:22:16 -0400 X-MC-Unique: ZSDzdpYbMRiDE69Y2FwJOg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9CB96802C80; Tue, 13 Jul 2021 21:22:13 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 019FC19C44; Tue, 13 Jul 2021 21:22:00 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 21/23] Acceptance tests: do not try to reuse packages from the system Date: Tue, 13 Jul 2021 17:19:21 -0400 Message-Id: <20210713211923.3809241-22-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The premise behind the original behavior is that it would save people from downloading Avocado (and other dependencies) if already installed on the system. To be honest, I think it's extremely rare that the same versions described as dependencies will be available on most systems. But, the biggest motivations here are that: 1) Hacking on QEMU in the same system used to develop Avocado leads to confusion with regards to the exact bits that are being used; 2) Not reusing Python packages from system wide installations gives extra assurance that the same behavior will be seen from tests run on different machines; With regards to downloads, pip already caches the downloaded wheels and tarballs under ~/.cache/pip, so there should not be more than one download even if the venv is destroyed and recreated. Signed-off-by: Cleber Rosa Message-Id: <20210415215141.1865467-3-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo Reviewed-by: Wainer dos Santos Moschetta Signed-off-by: Cleber Rosa --- tests/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index e4dcb17329..6e16c05f10 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -96,7 +96,7 @@ AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGETS))) $(TESTS_VENV_DIR): $(TESTS_VENV_REQ) $(call quiet-command, \ - $(PYTHON) -m venv --system-site-packages $@, \ + $(PYTHON) -m venv $@, \ VENV, $@) $(call quiet-command, \ $(TESTS_VENV_DIR)/bin/python -m pip -q install -r $(TESTS_VENV_REQ), \ From patchwork Tue Jul 13 21:19:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Fq/SlV8f; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYst24S5z9sX1 for ; Wed, 14 Jul 2021 07:38:42 +1000 (AEST) Received: from localhost ([::1]:51596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q6x-0005Ul-Uu for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:38:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PrD-0004P5-42 for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PrA-0000m3-LX for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GRT3B5Wxzq0jFQitt44SK22Id/avAGWaSnYHAamy4vs=; b=Fq/SlV8fovt9OrQj7bW/VJw9jT9nwNhIYLRpjbH+XBh0aVain8UZrv+aZqWBpbH5s4No8E OjudgbvzumOsgwFswJyKJZa+UMK/jS1eR5sdt5jRECjuJTaJWENHfU3Scg458PChXgtvIJ JQHXIFHNBh60yPyEKzYgG5jZq4LqcQQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-483-p2cEvcV-NqyaIX27ub0M4Q-1; Tue, 13 Jul 2021 17:22:18 -0400 X-MC-Unique: p2cEvcV-NqyaIX27ub0M4Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3806E1084F55; Tue, 13 Jul 2021 21:22:16 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCBAB19C44; Tue, 13 Jul 2021 21:22:13 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 22/23] tests/acceptance/linux_ssh_mips_malta.py: drop identical setUp Date: Tue, 13 Jul 2021 17:19:22 -0400 Message-Id: <20210713211923.3809241-23-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" These tests' setUp do not do anything beyong what their base class do. And while they do decorate the setUp() we can decorate the classes instead, so no functionality is lost here. This is possible because since Avocado 76.0 we can decorate setUp() directly. Signed-off-by: Cleber Rosa Message-Id: <20210415215141.1865467-4-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo [PMD: added note to commit message about Avocado feature/version] Signed-off-by: Cleber Rosa --- tests/acceptance/linux_ssh_mips_malta.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py index 61c9079d04..4de1947418 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -19,6 +19,8 @@ from avocado.utils import ssh +@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') +@skipUnless(ssh.SSH_CLIENT_BINARY, 'No SSH client available') class LinuxSSH(Test, LinuxSSHMixIn): timeout = 150 # Not for 'configure --enable-debug --enable-debug-tcg' @@ -65,11 +67,6 @@ def get_kernel_info(self, endianess, wordsize): kernel_hash = self.IMAGE_INFO[endianess]['kernel_hash'][wordsize] return kernel_url, kernel_hash - @skipUnless(ssh.SSH_CLIENT_BINARY, 'No SSH client available') - @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') - def setUp(self): - super(LinuxSSH, self).setUp() - def ssh_disconnect_vm(self): self.ssh_session.quit() From patchwork Tue Jul 13 21:19:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cleber Rosa X-Patchwork-Id: 1504881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RmNGbLke; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPYtM1VPtz9sX1 for ; Wed, 14 Jul 2021 07:39:07 +1000 (AEST) Received: from localhost ([::1]:53398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Q7M-0006fR-V7 for incoming@patchwork.ozlabs.org; Tue, 13 Jul 2021 17:39:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PrH-0004cd-D9 for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3PrD-0000nW-Fr for qemu-devel@nongnu.org; Tue, 13 Jul 2021 17:22:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626211342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OE0RXGHiytwQOy8y8co9KIBkuupfuxKbiZAGpPKU0pk=; b=RmNGbLkeCHanCjStHo+SZhn9Lk/l+pLOaPiiAcNQtf6FeY/iIqJO+7GCUrkLPdBX5QoKHQ cpoZ6Id5rOsHK6JMGPpLo4TjDSh8Xbafm7rRpHmeLN1HEr5cEb655I8WfQ0mcFoJRcrY+Q 5nVCyNNjmhT650LEPv6p/jC3hHY++9k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-478-SId_0mjvMMmD8Kj80f83yg-1; Tue, 13 Jul 2021 17:22:20 -0400 X-MC-Unique: SId_0mjvMMmD8Kj80f83yg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8D114100B3AE; Tue, 13 Jul 2021 21:22:18 +0000 (UTC) Received: from p50.localhost.net (ovpn-117-22.rdu2.redhat.com [10.10.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B32F19C45; Tue, 13 Jul 2021 21:22:16 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 23/23] tests/acceptance/cpu_queries.py: use the proper logging channels Date: Tue, 13 Jul 2021 17:19:23 -0400 Message-Id: <20210713211923.3809241-24-crosa@redhat.com> In-Reply-To: <20210713211923.3809241-1-crosa@redhat.com> References: <20210713211923.3809241-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=crosa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Thomas Huth , Willian Rampazzo , John Snow , Wainer dos Santos Moschetta , Willian Rampazzo , Kamil Rytarowski , Reinoud Zandijk , =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Eduardo Habkost , Greg Kurz , Eric Auger , qemu-arm@nongnu.org, Pavel Dovgalyuk , Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson , Beraldo Leal , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini , Ryo ONODERA , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The test contains methods for the proper log of test related information. Let's use that and remove the print and the unused logging import. Reference: https://avocado-framework.readthedocs.io/en/87.0/api/test/avocado.html#avocado.Test.log Signed-off-by: Cleber Rosa Message-Id: <20210415215141.1865467-6-crosa@redhat.com> Reviewed-by: Willian Rampazzo Reviewed-by: Wainer dos Santos Moschetta Signed-off-by: Cleber Rosa --- tests/acceptance/cpu_queries.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/acceptance/cpu_queries.py b/tests/acceptance/cpu_queries.py index 293dccb89a..cc9e380cc7 100644 --- a/tests/acceptance/cpu_queries.py +++ b/tests/acceptance/cpu_queries.py @@ -8,8 +8,6 @@ # 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 logging - from avocado_qemu import Test class QueryCPUModelExpansion(Test): @@ -27,7 +25,7 @@ def test(self): cpus = self.vm.command('query-cpu-definitions') for c in cpus: - print(repr(c)) + self.log.info("Checking CPU: %s", c) self.assertNotIn('', c['unavailable-features'], c['name']) for c in cpus: