From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374677; cv=none; d=zohomail.com; s=zohoarc; b=gtPB4cUbzkrHzCrc5rKwDiKn/6oTyDN31eUQpji8nKM/BvOdeYgsnQNPe/1MU8n3NagyOB1F6Q39fZvR3Uimm5it94HjNA0kaQtePaRCn+rhFLBlgqD7T2WQ+Kh431GJ5SayNUZdzN8LDWYWqT4z9Oe3yS/3kyR/0EzUuiF0WzI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374677; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/7Lg/RqFqYGX6fQBg6eedsvFENs7fuYzzpjdXZaPP28=; b=DueRe5DZOhOD5KNSc0cBYcHiqF8nHzB/pcXrOEWqaGPSglLPb37GdEZr5ZubWWvM8eBpxL68SBxHXYSaQCZoIJPuBUfUae223dowO6dV3qAbd1n3cX+jFnktUr/jy2vqjH6CdmTPt3GH/GAxrFo8vJp75UdjqH69frXnfagK0z8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374677699882.1808479442195; Wed, 3 Feb 2021 09:51:17 -0800 (PST) Received: from localhost ([::1]:49938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MJ9-0002JV-Ny for importer@patchew.org; Wed, 03 Feb 2021 12:51:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LuG-00028V-MY for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7LuB-0004Zn-Lr for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:32 -0500 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-MNYgq4_3Mfm515VBvjPC_w-1; Wed, 03 Feb 2021 12:24:13 -0500 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 E95EF1936B60; Wed, 3 Feb 2021 17:24:10 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 029F61C92F; Wed, 3 Feb 2021 17:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373126; 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=/7Lg/RqFqYGX6fQBg6eedsvFENs7fuYzzpjdXZaPP28=; b=HyJ7sEqzl+2P8sRh9e355RiCrYN95M/yb7a+GmOk96pXzQeox5sCPhuoNkGpNRMSmzN5OW baZPL5HYpksLpJL8Wm0xM0BPpMQtLF0Cz1RXVHQpoqEkS+vhqg4bSPV/Th2SZxlQn9XH3g upuXAaVhfWClMi1MmQASJL1dENe36jU= X-MC-Unique: MNYgq4_3Mfm515VBvjPC_w-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 01/22] tests/acceptance/boot_linux.py: fix typo on cloudinit error message Date: Wed, 3 Feb 2021 12:23:36 -0500 Message-Id: <20210203172357.1422425-2-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Cleber Rosa Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Beraldo Leal Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/boot_linux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 1da4a53d6a..2ac3e57587 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -70,7 +70,7 @@ class BootLinuxBase(Test): phone_home_port=3Dself.phone_home_port, authorized_key=3Dssh_pubkey) except Exception: - self.cancel('Failed to prepared cloudinit image') + self.cancel('Failed to prepare the cloudinit image') return cloudinit_iso =20 class BootLinux(BootLinuxBase): --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374292; cv=none; d=zohomail.com; s=zohoarc; b=hkmk4O857qjlfGDYfiErZQd0pmBpE393fkj7V0Xa20V7fxfyvVOG9JKQ28CYiNDj/8nf8HxmGm09YWqOB0qu2mPoDMXbQ03kooUlrUYJ2A3Jg4OABbbdJWStIhN5VJRBHhp479Mu5eptLlLEtEPNX7f2P0nYrJbKr3nqIEUOCM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374292; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QIZpH4j0cF7I1bNbifZNoqjGEUXyLfrPQHQW4qwyHb0=; b=nh6xqhrzF+nwzLXYLLZBCuEWZToiEdhnq66B97FjIdr1Nfc+MwsNH/iL7a93IwXtKm5jo3TZC/lRM2Hel4iFvKz4hBqlw0b5ecUGx+uT1YMr4H5CR9C5V/CN28Fbq2ZSY8SLKHqAeE4pghZpkaaP9T5YXKi+DySgMvJUCdijEKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374292752977.4756553851031; Wed, 3 Feb 2021 09:44:52 -0800 (PST) Received: from localhost ([::1]:59220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MCx-0002Tt-Lz for importer@patchew.org; Wed, 03 Feb 2021 12:44:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LtB-00013C-2X for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lt8-0004Px-7J for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:24 -0500 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-587-uF8Ff9TpMiO-Exdx2F6eaw-1; Wed, 03 Feb 2021 12:24:14 -0500 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 DC38A1800D41; Wed, 3 Feb 2021 17:24:12 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A70218E3D; Wed, 3 Feb 2021 17:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373057; 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=QIZpH4j0cF7I1bNbifZNoqjGEUXyLfrPQHQW4qwyHb0=; b=eb8wtvu4EzgKEoivKvRmFmyicK4tslaMWZfOs9LRyOIgK4AF6p9sP/R8lcJGcDnXUlFt+B 3kV+2HuG/sNUwmVV2c49SmEeU7y7Ainktq0tdkMvY3x4ZJekR3eGV6gNtMbW58mjU7DqLn 9fZF7q/7o4+L5wvz+uqNDe34APACZUo= X-MC-Unique: uF8Ff9TpMiO-Exdx2F6eaw-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 02/22] tests/acceptance/boot_linux.py: rename misleading cloudinit method Date: Wed, 3 Feb 2021 12:23:37 -0500 Message-Id: <20210203172357.1422425-3-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" There's no downloading happening on that method, so let's call it "prepare" instead. While at it, and because of it, the current "prepare_boot" and "prepare_cloudinit" are also renamed. The reasoning here is that "prepare_" methods will just work on the images, while "set_up_" will make them effective to the VM that will be launched. Inspiration comes from the "virtiofs_submounts.py" tests, which this expects to converge more into. Signed-off-by: Cleber Rosa Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Beraldo Leal Reviewed-by: Thomas Huth --- tests/acceptance/boot_linux.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 2ac3e57587..bcd923bb4a 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -57,7 +57,7 @@ class BootLinuxBase(Test): self.cancel('Failed to download/prepare boot image') return boot.path =20 - def download_cloudinit(self, ssh_pubkey=3DNone): + def prepare_cloudinit(self, ssh_pubkey=3DNone): self.log.info('Preparing cloudinit image') try: cloudinit_iso =3D os.path.join(self.workdir, 'cloudinit.iso') @@ -85,15 +85,15 @@ class BootLinux(BootLinuxBase): super(BootLinux, self).setUp() self.vm.add_args('-smp', '2') self.vm.add_args('-m', '1024') - self.prepare_boot() - self.prepare_cloudinit(ssh_pubkey) + self.set_up_boot() + self.set_up_cloudinit(ssh_pubkey) =20 - def prepare_boot(self): + def set_up_boot(self): path =3D self.download_boot() self.vm.add_args('-drive', 'file=3D%s' % path) =20 - def prepare_cloudinit(self, ssh_pubkey=3DNone): - cloudinit_iso =3D self.download_cloudinit(ssh_pubkey) + def set_up_cloudinit(self, ssh_pubkey=3DNone): + cloudinit_iso =3D self.prepare_cloudinit(ssh_pubkey) self.vm.add_args('-drive', 'file=3D%s,format=3Draw' % cloudinit_is= o) =20 def launch_and_wait(self): --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612373414; cv=none; d=zohomail.com; s=zohoarc; b=BFBt4/mCraih/+T1B1zxW3iUVtSm7IiZZlaIEk7IJhFImrdDPnm8D07yDgm0UqHkH/+vJPMXt7vLpXZcRD+q8KkkF56eEii+7rn4EY5XtJIhahqAKONah0mI9cmgqvRPhOUsWmT5P7i1hZeZeo5M6KuzF2PLunQtnkNdFyJiAO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612373414; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ax2MBQxvJ9+UbpjtSMsmccCkSh6z5G1FD3iuHYWj+eM=; b=OQrIsGHLcsNBiYFwcGIr2UuFN/VXJG0NVP2DqbbHhJAfVNyWPqJPaac56CSozc7IcM77NKp2MOMG1TTAPXSzpQPewgmlvnmYNU6f4e98oOpsZzvRilS+g1Ceacu2TrZ3cSZArQr/biZfFieba/ECCAfk5EA6HiE4giZ57BzuWfE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612373414243311.61033338207153; Wed, 3 Feb 2021 09:30:14 -0800 (PST) Received: from localhost ([::1]:54396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7Lyl-0004Vq-H9 for importer@patchew.org; Wed, 03 Feb 2021 12:30:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LtC-000146-Ul for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29727) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lt8-0004Q3-6p for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:26 -0500 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-225-wpH98T-GOkyCsZcFbE3gLg-1; Wed, 03 Feb 2021 12:24:16 -0500 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 D3663801962; Wed, 3 Feb 2021 17:24:14 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D5E0131DB; Wed, 3 Feb 2021 17:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373058; 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=Ax2MBQxvJ9+UbpjtSMsmccCkSh6z5G1FD3iuHYWj+eM=; b=Jw2/GTYb0DKv1t2nxLR+FtbimroaGsV3XDP7xwrYNsr8zhgLiPeSgucDWYa4QnaiOKmwwo iqppHdBpnRhPlq/4Rbcburrb7nREphP4FnozMRICnj/lRZ/mbqWPh45rQrVqm4d6ey7v7F eAnp6KbqkkOvknOhOYkheWp1TcKjf1g= X-MC-Unique: wpH98T-GOkyCsZcFbE3gLg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 03/22] Acceptance Tests: remove unnecessary tag from documentation example Date: Wed, 3 Feb 2021 12:23:38 -0500 Message-Id: <20210203172357.1422425-4-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The ":avocado: enable" is not necessary and was removed in 9531d26c, so let's remove from the docs. Signed-off-by: Cleber Rosa Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- docs/devel/testing.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 809af69725..209f9d8172 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -765,9 +765,6 @@ and hypothetical example follows: =20 =20 class MultipleMachines(Test): - """ - :avocado: enable - """ def test_multiple_machines(self): first_machine =3D self.get_vm() second_machine =3D self.get_vm() --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374842; cv=none; d=zohomail.com; s=zohoarc; b=KfAIPcDaSAINGi1FyKFb3w2T0zzW+KGfQ56q7cYP3ZKgNxLqpeUNN6WOZiciRQWfIFKYjxfrJCmVZZNpAHy4Ttvs/IvsQe2RyNMBV860mCENgFNzMNC/yRK0HQ5cmqSQZc2OGogUIjH3Q4EYfFPkt6hlnnF50q4bgfcdWTHqqRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374842; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1cCU3oknrPh14w3nlTGzwfmVLynQ8mNsv9PVfuzuUJA=; b=n/sFxE5apLKNC5USFK5AYPYVaB9+FMG8zMhJs8cYuYjptiAwDDpF4xJVv+Vaq0r1VePxq4pVIRLEpvPzKBI/39csFOJJ1bdx5JFxVLlNICcbi16d7WJjci+nMQwL8v+iMV9Gbi7Wq2CCAA5eHfQT9IGFmO4Xlegp+nLhrzouyVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374842252986.6673951547768; Wed, 3 Feb 2021 09:54:02 -0800 (PST) Received: from localhost ([::1]:58982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MLo-0006IF-Ai for importer@patchew.org; Wed, 03 Feb 2021 12:54:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LuH-00029M-Q8 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7LuD-0004a1-Fm for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:33 -0500 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-544-4ZGTWkZPNdOJ5-T1WzFoPw-1; Wed, 03 Feb 2021 12:24:18 -0500 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 C3A24803F47; Wed, 3 Feb 2021 17:24:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 02593163C8; Wed, 3 Feb 2021 17:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373128; 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=1cCU3oknrPh14w3nlTGzwfmVLynQ8mNsv9PVfuzuUJA=; b=aGcHM7VA8U4qRDoC1LtuGaANOWix3lG3ON7jTY1AU5CSKx8rPplrhdlrc17KZyjeX21B1F GoBvdz7akqDHz+9tAUy4VG10WkK4YtWgmRGund/L/qedPo2v+QG5vDBz6o7ssYXbdMqEHy 1UcvGOD5WbCDpbDm5XUsawuCf8gjM9U= X-MC-Unique: 4ZGTWkZPNdOJ5-T1WzFoPw-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 04/22] tests/acceptance/virtiofs_submounts.py: use workdir property Date: Wed, 3 Feb 2021 12:23:39 -0500 Message-Id: <20210203172357.1422425-5-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" For Avocado Instrumented based tests, it's a better idea to just use the property. The environment variable is a fall back for tests not written using that Python API. Reference: https://avocado-framework.readthedocs.io/en/84.0/api/test/avocad= o.html#avocado.Test.workdir Signed-off-by: Cleber Rosa Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Beraldo Leal --- tests/acceptance/virtiofs_submounts.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 361e5990b6..68d3cd6869 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -136,8 +136,7 @@ class VirtiofsSubmountsTest(BootLinux): return (stdout, stderr, ret) =20 def set_up_shared_dir(self): - atwd =3D os.getenv('AVOCADO_TEST_WORKDIR') - self.shared_dir =3D os.path.join(atwd, 'virtiofs-shared') + self.shared_dir =3D os.path.join(self.workdir, 'virtiofs-shared') =20 os.mkdir(self.shared_dir) =20 @@ -234,8 +233,7 @@ class VirtiofsSubmountsTest(BootLinux): =20 self.seed =3D self.params.get('seed') =20 - atwd =3D os.getenv('AVOCADO_TEST_WORKDIR') - self.ssh_key =3D os.path.join(atwd, 'id_ed25519') + self.ssh_key =3D os.path.join(self.workdir, 'id_ed25519') =20 self.run(('ssh-keygen', '-t', 'ed25519', '-f', self.ssh_key)) =20 --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612373777; cv=none; d=zohomail.com; s=zohoarc; b=KYFrH8nSwRt4NjNm6ndjbF9ZZ3pFuHGC70fqQRm2Qq0s8Ibo/TJQHkz4phuy5kMMDVYi8sE0xKejgowAK7gloyoUPlii32vKQJW4RuABQwhAJ878QqaFvrehA/c/oNgdvi7cbrUlGy2kcCRg0YOQkwY8Lhw3NVWm0L9WM3S/Cac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612373777; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XUMVF6lYnpPaIRkHAa6+btko1WLNWPXQbx5Gyed5kUA=; b=a8dVQrugCVYZ5Dv/KAUB7ya19+8DhYriX/izSWc/w0AYh41ycVD0WMZZScw5os8mklLc81XUhN7JamEJ3B1cbYs/TDffafatMO0opK8dIfjauANRGGzPV0/tSELsP7R7HprUgiFRzrRsPWJlgZKqZDusDVaoscnZyelTGLtj36c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612373777010415.01143621522453; Wed, 3 Feb 2021 09:36:17 -0800 (PST) Received: from localhost ([::1]:35058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7M4b-0000Of-NC for importer@patchew.org; Wed, 03 Feb 2021 12:36:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LtD-00014B-N6 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7LtA-0004Qf-PV for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:27 -0500 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-507-BMoL-jBROXWuRgBacWOxOg-1; Wed, 03 Feb 2021 12:24:20 -0500 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 B7E9B801961; Wed, 3 Feb 2021 17:24:18 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E81B2163C8; Wed, 3 Feb 2021 17:24:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373061; 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=XUMVF6lYnpPaIRkHAa6+btko1WLNWPXQbx5Gyed5kUA=; b=PuLgIVQGgFqAvYT9sblkQJ1QupYxyVAnL1748kyYXJNIqwhAjk94zLuaIGkDquOg3xEjJ/ NTLbd0egLD5xHGdoMMz/tZGXJhSTq6Y0G43D2NJp+dkGNFejbFYAbsoJrk/6K8Bk03KuPw 15LpaHTt66LwRoJ2Z90gafvMc5ZyQ80= X-MC-Unique: BMoL-jBROXWuRgBacWOxOg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 05/22] tests/acceptance/virtiofs_submounts.py: do not ask for ssh key password Date: Wed, 3 Feb 2021 12:23:40 -0500 Message-Id: <20210203172357.1422425-6-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Tests are supposed to be non-interactive, and ssh-keygen is asking for a password when creating a key. Let's set an empty key, which prevents ssh-keygen for asking for a password. Signed-off-by: Cleber Rosa Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Beraldo Leal --- tests/acceptance/virtiofs_submounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 68d3cd6869..3b5a242385 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -235,7 +235,7 @@ class VirtiofsSubmountsTest(BootLinux): =20 self.ssh_key =3D os.path.join(self.workdir, 'id_ed25519') =20 - self.run(('ssh-keygen', '-t', 'ed25519', '-f', self.ssh_key)) + self.run(('ssh-keygen', '-N', '', '-t', 'ed25519', '-f', self.ssh_= key)) =20 pubkey =3D open(self.ssh_key + '.pub').read() =20 --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374821; cv=none; d=zohomail.com; s=zohoarc; b=MsDI4SgGF8f8/YYbW16hsTq7Y3W8XdojxVbQnMLQlY8Nv5H1VF8Qou7+PZkfRRGhi/1C10Ez0GDqLYxWZcpfY4C+c3m8074o2gCheAqAouQX96kEFWa5xsUJL5n3BZpotoqjpwHRiA9O8pJQQlJO/HTH1o6DCK3u0OZNI1RIXJo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374821; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4ADkV8mBuXhby3vvDtXiKdtnOL/wAFFxHne9Xw7F21M=; b=NyCiL+9DIztkTwKXuuBTBQQHHflIFbbCy34hsTrK4CRyg/WRIV2Afi+2HzSXJ0+kFmw1Fh4/dRyJzMlc1YAgJEeGSSj5VwFCAux0Sz4aUo66oON6Jyv4ji7VlPxTvjfc7BsQDM+k1it+SzJx9SnYwP+JV8xS7LRkExvuWp5s3iQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161237482152789.88266289737442; Wed, 3 Feb 2021 09:53:41 -0800 (PST) Received: from localhost ([::1]:58008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MLU-0005s4-E9 for importer@patchew.org; Wed, 03 Feb 2021 12:53:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Lun-00035i-77 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lul-0004eH-HS for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:04 -0500 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-238-AgGf-mA6MLqX0GNRUfTPgg-1; Wed, 03 Feb 2021 12:24:31 -0500 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 BDA8C803F57; Wed, 3 Feb 2021 17:24:29 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBFB8163C8; Wed, 3 Feb 2021 17:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373162; 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=4ADkV8mBuXhby3vvDtXiKdtnOL/wAFFxHne9Xw7F21M=; b=PTQ0KQ84PozLas+uqZ+7jUaUq04L7brv2NmSjCK2r3AA5L49zIRsmaLmdkdlhHSpvVezpl q9w0/IYeBBF8yqztJSXSoMesXWrt5u/W4Ii8Rrv7HJPLO5TZMTH+nhF5slhzwpzyet/yAi xd/MkAstN6XBtnV8fcDto5EXvgMjob4= X-MC-Unique: AgGf-mA6MLqX0GNRUfTPgg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 06/22] tests/acceptance/virtiofs_submounts.py: use a virtio-net device instead Date: Wed, 3 Feb 2021 12:23:41 -0500 Message-Id: <20210203172357.1422425-7-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" In a virtiofs based tests, it seems safe to assume that the guest will be capable of a virtio-net device. Signed-off-by: Cleber Rosa Reviewed-by: Alex Benn=C3=A9e --- tests/acceptance/virtiofs_submounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 3b5a242385..f1b49f03bb 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -247,7 +247,7 @@ class VirtiofsSubmountsTest(BootLinux): =20 # Allow us to connect to SSH self.vm.add_args('-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0= -:22', - '-device', 'e1000,netdev=3Dvnet') + '-device', 'virtio-net,netdev=3Dvnet') =20 if not kvm_available(self.arch, self.qemu_bin): self.cancel(KVM_NOT_AVAILABLE) --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612375488; cv=none; d=zohomail.com; s=zohoarc; b=mxtneN9ZvYRx+xtQDxxL4nJ7qFumljLCGexpeef0PxssEnvDWiTUFxQCJ9pZ0QTT4Ill5e545Ddik5Z+UtrghuIR2CGeB5/79naDA9xmW53yKaEd3hLkRrFZERkpRpIIv4pEubQJXlpb5RnAn3YUHzJ9feYwILM/q8OkPNl6AaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612375488; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F6pSmULIqgQ/mx8yK+y/L8DwU4wsfKwteKJzsFWfPy8=; b=eHCz/XsX5WWZ+Uv5472Mu+HE7pKW+Vskj1Orlr+s3rS+0bN6i0vlrWndG6lxP4UXf63pd4qpvN+KAoN9i/QgFGpo253j/AYME/bdwMkeVX6efok1sCM42OpGlzr7i5nG5Dgel6A3pucvnOvliqy5H1YlErZqhLauYdKOSJDwqBg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612375488098104.79040038461869; Wed, 3 Feb 2021 10:04:48 -0800 (PST) Received: from localhost ([::1]:54198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MWB-0000EZ-Iq for importer@patchew.org; Wed, 03 Feb 2021 13:04:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Lus-0003D6-Qu for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lur-0004f4-D4 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:10 -0500 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-338-LSpKdp-ePGmfGoIxxZaGLA-1; Wed, 03 Feb 2021 12:24:33 -0500 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 AE379801964; Wed, 3 Feb 2021 17:24:31 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1EFF1971C; Wed, 3 Feb 2021 17:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373168; 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=F6pSmULIqgQ/mx8yK+y/L8DwU4wsfKwteKJzsFWfPy8=; b=BT+jozT96Ur7DEOvpMdo/5VqCiUo/KeH1+6YpMMeoDbXd/T9nsN32+EkDfqsbgisfg/d9y dO6hE5CJGhg8TyaGf0mQ5xcLk1AJJr42UUw/AXryP5uZwiHxiN6tmUETC4NfV6y8TLLqfu XvV28dp8zi+H3bbopSu8TXvF6MHkP1U= X-MC-Unique: LSpKdp-ePGmfGoIxxZaGLA-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length Date: Wed, 3 Feb 2021 12:23:42 -0500 Message-Id: <20210203172357.1422425-8-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" If the vmlinuz variable is set to anything that evaluates to True, then the respective arguments should be set. If the variable contains an empty string, than it will evaluate to False, and the extra arguments will not be set. This keeps the same logic, but improves readability a bit. Signed-off-by: Cleber Rosa Reviewed-by: Beraldo Leal --- tests/acceptance/virtiofs_submounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index f1b49f03bb..f25a386a19 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -241,7 +241,7 @@ class VirtiofsSubmountsTest(BootLinux): =20 super(VirtiofsSubmountsTest, self).setUp(pubkey) =20 - if len(vmlinuz) > 0: + if vmlinuz: self.vm.add_args('-kernel', vmlinuz, '-append', 'console=3DttyS0 root=3D/dev/sda1') =20 --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612373782; cv=none; d=zohomail.com; s=zohoarc; b=YiPAdosatJv+qZ+FhgfEKWYXJMJtG8v4/abhu9l/elB0chQuBGRmpIr2eYMN2h8hfBH+0QKnT/mvp5cFNiDQ8K0rMWt+gkDJegvSikTKB+1fZuOGAtRx0i9Vjx4vIG7lc6jV6HspoKj5Q2Zn3ktYl+bmEjV11+FQTS9XL062Ipg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612373782; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZqHIpf0SLqbJ9aEwKY16l9+p9oKWY2635HtfAnEDSdE=; b=QZsjbmC2eMhNTGBn6J7yubcYCsjcToBmC4rEWKLCajy1f5BFbg6OTwbq4LR6mbaVLV/yhvQcJp+w1vr1uypP3PB3bqsnHLfqAykBohX4QIQ3tvemxh/plWtxfsoAJLPiO19Fwl2srE4Vrxsl/WsmwsKdbA7p0Mv+67cuKQc1A08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161237378299169.23550341281168; Wed, 3 Feb 2021 09:36:22 -0800 (PST) Received: from localhost ([::1]:35534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7M4j-0000c6-Um for importer@patchew.org; Wed, 03 Feb 2021 12:36:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LuR-0002Vr-LV for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7LuQ-0004ay-0D for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:43 -0500 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-144-TXOz_iFMNKe2j6ygCollTw-1; Wed, 03 Feb 2021 12:24:35 -0500 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 A0053801960; Wed, 3 Feb 2021 17:24:33 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2CCF1C92F; Wed, 3 Feb 2021 17:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373141; 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=ZqHIpf0SLqbJ9aEwKY16l9+p9oKWY2635HtfAnEDSdE=; b=Ui5LVVR/rATir3tRbvIHtqaOa5XKo2R2qkozY/SMa0vpFevKbn0dgMm0lA8Ul+DBQbd+Eb Fqc7cn68fPXPDG5Z0OHVr5V9M1wGYxjixtT4vw/JnGHX3RNSfs/kgcItJ96UTly3SLql/v OlcmUBx7FeHNXaDaJ8R0fzR4ubfaKus= X-MC-Unique: TXOz_iFMNKe2j6ygCollTw-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 08/22] tests/acceptance/virtiofs_submounts.py: standardize port as integer Date: Wed, 3 Feb 2021 12:23:43 -0500 Message-Id: <20210203172357.1422425-9-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of having to cast it whenever it's going to be used, let's standardize it as an integer, which is the data type that will be used most often. Given that the regex will only match digits, it's safe that we'll end up getting a integer, but, it could as well be a zero. Signed-off-by: Cleber Rosa Reviewed-by: Beraldo Leal --- tests/acceptance/virtiofs_submounts.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index f25a386a19..227a3cf1ee 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -86,17 +86,18 @@ class VirtiofsSubmountsTest(BootLinux): re.search(r'TCP.HOST_FORWARD.*127\.0\.0\.1\s*(\d+)\s+10\.', line) if match is not None: - port =3D match[1] + port =3D int(match[1]) break =20 self.assertIsNotNone(port) - self.log.debug('sshd listening on port: ' + port) + self.assertGreater(port, 0) + self.log.debug('sshd listening on port: %d', port) return port =20 def ssh_connect(self, username, keyfile): self.ssh_logger =3D logging.getLogger('ssh') port =3D self.get_portfwd() - self.ssh_session =3D ssh.Session('127.0.0.1', port=3Dint(port), + self.ssh_session =3D ssh.Session('127.0.0.1', port=3Dport, user=3Dusername, key=3Dkeyfile) for i in range(10): try: --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612373947; cv=none; d=zohomail.com; s=zohoarc; b=ioOQGwj2wcdl7OxI9BRhJ68wqVzL4gWCRoAmqcHwxDyp3GVtnLn3bCZX/WWJwy8GWKTGXJSNPJIsT/KX39p6Ii7t0Q+ugS4PxviMNS5m/mFnjrMhS1HI1ujgsolS3eqGluM27kSkvumpo7ZdyqPl+k8Ev4tytyEjwEREI1r3YkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612373947; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3GZOHWydtNKyFBMrvNknMfD6orZLWZtkMdMd1jux28Q=; b=k84+++IxXkZN/FugRIzsD10SQ9peP9K6oGJyvND2mZOKv2Uq0uwxKsaY4bw4ra29GhSPTic2lpy7w5f0O1bCyxPMJSAhrLTAHDykL2V4MZAIHOXCuOXZYfyjxzjWmQVaF4mhbnJCT3jUBXHCpW6zY2mY8kho2Gu6LMRGGNXZ5eI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612373947647975.8283190376801; Wed, 3 Feb 2021 09:39:07 -0800 (PST) Received: from localhost ([::1]:43774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7M7O-0004DJ-JT for importer@patchew.org; Wed, 03 Feb 2021 12:39:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LtS-0001f3-IB for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7LtQ-0004Ts-Uf for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:42 -0500 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-381-Hx2MX-nINKKMidrQ4lObKQ-1; Wed, 03 Feb 2021 12:24:37 -0500 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 8E03A1936B60; Wed, 3 Feb 2021 17:24:35 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C29D21C92F; Wed, 3 Feb 2021 17:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373078; 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=3GZOHWydtNKyFBMrvNknMfD6orZLWZtkMdMd1jux28Q=; b=NZ9Z32uI7CP3BHcMlN5V4a7TpsL1VATXNYzc9Sh4u7Z6A+pY9fxKKzUCD17n3tCXcYc+fV tVFl700/c2qQyV+aO+9zlxEC4qxI2rOI5wCXovzMkRUBJO7pIz0s6F8MvMjAXI9hMhKf81 oAJi0u9fnaK16ZZN1LQHqsAtCO7uRLk= X-MC-Unique: Hx2MX-nINKKMidrQ4lObKQ-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 09/22] tests/acceptance/virtiofs_submounts.py: required space between IP and port Date: Wed, 3 Feb 2021 12:23:44 -0500 Message-Id: <20210203172357.1422425-10-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" AFAICT, there should not be a situation where IP and port do not have at least one whitespace character separating them. This may be true for other '\s*' patterns in the same regex too. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/virtiofs_submounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 227a3cf1ee..0f9d7a5d9c 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -83,7 +83,7 @@ class VirtiofsSubmountsTest(BootLinux): command_line=3D'info usernet') for line in res.split('\r\n'): match =3D \ - re.search(r'TCP.HOST_FORWARD.*127\.0\.0\.1\s*(\d+)\s+10\.', + re.search(r'TCP.HOST_FORWARD.*127\.0\.0\.1\s+(\d+)\s+10\.', line) if match is not None: port =3D int(match[1]) --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374470; cv=none; d=zohomail.com; s=zohoarc; b=c3DMy7a0RWGg6iZiZGRvUnqrBz4HIvBHbn3WK6jrX0Gsnpr3elqocpOSMiN2PLUpe6W+MeR1RtbUjvNHb6R2yXU1h83nf+RQsg/wNjWXmM1Mp8ntjG8MKkk2ClzWKPQoQFoCZzmrIUGxeOG99I2X6DjN/z3U32OfwqYHTnkZV7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374470; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Gz+JUDDRAeZzinHeGe4F2l4HIemoPbN5NxOn7CXW+LA=; b=kkg2vpUT4UhU2LB6IGMarLkwMvcax0kvyuoXSjOozet866DWBIZ5lA1dduLwRfaYpQ1BB57UxZQypHY4rmlZXSuKmUYDMdCtIVnHBE+QHIj8DmKRd+IYc5SZkPPX71bwUJG2zCD6cHYql0PEf8spBnR2KSK6S7wh4RoCRiK8rB4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374470174388.2391701030408; Wed, 3 Feb 2021 09:47:50 -0800 (PST) Received: from localhost ([::1]:39716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MFo-0006P4-SN for importer@patchew.org; Wed, 03 Feb 2021 12:47:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LtV-0001ka-RF for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7LtT-0004UD-Nu for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:24:45 -0500 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-261-WOzgb_AmOdOVcprN6RVFAA-1; Wed, 03 Feb 2021 12:24:39 -0500 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 02D4B801962; Wed, 3 Feb 2021 17:24:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B2F8C1C92F; Wed, 3 Feb 2021 17:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373081; 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=Gz+JUDDRAeZzinHeGe4F2l4HIemoPbN5NxOn7CXW+LA=; b=WkLjXV8VhzBrrOdCEHbvkMkz3QBsIPEx6AhcZnreA1Iq1LfRtPNYrb5mkMjX8jNjT6cYaL HTO6/3Q6MCdJDiS/n1PAPWNqZ7SFMuahI2bfRKsZcNyc7yGdGTQGfisq8DJBTURAnTUPRh lNsz0ywPBgwCIrh2p7L6QdXfmXkuvyI= X-MC-Unique: WOzgb_AmOdOVcprN6RVFAA-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 10/22] Python: add utility function for retrieving port redirection Date: Wed, 3 Feb 2021 12:23:45 -0500 Message-Id: <20210203172357.1422425-11-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Slightly different versions for the same utility code are currently present on different locations. This unifies them all, giving preference to the version from virtiofs_submounts.py, because of the last tweaks added to it. While at it, this adds a "qemu.util" module to host the utility function and a test. Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta --- python/qemu/utils.py | 35 ++++++++++++++++++++++++ tests/acceptance/info_usernet.py | 29 ++++++++++++++++++++ tests/acceptance/linux_ssh_mips_malta.py | 16 +++++------ tests/acceptance/virtiofs_submounts.py | 20 +++----------- tests/vm/basevm.py | 7 ++--- 5 files changed, 77 insertions(+), 30 deletions(-) create mode 100644 python/qemu/utils.py create mode 100644 tests/acceptance/info_usernet.py diff --git a/python/qemu/utils.py b/python/qemu/utils.py new file mode 100644 index 0000000000..89a246ab30 --- /dev/null +++ b/python/qemu/utils.py @@ -0,0 +1,35 @@ +""" +QEMU utility library + +This offers miscellaneous utility functions, which may not be easily +distinguishable or numerous to be in their own module. +""" + +# Copyright (C) 2021 Red Hat Inc. +# +# Authors: +# Cleber Rosa +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +# + +import re +from typing import Optional + + +def get_info_usernet_hostfwd_port(info_usernet_output: str) -> Optional[in= t]: + """ + Returns the port given to the hostfwd parameter via info usernet + + :param info_usernet_output: output generated by hmp command "info user= net" + :param info_usernet_output: str + :return: the port number allocated by the hostfwd option + :rtype: int + """ + for line in info_usernet_output.split('\r\n'): + regex =3D r'TCP.HOST_FORWARD.*127\.0\.0\.1\s+(\d+)\s+10\.' + match =3D re.search(regex, line) + if match is not None: + return int(match[1]) + return None diff --git a/tests/acceptance/info_usernet.py b/tests/acceptance/info_usern= et.py new file mode 100644 index 0000000000..9c1fd903a0 --- /dev/null +++ b/tests/acceptance/info_usernet.py @@ -0,0 +1,29 @@ +# Test for the hmp command "info usernet" +# +# Copyright (c) 2021 Red Hat, Inc. +# +# Author: +# Cleber Rosa +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +from avocado_qemu import Test + +from qemu.utils import get_info_usernet_hostfwd_port + + +class InfoUsernet(Test): + + def test_hostfwd(self): + self.vm.add_args('-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0= -:22') + self.vm.launch() + res =3D self.vm.command('human-monitor-command', + command_line=3D'info usernet') + port =3D get_info_usernet_hostfwd_port(res) + self.assertIsNotNone(port, + ('"info usernet" output content does not seem= to ' + 'contain the redirected port')) + self.assertGreater(port, 0, + ('Found a redirected port that is not greater t= han' + ' zero')) diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index 25c5c5f741..275659c785 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -18,6 +18,8 @@ from avocado.utils import process from avocado.utils import archive from avocado.utils import ssh =20 +from qemu.utils import get_info_usernet_hostfwd_port + =20 class LinuxSSH(Test): =20 @@ -70,18 +72,14 @@ class LinuxSSH(Test): def setUp(self): super(LinuxSSH, self).setUp() =20 - def get_portfwd(self): + def ssh_connect(self, username, password): + self.ssh_logger =3D logging.getLogger('ssh') res =3D self.vm.command('human-monitor-command', command_line=3D'info usernet') - line =3D res.split('\r\n')[2] - port =3D re.split(r'.*TCP.HOST_FORWARD.*127\.0\.0\.1 (\d+)\s+10\..= *', - line)[1] + port =3D get_info_usernet_hostfwd_port(res) + if not port: + self.cancel("Failed to retrieve SSH port") self.log.debug("sshd listening on port:" + port) - return port - - def ssh_connect(self, username, password): - self.ssh_logger =3D logging.getLogger('ssh') - port =3D self.get_portfwd() self.ssh_session =3D ssh.Session(self.VM_IP, port=3Dint(port), user=3Dusername, password=3Dpasswor= d) for i in range(10): diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 0f9d7a5d9c..bf99164fcb 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -10,6 +10,7 @@ from avocado_qemu import wait_for_console_pattern from avocado.utils import ssh =20 from qemu.accel import kvm_available +from qemu.utils import get_info_usernet_hostfwd_port =20 from boot_linux import BootLinux =20 @@ -76,27 +77,14 @@ class VirtiofsSubmountsTest(BootLinux): :avocado: tags=3Darch:x86_64 """ =20 - def get_portfwd(self): - port =3D None - + def ssh_connect(self, username, keyfile): + self.ssh_logger =3D logging.getLogger('ssh') res =3D self.vm.command('human-monitor-command', command_line=3D'info usernet') - for line in res.split('\r\n'): - match =3D \ - re.search(r'TCP.HOST_FORWARD.*127\.0\.0\.1\s+(\d+)\s+10\.', - line) - if match is not None: - port =3D int(match[1]) - break - + port =3D get_info_usernet_hostfwd_port(res) self.assertIsNotNone(port) self.assertGreater(port, 0) self.log.debug('sshd listening on port: %d', port) - return port - - def ssh_connect(self, username, keyfile): - self.ssh_logger =3D logging.getLogger('ssh') - port =3D self.get_portfwd() self.ssh_session =3D ssh.Session('127.0.0.1', port=3Dport, user=3Dusername, key=3Dkeyfile) for i in range(10): diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 00f1d5ca8d..75ce07df36 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -21,6 +21,7 @@ import datetime sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu.accel import kvm_available from qemu.machine import QEMUMachine +from qemu.utils import get_info_usernet_hostfwd_port import subprocess import hashlib import argparse @@ -306,11 +307,7 @@ class BaseVM(object): self.console_init() usernet_info =3D guest.qmp("human-monitor-command", command_line=3D"info usernet") - self.ssh_port =3D None - for l in usernet_info["return"].splitlines(): - fields =3D l.split() - if "TCP[HOST_FORWARD]" in fields and "22" in fields: - self.ssh_port =3D l.split()[3] + self.ssh_port =3D get_info_usernet_hostfwd_port(usernet_info) if not self.ssh_port: raise Exception("Cannot find ssh port from 'info usernet':\n%s= " % \ usernet_info) --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612373951; cv=none; d=zohomail.com; s=zohoarc; b=MIzwr4msI3NFOA5vuoQkwUUT2qBjWKTuQ8pYzptv2FDGrFEWk2bF5Q3ewQGs+zqZCBHooO+uX2hdhr03+WoQMW/F77wb7xjbT4E8YH3nf2P6JaM1KcqW4oZqwD4Nm4LBZngYp4u7ZxX7mASdpIbUROSrq00pATX6Nb1BRDDUKAY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612373951; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xCI+SkVzhpX54CKsXUwiUVU1SSOeXHvzavIXtN7iRn8=; b=mRmwxZOSr9EMxupEABLRErCAK/yeYQAvZ+drx0SdwMwKfyBpIiq6lczf9PnoCvqSYe94uyypeWr0hyIm82FndTL46DEow9yUPpuMticFAFwuJjje9Xu1Gsp2tu/4I+CLgvR45gLk6+oLoUrY38CvYib3Uv4+qH5B5Bd5UUkYtZ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612373951754933.6730940633585; Wed, 3 Feb 2021 09:39:11 -0800 (PST) Received: from localhost ([::1]:44224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7M7S-0004Pf-OA for importer@patchew.org; Wed, 03 Feb 2021 12:39:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Luc-0002u0-RM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:27766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lub-0004cJ-B2 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:54 -0500 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-12-FyV4nV0oM9m8YY7z34jXhA-1; Wed, 03 Feb 2021 12:24:41 -0500 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 E5446107ACF7; Wed, 3 Feb 2021 17:24:39 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 25B0A1C92F; Wed, 3 Feb 2021 17:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373152; 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=xCI+SkVzhpX54CKsXUwiUVU1SSOeXHvzavIXtN7iRn8=; b=RwbIENzOyk7r376CfjFKh2Qxk9iGZKkWcnd+wctuGpbvRaI5MEls15mNgkN91N+VzcJ1Of IdfIY0LRsrzO+xL1Gz9fN4tpQwAFUfhz6DrvWb14EH6nqZiELq2+7j1CqrSOGQx9vRCTYd qOm42xmV+cJjWwK4sidtQKCRZMo72PE= X-MC-Unique: FyV4nV0oM9m8YY7z34jXhA-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 11/22] tests/acceptance/linux_ssh_mips_malta.py: standardize port as integer Date: Wed, 3 Feb 2021 12:23:46 -0500 Message-Id: <20210203172357.1422425-12-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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, T_FILL_THIS_FORM_SHORT=0.01 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Willian Rampazzo --- tests/acceptance/linux_ssh_mips_malta.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index 275659c785..ab6cb94aef 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -79,8 +79,8 @@ class LinuxSSH(Test): port =3D get_info_usernet_hostfwd_port(res) if not port: self.cancel("Failed to retrieve SSH port") - self.log.debug("sshd listening on port:" + port) - self.ssh_session =3D ssh.Session(self.VM_IP, port=3Dint(port), + self.log.debug("sshd listening on port: %d", port) + self.ssh_session =3D ssh.Session(self.VM_IP, port=3Dport, user=3Dusername, password=3Dpasswor= d) for i in range(10): try: --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374382; cv=none; d=zohomail.com; s=zohoarc; b=V2MezRxyj2rd55RIkYG2V2olGnt8yvgwzPr0QDbnJX6nPJukhLcQTAHDUgJPWFQptqP0ZAkeeY+CPcPMzkfLb4SYrWJ0+hBrHpqfkLDiqaSnOSfeN39Bbn3mabfAgtHIrCJSVXfqyhZgguQjSu1p/Gj3/yqeIb3y7r4bhQ3d9m8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374382; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pgNasKEfM65gT+bkifAHYc5Vf3OqJeIoek37J7Rf8lY=; b=REQ02JhZV9Z+6ynm8RaOmivynFOftTmMDO7P52TITfWmHNO/rKx7yFxYKtCOGlaxrmC+k/UDPESijCiaKnitEnwCUduJJssj9zo6MxX1c3SZP9ZGKBk0QQzbct6A/qtdSjUBX0wV5RWc4vUSuAyG00alq4Qxf2otsYZWtYkBrd4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374382249625.9564092636246; Wed, 3 Feb 2021 09:46:22 -0800 (PST) Received: from localhost ([::1]:34844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MEP-00045W-3L for importer@patchew.org; Wed, 03 Feb 2021 12:46:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Luo-000375-0a for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:06 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32468) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lul-0004eK-Qf for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:05 -0500 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-434-nFpzMv5fNg2EgUDGwvzUFg-1; Wed, 03 Feb 2021 12:24:50 -0500 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 4367A801961; Wed, 3 Feb 2021 17:24:49 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 167FA1971D; Wed, 3 Feb 2021 17:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373162; 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=pgNasKEfM65gT+bkifAHYc5Vf3OqJeIoek37J7Rf8lY=; b=C+WXd7QrSxN4AAHOJj+JfmrJTydIrUQw33gj8YvuyYpP3NnJBpL9Hy8jM7J3GWH/2ZUnsg Qbhjfi1SeCAOAW8/VjJX8UpfHIxnMiy2r3wmvDCQFBl0aloOS5dMpWKpHVNK32iF4xcfeZ 8HIwbHSqRgQhNhSD7crHe+OuXHadTPY= X-MC-Unique: nFpzMv5fNg2EgUDGwvzUFg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 12/22] Acceptance tests: clarify ssh connection failure reason Date: Wed, 3 Feb 2021 12:23:47 -0500 Message-Id: <20210203172357.1422425-13-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" If the connection to the ssh server fails, it may indeed be a "sshd" issue, but it may also not be that. Let's state what we know: the establishment of the connection from the client side was not possible. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/linux_ssh_mips_malta.py | 2 +- tests/acceptance/virtiofs_submounts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index ab6cb94aef..1742235758 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -89,7 +89,7 @@ class LinuxSSH(Test): except: time.sleep(4) pass - self.fail("sshd timeout") + self.fail("ssh connection timeout") =20 def ssh_disconnect_vm(self): self.ssh_session.quit() diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index bf99164fcb..c998b297ee 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -94,7 +94,7 @@ class VirtiofsSubmountsTest(BootLinux): except: time.sleep(4) pass - self.fail('sshd timeout') + self.fail('ssh connection timeout') =20 def ssh_command(self, command): self.ssh_logger.info(command) --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374133; cv=none; d=zohomail.com; s=zohoarc; b=VBr4YIoxeXR9LDiLV9ep39vsHl7gwbB8P6d2kI64Zq75G2gU6c9kBH3jjYMcsKL3JRIXj9p47StPOHL760CfQbD5lkEO61WIT1KVBINsZo7u8NYiCIt58BoWUd2WbgwpNswzcddIdyC6B1sS8qPDDXCMOjZN3ffUSA7Z59ymdRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374133; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RDjyE29VvfGIbW7GirlILd5tOBaQDLA97jJJqsBtimk=; b=SEajuvhoWrPSd/sQtMlyhyNm0RBEJUUu7zUWGM8ljoHSkZKmQgVEUnzThdcD+V8LDgFLfO81tIsrCahxzvt8wY38gI0Z6mPqS875DGipJgBsXM2gUO8Mu5rym9dXOEP+orAjpOqj6AzUgujSmJuSgBoACED4rRedv6wXx9FHgmU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374133067505.1884998538951; Wed, 3 Feb 2021 09:42:13 -0800 (PST) Received: from localhost ([::1]:52712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MAN-00089M-TX for importer@patchew.org; Wed, 03 Feb 2021 12:42:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Luo-00037c-4N for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lul-0004eR-Qq for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:05 -0500 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-550-3tL9I8VaOdyCnrF7dWCGMg-1; Wed, 03 Feb 2021 12:24:52 -0500 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 408B5803F49; Wed, 3 Feb 2021 17:24:51 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 729A6908E; Wed, 3 Feb 2021 17:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373163; 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=RDjyE29VvfGIbW7GirlILd5tOBaQDLA97jJJqsBtimk=; b=OMlJTfO19uzceSBPaCAXVoHPBI+n92wvg1nEVGMSGAi+rdtTpXDyx0XtCBY2xRz/tkfccB WoGAgvkGNAYos92ZFolK5cGcCULhvVqaNuoJ4VW+rWb4ZSovOgLc8zFQgs3xzz12Rd/7kL 0/SPddseYQmpkw/k41rxcfdvCzIFOmI= X-MC-Unique: 3tL9I8VaOdyCnrF7dWCGMg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 13/22] tests/acceptance/virtiofs_submounts.py: add missing accel tag Date: Wed, 3 Feb 2021 12:23:48 -0500 Message-Id: <20210203172357.1422425-14-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Which is useful to select tests that depend/use a particular feature. Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo --- tests/acceptance/virtiofs_submounts.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index c998b297ee..1e745f15a2 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -75,6 +75,7 @@ def has_cmds(*cmds): class VirtiofsSubmountsTest(BootLinux): """ :avocado: tags=3Darch:x86_64 + :avocado: tags=3Daccel:kvm """ =20 def ssh_connect(self, username, keyfile): --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374993; cv=none; d=zohomail.com; s=zohoarc; b=NwKVl6JFP6a2Rkd2lnQkLRlXpwETa9nIWPJuCMFuPBoEw5T17s1s/Ez6zIa6aysIaPR2REewMpYRg1mvkxeRtRlfRWQGdQTLFmzhmDYSjjEZH4i9YzSTvaNMLunmDEwbCPVdPPsKwJH7syOynhPWnsgC70127RutAYOvJczIJYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374993; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Z5p8Ogo05uauJLsneVHMBqwaeyVtfD1TDGu6KANI5yE=; b=KHY17brx8zV8+KwAQipptqfKg23TlbQ6/P8vfbIWTAQygU5uYfStXBj1Im2RMQa+aZ6yIQcbQQ6FRCNiR4ft1tElVD3htaXm6C2bfVk3rEYUkyIGFNAkwPqlz4m99+PDPCVEQL0+K5NxVjzk7TDl1G7mirlHSbKzHBGAEzW4oc4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374993413319.9349588727116; Wed, 3 Feb 2021 09:56:33 -0800 (PST) Received: from localhost ([::1]:37840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MOG-00012D-Bz for importer@patchew.org; Wed, 03 Feb 2021 12:56:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Lur-00039l-2j for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Luo-0004es-TY for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:08 -0500 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-578-KVYfUkgNPwmB9_d73GUt9w-1; Wed, 03 Feb 2021 12:24:54 -0500 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 34A01803F41; Wed, 3 Feb 2021 17:24:53 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64C93163C8; Wed, 3 Feb 2021 17:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373166; 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=Z5p8Ogo05uauJLsneVHMBqwaeyVtfD1TDGu6KANI5yE=; b=a/2TLUTQFUTPk1K9Mp4c5mwNnMJydb82ZC02xqGZnyh1uCwC+vxHFsljCGl4iWRA/2aY8Z Viw2GrR25UNwaDHYlPQRxzcQiCBYtskASMPmsAM8kXFXj7PYQfhDp70GZAzd/lJpwDBuEI Epwmwg4a9zPNsEtMI9wxbgz97DzfKxE= X-MC-Unique: KVYfUkgNPwmB9_d73GUt9w-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 14/22] Acceptance Tests: introduce LinuxTest base class Date: Wed, 3 Feb 2021 12:23:49 -0500 Message-Id: <20210203172357.1422425-15-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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, T_FILL_THIS_FORM_SHORT=0.01 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This is basically the infrastructure around "boot_linux.py" tests, but now made into a base class for general use. Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 87 +++++++++++++++++++++ tests/acceptance/boot_linux.py | 94 ++--------------------- tests/acceptance/virtiofs_submounts.py | 6 +- 3 files changed, 94 insertions(+), 93 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index bf54e419da..b06692a59d 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -16,6 +16,13 @@ import tempfile =20 import avocado =20 +from avocado.utils import cloudinit +from avocado.utils import datadrainer +from avocado.utils import network +from avocado.utils import vmimage +from avocado.utils.path import find_command + + #: The QEMU build root directory. It may also be the source directory #: if building from the source dir, but it's safer to use BUILD_DIR for #: that purpose. Be aware that if this code is moved outside of a source @@ -206,3 +213,83 @@ class Test(avocado.Test): expire=3Dexpire, find_only=3Dfind_only, cancel_on_missing=3Dcancel_on_missing) + + +class LinuxTest(Test): + """Facilitates having a cloud-image Linux based available. + + For tests that indend to interact with guests, this is a better choice + to start with than the more vanilla `Test` class. + """ + + timeout =3D 900 + chksum =3D None + + def setUp(self, ssh_pubkey=3DNone): + super(LinuxTest, self).setUp() + self.vm.add_args('-smp', '2') + self.vm.add_args('-m', '1024') + self.set_up_boot() + self.set_up_cloudinit(ssh_pubkey) + + def download_boot(self): + self.log.debug('Looking for and selecting a qemu-img binary to be ' + 'used to create the bootable snapshot image') + # If qemu-img has been built, use it, otherwise the system wide one + # will be used. If none is available, the test will cancel. + qemu_img =3D os.path.join(BUILD_DIR, 'qemu-img') + if not os.path.exists(qemu_img): + qemu_img =3D find_command('qemu-img', False) + if qemu_img is False: + self.cancel('Could not find "qemu-img", which is required to ' + 'create the bootable image') + vmimage.QEMU_IMG =3D qemu_img + + self.log.info('Downloading/preparing boot image') + # Fedora 31 only provides ppc64le images + image_arch =3D self.arch + if image_arch =3D=3D 'ppc64': + image_arch =3D 'ppc64le' + try: + boot =3D vmimage.get( + 'fedora', arch=3Dimage_arch, version=3D'31', + checksum=3Dself.chksum, + algorithm=3D'sha256', + cache_dir=3Dself.cache_dirs[0], + snapshot_dir=3Dself.workdir) + except: + self.cancel('Failed to download/prepare boot image') + return boot.path + + def prepare_cloudinit(self, ssh_pubkey=3DNone): + self.log.info('Preparing cloudinit image') + try: + cloudinit_iso =3D os.path.join(self.workdir, 'cloudinit.iso') + self.phone_home_port =3D network.find_free_port() + cloudinit.iso(cloudinit_iso, self.name, + username=3D'root', + password=3D'password', + # QEMU's hard coded usermode router address + phone_home_host=3D'10.0.2.2', + phone_home_port=3Dself.phone_home_port, + authorized_key=3Dssh_pubkey) + except Exception: + self.cancel('Failed to prepare the cloudinit image') + return cloudinit_iso + + def set_up_boot(self): + path =3D self.download_boot() + self.vm.add_args('-drive', 'file=3D%s' % path) + + def set_up_cloudinit(self, ssh_pubkey=3DNone): + cloudinit_iso =3D self.prepare_cloudinit(ssh_pubkey) + self.vm.add_args('-drive', 'file=3D%s,format=3Draw' % cloudinit_is= o) + + def launch_and_wait(self): + self.vm.set_console() + self.vm.launch() + console_drainer =3D datadrainer.LineLogger(self.vm.console_socket.= fileno(), + logger=3Dself.log.getChil= d('console')) + console_drainer.start() + self.log.info('VM launched, waiting for boot confirmation from gue= st') + cloudinit.wait_for_phone_home(('0.0.0.0', self.phone_home_port), s= elf.name) diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index bcd923bb4a..14e89d020d 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -10,16 +10,11 @@ =20 import os =20 -from avocado_qemu import Test, BUILD_DIR +from avocado_qemu import LinuxTest, BUILD_DIR =20 from qemu.accel import kvm_available from qemu.accel import tcg_available =20 -from avocado.utils import cloudinit -from avocado.utils import network -from avocado.utils import vmimage -from avocado.utils import datadrainer -from avocado.utils.path import find_command from avocado import skipIf =20 ACCEL_NOT_AVAILABLE_FMT =3D "%s accelerator does not seem to be available" @@ -27,86 +22,7 @@ KVM_NOT_AVAILABLE =3D ACCEL_NOT_AVAILABLE_FMT % "KVM" TCG_NOT_AVAILABLE =3D ACCEL_NOT_AVAILABLE_FMT % "TCG" =20 =20 -class BootLinuxBase(Test): - def download_boot(self): - self.log.debug('Looking for and selecting a qemu-img binary to be ' - 'used to create the bootable snapshot image') - # If qemu-img has been built, use it, otherwise the system wide one - # will be used. If none is available, the test will cancel. - qemu_img =3D os.path.join(BUILD_DIR, 'qemu-img') - if not os.path.exists(qemu_img): - qemu_img =3D find_command('qemu-img', False) - if qemu_img is False: - self.cancel('Could not find "qemu-img", which is required to ' - 'create the bootable image') - vmimage.QEMU_IMG =3D qemu_img - - self.log.info('Downloading/preparing boot image') - # Fedora 31 only provides ppc64le images - image_arch =3D self.arch - if image_arch =3D=3D 'ppc64': - image_arch =3D 'ppc64le' - try: - boot =3D vmimage.get( - 'fedora', arch=3Dimage_arch, version=3D'31', - checksum=3Dself.chksum, - algorithm=3D'sha256', - cache_dir=3Dself.cache_dirs[0], - snapshot_dir=3Dself.workdir) - except: - self.cancel('Failed to download/prepare boot image') - return boot.path - - def prepare_cloudinit(self, ssh_pubkey=3DNone): - self.log.info('Preparing cloudinit image') - try: - cloudinit_iso =3D os.path.join(self.workdir, 'cloudinit.iso') - self.phone_home_port =3D network.find_free_port() - cloudinit.iso(cloudinit_iso, self.name, - username=3D'root', - password=3D'password', - # QEMU's hard coded usermode router address - phone_home_host=3D'10.0.2.2', - phone_home_port=3Dself.phone_home_port, - authorized_key=3Dssh_pubkey) - except Exception: - self.cancel('Failed to prepare the cloudinit image') - return cloudinit_iso - -class BootLinux(BootLinuxBase): - """ - Boots a Linux system, checking for a successful initialization - """ - - timeout =3D 900 - chksum =3D None - - def setUp(self, ssh_pubkey=3DNone): - super(BootLinux, self).setUp() - self.vm.add_args('-smp', '2') - self.vm.add_args('-m', '1024') - self.set_up_boot() - self.set_up_cloudinit(ssh_pubkey) - - def set_up_boot(self): - path =3D self.download_boot() - self.vm.add_args('-drive', 'file=3D%s' % path) - - def set_up_cloudinit(self, ssh_pubkey=3DNone): - cloudinit_iso =3D self.prepare_cloudinit(ssh_pubkey) - self.vm.add_args('-drive', 'file=3D%s,format=3Draw' % cloudinit_is= o) - - def launch_and_wait(self): - self.vm.set_console() - self.vm.launch() - console_drainer =3D datadrainer.LineLogger(self.vm.console_socket.= fileno(), - logger=3Dself.log.getChil= d('console')) - console_drainer.start() - self.log.info('VM launched, waiting for boot confirmation from gue= st') - cloudinit.wait_for_phone_home(('0.0.0.0', self.phone_home_port), s= elf.name) - - -class BootLinuxX8664(BootLinux): +class BootLinuxX8664(LinuxTest): """ :avocado: tags=3Darch:x86_64 """ @@ -154,7 +70,7 @@ class BootLinuxX8664(BootLinux): self.launch_and_wait() =20 =20 -class BootLinuxAarch64(BootLinux): +class BootLinuxAarch64(LinuxTest): """ :avocado: tags=3Darch:aarch64 :avocado: tags=3Dmachine:virt @@ -212,7 +128,7 @@ class BootLinuxAarch64(BootLinux): self.launch_and_wait() =20 =20 -class BootLinuxPPC64(BootLinux): +class BootLinuxPPC64(LinuxTest): """ :avocado: tags=3Darch:ppc64 """ @@ -230,7 +146,7 @@ class BootLinuxPPC64(BootLinux): self.launch_and_wait() =20 =20 -class BootLinuxS390X(BootLinux): +class BootLinuxS390X(LinuxTest): """ :avocado: tags=3Darch:s390x """ diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 1e745f15a2..25ea54b6ff 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -5,15 +5,13 @@ import subprocess import time =20 from avocado import skipUnless -from avocado_qemu import Test, BUILD_DIR +from avocado_qemu import LinuxTest, BUILD_DIR from avocado_qemu import wait_for_console_pattern from avocado.utils import ssh =20 from qemu.accel import kvm_available from qemu.utils import get_info_usernet_hostfwd_port =20 -from boot_linux import BootLinux - =20 def run_cmd(args): subp =3D subprocess.Popen(args, @@ -72,7 +70,7 @@ def has_cmds(*cmds): return (True, '') =20 =20 -class VirtiofsSubmountsTest(BootLinux): +class VirtiofsSubmountsTest(LinuxTest): """ :avocado: tags=3Darch:x86_64 :avocado: tags=3Daccel:kvm --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612375274; cv=none; d=zohomail.com; s=zohoarc; b=Mdr9NzWKNqsdBa76dhI0mtrGlhHoqXjiXYdd6KDdYOIRAPT8USLZBNvNdO167krztidgElfYreqJF7uBkrRuiRRM0JVHP8WnZiV5tU8erRBQXptcgGQI13J5MyoL8+WnK5dPGvfxe7geeTGJc2yPKZThtEfovK+tQo5vNcKXyM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612375274; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eGRbyHbYQ9zo2z0wfHc5FihzqoXsnNABuTcXtfPDYOg=; b=nZQ1qgz4igq6n2cSGNaASH7w3RKjapunizjEIp46PefxjIxRP5BpNUcfii29aD0Zuju9lO/n0UkefcI5shxDqJdqLi6H7gxnVTXkjwtpeeEgxtIfSFcTFFzYVX+FNqd9mMZKQlVUXchvBndSohJDS6tukVwav14gTyxby+wDD08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612375274547265.52248951986246; Wed, 3 Feb 2021 10:01:14 -0800 (PST) Received: from localhost ([::1]:45632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MSl-0004VF-KP for importer@patchew.org; Wed, 03 Feb 2021 13:01:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Lur-0003Be-Vk for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lup-0004eu-0V for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:09 -0500 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-468-EbSTaYoqOe-ctOahbiq7og-1; Wed, 03 Feb 2021 12:24:56 -0500 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 2570B107ACC7; Wed, 3 Feb 2021 17:24:55 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 569E4163C8; Wed, 3 Feb 2021 17:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373166; 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=eGRbyHbYQ9zo2z0wfHc5FihzqoXsnNABuTcXtfPDYOg=; b=bfa4Q/kvdWYxpwClbtQFQhGt/YJqxGoRFwNJQg5TCIeEER5TPjqKlHrXTKz//P7X6kV7xL n4QcQo81w8oUUY56qCogVhiAMDh5BfS3U0TAYfTt54bg1BNOcUhVVR24NdMm/ly7V9Wcz2 cdDUwdBPgyEvikUZ3xuVHg4lRmHM3Dg= X-MC-Unique: EbSTaYoqOe-ctOahbiq7og-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 15/22] Acceptance Tests: move useful ssh methods to base class Date: Wed, 3 Feb 2021 12:23:50 -0500 Message-Id: <20210203172357.1422425-16-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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, T_FILL_THIS_FORM_SHORT=0.01 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Both the virtiofs submounts and the linux ssh mips malta tests contains useful methods related to ssh that deserve to be made available to other tests. Let's move them to the base LinuxTest class. The method that helps with setting up an ssh connection will now support both key and password based authentication, defaulting to key based. Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 49 ++++++++++++++++++++++- tests/acceptance/linux_ssh_mips_malta.py | 38 ++---------------- tests/acceptance/virtiofs_submounts.py | 36 ----------------- 3 files changed, 51 insertions(+), 72 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index b06692a59d..f0649e5011 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -10,6 +10,7 @@ =20 import logging import os +import re import sys import uuid import tempfile @@ -19,6 +20,7 @@ import avocado from avocado.utils import cloudinit from avocado.utils import datadrainer from avocado.utils import network +from avocado.utils import ssh from avocado.utils import vmimage from avocado.utils.path import find_command =20 @@ -40,6 +42,8 @@ else: sys.path.append(os.path.join(SOURCE_DIR, 'python')) =20 from qemu.machine import QEMUMachine +from qemu.utils import get_info_usernet_hostfwd_port + =20 def is_readable_executable_file(path): return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK) @@ -215,7 +219,50 @@ class Test(avocado.Test): cancel_on_missing=3Dcancel_on_missing) =20 =20 -class LinuxTest(Test): +class LinuxSSHMixIn: + """Contains utility methods for interacting with a guest via SSH.""" + + def ssh_connect(self, username, credential, credential_is_key=3DTrue): + self.ssh_logger =3D logging.getLogger('ssh') + res =3D self.vm.command('human-monitor-command', + command_line=3D'info usernet') + port =3D get_info_usernet_hostfwd_port(res) + self.assertIsNotNone(port) + self.assertGreater(port, 0) + self.log.debug('sshd listening on port: %d', port) + if credential_is_key: + self.ssh_session =3D ssh.Session('127.0.0.1', port=3Dport, + user=3Dusername, key=3Dcredenti= al) + else: + self.ssh_session =3D ssh.Session('127.0.0.1', port=3Dport, + user=3Dusername, password=3Dcre= dential) + for i in range(10): + try: + self.ssh_session.connect() + return + except: + time.sleep(4) + pass + self.fail('ssh connection timeout') + + def ssh_command(self, command): + self.ssh_logger.info(command) + result =3D self.ssh_session.cmd(command) + stdout_lines =3D [line.rstrip() for line + in result.stdout_text.splitlines()] + for line in stdout_lines: + self.ssh_logger.info(line) + stderr_lines =3D [line.rstrip() for line + in result.stderr_text.splitlines()] + for line in stderr_lines: + self.ssh_logger.warning(line) + + self.assertEqual(result.exit_status, 0, + f'Guest command failed: {command}') + return stdout_lines, stderr_lines + + +class LinuxTest(Test, LinuxSSHMixIn): """Facilitates having a cloud-image Linux based available. =20 For tests that indend to interact with guests, this is a better choice diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/li= nux_ssh_mips_malta.py index 1742235758..3f590a081f 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -12,7 +12,7 @@ import logging import time =20 from avocado import skipUnless -from avocado_qemu import Test +from avocado_qemu import Test, LinuxSSHMixIn from avocado_qemu import wait_for_console_pattern from avocado.utils import process from avocado.utils import archive @@ -21,7 +21,7 @@ from avocado.utils import ssh from qemu.utils import get_info_usernet_hostfwd_port =20 =20 -class LinuxSSH(Test): +class LinuxSSH(Test, LinuxSSHMixIn): =20 timeout =3D 150 # Not for 'configure --enable-debug --enable-debug-tcg' =20 @@ -72,41 +72,9 @@ class LinuxSSH(Test): def setUp(self): super(LinuxSSH, self).setUp() =20 - def ssh_connect(self, username, password): - self.ssh_logger =3D logging.getLogger('ssh') - res =3D self.vm.command('human-monitor-command', - command_line=3D'info usernet') - port =3D get_info_usernet_hostfwd_port(res) - if not port: - self.cancel("Failed to retrieve SSH port") - self.log.debug("sshd listening on port: %d", port) - self.ssh_session =3D ssh.Session(self.VM_IP, port=3Dport, - user=3Dusername, password=3Dpasswor= d) - for i in range(10): - try: - self.ssh_session.connect() - return - except: - time.sleep(4) - pass - self.fail("ssh connection timeout") - def ssh_disconnect_vm(self): self.ssh_session.quit() =20 - def ssh_command(self, command, is_root=3DTrue): - self.ssh_logger.info(command) - result =3D self.ssh_session.cmd(command) - stdout_lines =3D [line.rstrip() for line - in result.stdout_text.splitlines()] - for line in stdout_lines: - self.ssh_logger.info(line) - stderr_lines =3D [line.rstrip() for line - in result.stderr_text.splitlines()] - for line in stderr_lines: - self.ssh_logger.warning(line) - return stdout_lines, stderr_lines - def boot_debian_wheezy_image_and_ssh_login(self, endianess, kernel_pat= h): image_url, image_hash =3D self.get_image_info(endianess) image_path =3D self.fetch_asset(image_url, asset_hash=3Dimage_hash) @@ -127,7 +95,7 @@ class LinuxSSH(Test): wait_for_console_pattern(self, console_pattern, 'Oops') self.log.info('sshd ready') =20 - self.ssh_connect('root', 'root') + self.ssh_connect('root', 'root', False) =20 def shutdown_via_ssh(self): self.ssh_command('poweroff') diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 25ea54b6ff..d0fc103f72 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -10,7 +10,6 @@ from avocado_qemu import wait_for_console_pattern from avocado.utils import ssh =20 from qemu.accel import kvm_available -from qemu.utils import get_info_usernet_hostfwd_port =20 =20 def run_cmd(args): @@ -76,41 +75,6 @@ class VirtiofsSubmountsTest(LinuxTest): :avocado: tags=3Daccel:kvm """ =20 - def ssh_connect(self, username, keyfile): - self.ssh_logger =3D logging.getLogger('ssh') - res =3D self.vm.command('human-monitor-command', - command_line=3D'info usernet') - port =3D get_info_usernet_hostfwd_port(res) - self.assertIsNotNone(port) - self.assertGreater(port, 0) - self.log.debug('sshd listening on port: %d', port) - self.ssh_session =3D ssh.Session('127.0.0.1', port=3Dport, - user=3Dusername, key=3Dkeyfile) - for i in range(10): - try: - self.ssh_session.connect() - return - except: - time.sleep(4) - pass - self.fail('ssh connection timeout') - - def ssh_command(self, command): - self.ssh_logger.info(command) - result =3D self.ssh_session.cmd(command) - stdout_lines =3D [line.rstrip() for line - in result.stdout_text.splitlines()] - for line in stdout_lines: - self.ssh_logger.info(line) - stderr_lines =3D [line.rstrip() for line - in result.stderr_text.splitlines()] - for line in stderr_lines: - self.ssh_logger.warning(line) - - self.assertEqual(result.exit_status, 0, - f'Guest command failed: {command}') - return stdout_lines, stderr_lines - def run(self, args, ignore_error=3DFalse): stdout, stderr, ret =3D run_cmd(args) =20 --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612373997; cv=none; d=zohomail.com; s=zohoarc; b=c1Qt++zdLe+fy4bHpl/+jLCNrFYvpgSIEG8swVTuFx2lMZV9bdO6ioiD9NLx69hmzFtHSybkiL/FOYZ/p3vyR9/UhiAQxzMOcZ/g0XYb52GnO2QJ48UKEwPkSYV/9Z/w0arBClsE4qSLERFZ9Qiwlf5qTUmD2hQUrqa1+OYtqAY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612373997; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DtI1FivtGRL93IxkqVdB5iYxeHLnpGF3vCTdENNmsBA=; b=C+P4CTn+5Q+B8ddcNBGyMIBKQDQV7/NWQIYKdNOSsNwQqmtJklbM2ovV2M1SHs3tgJHcMEJi4Y/5k4BeiUPvzOsK3KjUC2mGTJlSI8AGY4xisLKHpLk5vzjRCt43Cxt4FlkLdFx+v6cjXblu2JNKk0/OjaFFlBTZXx9RCs8FkBw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612373997907771.7404534403282; Wed, 3 Feb 2021 09:39:57 -0800 (PST) Received: from localhost ([::1]:45868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7M8C-00056A-R6 for importer@patchew.org; Wed, 03 Feb 2021 12:39:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Lts-0001wE-Vo for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lto-0004Vv-2T for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:08 -0500 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-109-w01MrpyJOt-MZbpEofs2Ug-1; Wed, 03 Feb 2021 12:24:59 -0500 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 16736803F42; Wed, 3 Feb 2021 17:24:57 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 48F621C92F; Wed, 3 Feb 2021 17:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373100; 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=DtI1FivtGRL93IxkqVdB5iYxeHLnpGF3vCTdENNmsBA=; b=Xmoz5f6TfUGdTMvJNERVSf5C/SEGnbvZwIgP7rDgBFBOGsHT8F0cP+4H+W8yla2GS8zY+P SPDTooRqXdE4LDcXlLVZ8rtXSMwEfOSSVxzQwmdDTMfogFWOVp9N9vj3KYR4wwEP8ovvFY 3gEn1WeAA8zazLdOk9spF28mOeH/+2M= X-MC-Unique: w01MrpyJOt-MZbpEofs2Ug-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 16/22] Acceptance Tests: introduce method for requiring an accelerator Date: Wed, 3 Feb 2021 12:23:51 -0500 Message-Id: <20210203172357.1422425-17-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Some tests explicitly require a QEMU accelerator to be available. Given that this depends on some runtime aspects not known before the test is started, such as the currently set QEMU binary, it's left to be checked also at runtime. Signed-off-by: Cleber Rosa Reviewed-by: Beraldo Leal Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 24 ++++++++++++++++ tests/acceptance/boot_linux.py | 34 ++++++----------------- tests/acceptance/virtiofs_submounts.py | 5 +--- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index f0649e5011..472088ae7d 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -41,6 +41,8 @@ else: =20 sys.path.append(os.path.join(SOURCE_DIR, 'python')) =20 +from qemu.accel import kvm_available +from qemu.accel import tcg_available from qemu.machine import QEMUMachine from qemu.utils import get_info_usernet_hostfwd_port =20 @@ -166,6 +168,28 @@ class Test(avocado.Test): return vals.pop() return None =20 + def require_accelerator(self, accelerator): + """ + Requires an accelerator to be available for the test to continue + + It takes into account the currently set qemu binary. + + If the check fails, the test is canceled. If the check itself + for the given accelerator is not available, the test is also + canceled. + + :param accelerator: name of the accelerator, such as "kvm" or "tcg" + :type accelerator: str + """ + checker =3D {'tcg': tcg_available, + 'kvm': kvm_available}.get(accelerator) + if checker is None: + self.cancel("Don't know how to check for the presence " + "of accelerator %s" % accelerator) + if not checker(qemu_bin=3Dself.qemu_bin): + self.cancel("%s accelerator does not seem to be " + "available" % accelerator) + def setUp(self): self._vms =3D {} =20 diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py index 14e89d020d..0d178038a0 100644 --- a/tests/acceptance/boot_linux.py +++ b/tests/acceptance/boot_linux.py @@ -12,15 +12,8 @@ import os =20 from avocado_qemu import LinuxTest, BUILD_DIR =20 -from qemu.accel import kvm_available -from qemu.accel import tcg_available - from avocado import skipIf =20 -ACCEL_NOT_AVAILABLE_FMT =3D "%s accelerator does not seem to be available" -KVM_NOT_AVAILABLE =3D ACCEL_NOT_AVAILABLE_FMT % "KVM" -TCG_NOT_AVAILABLE =3D ACCEL_NOT_AVAILABLE_FMT % "TCG" - =20 class BootLinuxX8664(LinuxTest): """ @@ -34,8 +27,7 @@ class BootLinuxX8664(LinuxTest): :avocado: tags=3Dmachine:pc :avocado: tags=3Daccel:tcg """ - if not tcg_available(self.qemu_bin): - self.cancel(TCG_NOT_AVAILABLE) + self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") self.launch_and_wait() =20 @@ -44,8 +36,7 @@ class BootLinuxX8664(LinuxTest): :avocado: tags=3Dmachine:pc :avocado: tags=3Daccel:kvm """ - if not kvm_available(self.arch, self.qemu_bin): - self.cancel(KVM_NOT_AVAILABLE) + self.require_accelerator("kvm") self.vm.add_args("-accel", "kvm") self.launch_and_wait() =20 @@ -54,8 +45,7 @@ class BootLinuxX8664(LinuxTest): :avocado: tags=3Dmachine:q35 :avocado: tags=3Daccel:tcg """ - if not tcg_available(self.qemu_bin): - self.cancel(TCG_NOT_AVAILABLE) + self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") self.launch_and_wait() =20 @@ -64,8 +54,7 @@ class BootLinuxX8664(LinuxTest): :avocado: tags=3Dmachine:q35 :avocado: tags=3Daccel:kvm """ - if not kvm_available(self.arch, self.qemu_bin): - self.cancel(KVM_NOT_AVAILABLE) + self.require_accelerator("kvm") self.vm.add_args("-accel", "kvm") self.launch_and_wait() =20 @@ -91,8 +80,7 @@ class BootLinuxAarch64(LinuxTest): :avocado: tags=3Daccel:tcg :avocado: tags=3Dcpu:max """ - if not tcg_available(self.qemu_bin): - self.cancel(TCG_NOT_AVAILABLE) + self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") self.vm.add_args("-cpu", "max") self.vm.add_args("-machine", "virt,gic-version=3D2") @@ -105,8 +93,7 @@ class BootLinuxAarch64(LinuxTest): :avocado: tags=3Dcpu:host :avocado: tags=3Ddevice:gicv2 """ - if not kvm_available(self.arch, self.qemu_bin): - self.cancel(KVM_NOT_AVAILABLE) + self.require_accelerator("kvm") self.vm.add_args("-accel", "kvm") self.vm.add_args("-cpu", "host") self.vm.add_args("-machine", "virt,gic-version=3D2") @@ -119,8 +106,7 @@ class BootLinuxAarch64(LinuxTest): :avocado: tags=3Dcpu:host :avocado: tags=3Ddevice:gicv3 """ - if not kvm_available(self.arch, self.qemu_bin): - self.cancel(KVM_NOT_AVAILABLE) + self.require_accelerator("kvm") self.vm.add_args("-accel", "kvm") self.vm.add_args("-cpu", "host") self.vm.add_args("-machine", "virt,gic-version=3D3") @@ -140,8 +126,7 @@ class BootLinuxPPC64(LinuxTest): :avocado: tags=3Dmachine:pseries :avocado: tags=3Daccel:tcg """ - if not tcg_available(self.qemu_bin): - self.cancel(TCG_NOT_AVAILABLE) + self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") self.launch_and_wait() =20 @@ -159,7 +144,6 @@ class BootLinuxS390X(LinuxTest): :avocado: tags=3Dmachine:s390-ccw-virtio :avocado: tags=3Daccel:tcg """ - if not tcg_available(self.qemu_bin): - self.cancel(TCG_NOT_AVAILABLE) + self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") self.launch_and_wait() diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index d0fc103f72..0298807e5c 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -9,8 +9,6 @@ from avocado_qemu import LinuxTest, BUILD_DIR from avocado_qemu import wait_for_console_pattern from avocado.utils import ssh =20 -from qemu.accel import kvm_available - =20 def run_cmd(args): subp =3D subprocess.Popen(args, @@ -201,8 +199,7 @@ class VirtiofsSubmountsTest(LinuxTest): self.vm.add_args('-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0= -:22', '-device', 'virtio-net,netdev=3Dvnet') =20 - if not kvm_available(self.arch, self.qemu_bin): - self.cancel(KVM_NOT_AVAILABLE) + self.require_accelerator("kvm") self.vm.add_args('-accel', 'kvm') =20 def tearDown(self): --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374127; cv=none; d=zohomail.com; s=zohoarc; b=WpEAJAeiH3yUDpNvARruTACgH8Q4cKBuMHx3K4iQdhh1ciZlXyjGJVfpgeU4jey0Qlq1tRQLJHXxb0jmFODArJZHafx4LYdiCgKhSBuCdZPrQ4v8FHBuFlxGLWYgHafQdJD+N/jJSQtTozuqoCWxr76rFk7sVnhSlzi9g3+309M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374127; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xHopKoYPQzWgkBiTs5viADhK/2KIV7eLK1OsgwjPsWQ=; b=mRwxgGvax+qkTDJC60iKyNjUsDsfiYlqFXevhws2ud2TIS8Wgul21NmOm5idXaU5yzOBRTqz9kKasOuMFOTasEyRKh7/SA80EhBYWSV503M3DbbssxoQZPAMpYkGvPh6BjKEXVdz/8C1kMEMjFpMH7B1wHcrJ7asaXOU0HXNYwc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374127705312.575531486866; Wed, 3 Feb 2021 09:42:07 -0800 (PST) Received: from localhost ([::1]:52362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MAI-00080j-Fm for importer@patchew.org; Wed, 03 Feb 2021 12:42:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Ltt-0001xk-FV for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Ltq-0004XR-Kn for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:09 -0500 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-347-zQAkMmZyNCecht6CbhatXg-1; Wed, 03 Feb 2021 12:25:00 -0500 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 2CFF11936B73; Wed, 3 Feb 2021 17:24:59 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A69C1971C; Wed, 3 Feb 2021 17:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373104; 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=xHopKoYPQzWgkBiTs5viADhK/2KIV7eLK1OsgwjPsWQ=; b=BEDO98+81xT56blaDhPv0VJg2r0CKiknR50ZhcYB37MJsZUvYt0/ltOR8TtSEHlR1bNm4F 5fv4xDQcyCxb1Qw9M1ERvdcVQrDQFtKeGEwyt6tUpoRmHxrLS5O2dsR+j7IeR4n29zfVY/ BGVGLnrbHbBksrW2T1v0dB0OsL/YsZc= X-MC-Unique: zQAkMmZyNCecht6CbhatXg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 17/22] Acceptance Tests: fix population of public key in cloudinit image Date: Wed, 3 Feb 2021 12:23:52 -0500 Message-Id: <20210203172357.1422425-18-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Currently the path of the ssh public key is being set, but its content is obviously what's needed. Signed-off-by: Cleber Rosa Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 472088ae7d..8156224625 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -337,13 +337,15 @@ class LinuxTest(Test, LinuxSSHMixIn): try: cloudinit_iso =3D os.path.join(self.workdir, 'cloudinit.iso') self.phone_home_port =3D network.find_free_port() + with open(ssh_pubkey) as pubkey: + pubkey_content =3D pubkey.read() cloudinit.iso(cloudinit_iso, self.name, username=3D'root', password=3D'password', # QEMU's hard coded usermode router address phone_home_host=3D'10.0.2.2', phone_home_port=3Dself.phone_home_port, - authorized_key=3Dssh_pubkey) + authorized_key=3Dpubkey_content) except Exception: self.cancel('Failed to prepare the cloudinit image') return cloudinit_iso --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612375666; cv=none; d=zohomail.com; s=zohoarc; b=UHRFDvParnLraFGDe6Yx82HmbDDUsAE1ybAtXJvTpvBNTNGEaPNjHZLWpPwwANXQNeEHPxk5MURKHYVTWrK5Fb1akKlnkEqsAIwB6LNGyPmxEe7etuK8pQODtXHdebHXywQopqZBa8IkI34u77Pf0EAD0iqPKqQfIQOknFMZIK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612375666; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y5G7ztCpaJBGFkwbHALru83qH2lN/IWnoOVBpPh6qa4=; b=YssowwKfZoBzfWErzjis59PuX2AlNXyNF4E/YnxBEKHhDiqujCfu9ZNUz13ygMKKG4Hf9HBvxJ2qIvItrgRc8fwdamyxsvtQbgxIuTcsSOx1zh+3CFGvvHjwqXRRMRB2QEurNZ0qT2WNYP3CE4c7BVT9H6k85mqVl4bvPJqWDp4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612375666832566.6234467567078; Wed, 3 Feb 2021 10:07:46 -0800 (PST) Received: from localhost ([::1]:34264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MZ7-0003xC-Px for importer@patchew.org; Wed, 03 Feb 2021 13:07:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Luu-0003EK-Qi for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lut-0004fI-AQ for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:26:12 -0500 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-510-oqv0fDQzOBa2-ZdkZ5XExA-1; Wed, 03 Feb 2021 12:25:02 -0500 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 2A061801964; Wed, 3 Feb 2021 17:25:01 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 366A11F445; Wed, 3 Feb 2021 17:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373170; 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=Y5G7ztCpaJBGFkwbHALru83qH2lN/IWnoOVBpPh6qa4=; b=cyR33XX3s2jNzat6DqQf18rVjSfjBXRDUWWPg1ZDUbLan5Ob1YtZPpxDk3i8wfGpLIQ6uo StUsCpRCl6xpFKaCcKX8f2iw6WpDD5KrMHeIdJNSBzgxWOf58pAxeHE6pwN7SMw6FE9BYt 6ItXwAp/zP4qGUjwKptQRzHpkITfmfg= X-MC-Unique: oqv0fDQzOBa2-ZdkZ5XExA-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 18/22] Acceptance Tests: set up existing ssh keys by default Date: Wed, 3 Feb 2021 12:23:53 -0500 Message-Id: <20210203172357.1422425-19-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It's questionable wether it's necessary to create one brand new pair for each test. It's not questionable that it takes less time and resources to just use the keys available at "tests/keys" that exist for that exact reason. If a location for the public key is not given explicitly, the LinuxTest will now set up the existing pair of keys as the default. This removes the need for a lot of boiler plate code. To avoid the ssh client from erroring on permission issues, a directory with restricive permissions is created for the private key. This should still be a lot cheaper than creating a new key. Signed-off-by: Cleber Rosa Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 8156224625..5f4dd6b9ec 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -11,6 +11,7 @@ import logging import os import re +import shutil import sys import uuid import tempfile @@ -301,8 +302,21 @@ class LinuxTest(Test, LinuxSSHMixIn): self.vm.add_args('-smp', '2') self.vm.add_args('-m', '1024') self.set_up_boot() + if ssh_pubkey is None: + ssh_pubkey, self.ssh_key =3D self.set_up_existing_ssh_keys() self.set_up_cloudinit(ssh_pubkey) =20 + def set_up_existing_ssh_keys(self): + ssh_public_key =3D os.path.join(SOURCE_DIR, 'tests', 'keys', 'id_r= sa.pub') + source_private_key =3D os.path.join(SOURCE_DIR, 'tests', 'keys', '= id_rsa') + ssh_dir =3D os.path.join(self.workdir, '.ssh') + os.mkdir(ssh_dir, mode=3D0o700) + ssh_private_key =3D os.path.join(ssh_dir, + os.path.basename(source_private_key= )) + shutil.copyfile(source_private_key, ssh_private_key) + os.chmod(ssh_private_key, 0o600) + return (ssh_public_key, ssh_private_key) + def download_boot(self): self.log.debug('Looking for and selecting a qemu-img binary to be ' 'used to create the bootable snapshot image') --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374335; cv=none; d=zohomail.com; s=zohoarc; b=Fdn9LqdkdJV08m0h3dsI0WLxiUU3nZufWJm0nQF8r3jH5PSFMSgq5YWJKqJbJf0xBN3GPWYcfqvoH0KnD1BWwKihDjhnzw+RS9Apz4+hPK+nZiSU48AgFL/HJH3QbyEZdmAHy0b8Qf/CPZ3/xjggGisyXrbrwTcAYDs8QknHwCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374335; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mVrO1J5lUM3ZE6ZkQYr5IGoQI8bZ34a1Sln62JjAouU=; b=apEkHeOAMxW2bZj76HA040zlNSAeoJ5mPTq38ezswdl+VcCs/TCGgezPiibUROyMQ/gIwZHvjCZ3aFD7yQlpHgIT7h8JUg3wjnGPDoE6sVpHdn9U9Atkp6R3rMTq2QJUZR4HMnV8fzqyY8pvgxIEjoZJ4qsDaFyO+FOm1RZkKKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374335302718.099289357987; Wed, 3 Feb 2021 09:45:35 -0800 (PST) Received: from localhost ([::1]:60880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MDe-00039E-3x for importer@patchew.org; Wed, 03 Feb 2021 12:45:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Lu1-00026h-1m for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Ltz-0004YX-CP for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:16 -0500 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-436-mwxvfterMyaQRBT22Pknvw-1; Wed, 03 Feb 2021 12:25:12 -0500 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 CC83A804022; Wed, 3 Feb 2021 17:25:10 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E44A1971D; Wed, 3 Feb 2021 17:25:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373114; 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=mVrO1J5lUM3ZE6ZkQYr5IGoQI8bZ34a1Sln62JjAouU=; b=P5Osspjnpvi+NrTzL5Ykc+M3ZT1Bvx8ZmfR17B5xcsxXe768fLF/pLKRd1fWx0rk3DJ7Xr 6Pqw9hf+TuEDC3k4WWiy1BafMVAHmNW5W3sTxkn3s9K1X9RW/TdAD759qbms4jCR4PnqCE Zb0TcYnpbRt8Kes+jDnnoA1aBxnNp/s= X-MC-Unique: mwxvfterMyaQRBT22Pknvw-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 19/22] Acceptance Tests: add port redirection for ssh by default Date: Wed, 3 Feb 2021 12:23:54 -0500 Message-Id: <20210203172357.1422425-20-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" For users of the LinuxTest class, let's set up the VM with the port redirection for SSH, instead of requiring each test to set the same arguments. Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 2 ++ tests/acceptance/virtiofs_submounts.py | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 5f4dd6b9ec..89669cc604 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -301,6 +301,8 @@ class LinuxTest(Test, LinuxSSHMixIn): super(LinuxTest, self).setUp() self.vm.add_args('-smp', '2') self.vm.add_args('-m', '1024') + self.vm.add_args('-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0= -:22', + '-device', 'virtio-net,netdev=3Dvnet') self.set_up_boot() if ssh_pubkey is None: ssh_pubkey, self.ssh_key =3D self.set_up_existing_ssh_keys() diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index 0298807e5c..94b59edd6d 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -195,10 +195,6 @@ class VirtiofsSubmountsTest(LinuxTest): self.vm.add_args('-kernel', vmlinuz, '-append', 'console=3DttyS0 root=3D/dev/sda1') =20 - # Allow us to connect to SSH - self.vm.add_args('-netdev', 'user,id=3Dvnet,hostfwd=3D:127.0.0.1:0= -:22', - '-device', 'virtio-net,netdev=3Dvnet') - self.require_accelerator("kvm") self.vm.add_args('-accel', 'kvm') =20 --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374488; cv=none; d=zohomail.com; s=zohoarc; b=U1vAeYi9mD91n19vU3k/CxWgZBemoxEG2ooWKrV63QI8BX1gUYf1rievddFGYLeFYlfYKUXy3k9bOOR2cWm/m+jnTArnq1kUOeFRV4b87uEUK+xU/xsxwEBYkNYv14KTJfY84BlvSqpUdoDK5KR74330J31ouPYrURzE1ukF2+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374488; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PHgiFwT/SMd+EuMUo22YU4xzImorywxh2tc+fWIvvFs=; b=nXhdveHuNLlNU6MEuhNhHbeyRsP0txnSm0UJr7sRVFzMYOlme/zSBZEBju19nfPtqbLbZQOpgC77/uVY7LswRINRxTQVq/rjX+xzFicZuo03Kfs+GugE9oA4OyYcRFnz3NCj/O/+BI4fZmhcz6/x40z6vmXzOLuN4vr2H3J/QnU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374488322243.3657931228512; Wed, 3 Feb 2021 09:48:08 -0800 (PST) Received: from localhost ([::1]:41380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MG7-000792-58 for importer@patchew.org; Wed, 03 Feb 2021 12:48:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Lu5-00026r-4m for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lu2-0004Yr-L4 for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:20 -0500 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-32-5MP368UFM7qx3OHRcWv62Q-1; Wed, 03 Feb 2021 12:25:14 -0500 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 C03E0CF981; Wed, 3 Feb 2021 17:25:12 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F076E163C8; Wed, 3 Feb 2021 17:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373116; 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=PHgiFwT/SMd+EuMUo22YU4xzImorywxh2tc+fWIvvFs=; b=J4ijJs/YQXuewdSGzXjp0ACIvrT5aEmtdQ0QfG0B0/JN9Vq+KoUTOlXuD9m+O8cOZ2AEVa zeefdCtQJPQG7GB7DDfcTjJPZgIcCx5jSToZ7EKV6OY6wvfAs0QAw8e1ig7VvZqwFtveBn 2adCOMBbnQcSlK2kJzDpoCKpma5zKEE= X-MC-Unique: 5MP368UFM7qx3OHRcWv62Q-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 20/22] Acceptance Tests: add basic documentation on LinuxTest base class Date: Wed, 3 Feb 2021 12:23:55 -0500 Message-Id: <20210203172357.1422425-21-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Cleber Rosa Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Willian Rampazzo --- docs/devel/testing.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 209f9d8172..fe0112b21c 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -790,6 +790,32 @@ and hypothetical example follows: At test "tear down", ``avocado_qemu.Test`` handles all the QEMUMachines shutdown. =20 +The ``avocado_qemu.LinuxTest`` base test class +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``avocado_qemu.LinuxTest`` is further specialization of the +``avocado_qemu.Test`` class, so it contains all the characteristics of +the later plus some extra features. + +First of all, this base class is intended for tests that need to +interact with a fully booted and operational Linux guest. The most +basic example looks like this: + +.. code:: + + from avocado_qemu import LinuxTest + + + class SomeTest(LinuxTest): + + def test(self): + self.launch_and_wait() + self.ssh_connect('root', self.ssh_key) + self.ssh_command('some_command_to_be_run_in_the_guest') + +Please refer to tests that use ``avocado_qemu.LinuxTest`` under +``tests/acceptance`` for more examples. + QEMUMachine ~~~~~~~~~~~ =20 --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374708; cv=none; d=zohomail.com; s=zohoarc; b=i8nmPnRmGiQuNpjJGW99iDm37jmlx4+Rkq4YOfOR2N/vt37tOSsoL5xDzAiRbeDIM0FOpFs3lLiZ8+lMpLfSiSwpatRtjOWQHc2rRX9QEO44A3+tfDuRbO5AFLW4k6J1D1WCJE8qGsukxb7AsYb4ZjLv5abcWizngLfpnVy1p44= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374708; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cpDcUCq8DV4Xy0rNpbty3md4NOTTQ/BGy/PcQvKzxI4=; b=IvPW+v/cq3q5cCnmtWV5PrZ+MZEvW8ZhCUJdA/QlslQNUCzEQB9ivZAIFribUpb8DPZuTLfiG5s61qeuUzHjh/hqZASsxRdhI10Psp6DVanGOAhoJmRF5rJIgy9c2HzpILyzeG458+40Y9hKzlxJ7zLBeK/QKMPE6CPy5GV/R64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374708946193.26145564129774; Wed, 3 Feb 2021 09:51:48 -0800 (PST) Received: from localhost ([::1]:51422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MJf-000329-Ss for importer@patchew.org; Wed, 03 Feb 2021 12:51:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LuB-00027X-Qh for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57712) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lu4-0004ZG-FX for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:25 -0500 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-KfhVLe00MYSKqpbsJgtIVw-1; Wed, 03 Feb 2021 12:25:16 -0500 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 B0E6F1800D41; Wed, 3 Feb 2021 17:25:14 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2DF1163C8; Wed, 3 Feb 2021 17:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373119; 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=cpDcUCq8DV4Xy0rNpbty3md4NOTTQ/BGy/PcQvKzxI4=; b=fFEWZTUHl2avdVRk9fLzE2Lf9YWnP2PCbUIrJgy2c+zZ19iNhUlRn4OtQSQavOIfjMF9wl zKohQGA2xos7AdrzaovzEcJymh7rlTR/hrFN+Cfq5Mq5DdYMouaRZzKq6DzRyF8HZqKmhH NW28fId/QTYtKQwX1Z7nAu4NJe5e5h0= X-MC-Unique: KfhVLe00MYSKqpbsJgtIVw-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 21/22] Acceptance Tests: introduce CPU hotplug test Date: Wed, 3 Feb 2021 12:23:56 -0500 Message-Id: <20210203172357.1422425-22-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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_H3=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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Even though there are qtest based tests for hotplugging CPUs (from which this test took some inspiration from), this one adds checks from a Linux guest point of view. It should also serve as an example for tests that follow a similar pattern and need to interact with QEMU (via qmp) and with the Linux guest via SSH. Signed-off-by: Cleber Rosa Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Willian Rampazzo --- tests/acceptance/hotplug_cpu.py | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/acceptance/hotplug_cpu.py diff --git a/tests/acceptance/hotplug_cpu.py b/tests/acceptance/hotplug_cpu= .py new file mode 100644 index 0000000000..a22b264b4b --- /dev/null +++ b/tests/acceptance/hotplug_cpu.py @@ -0,0 +1,38 @@ +# Functional test that hotplugs a CPU and checks it on a Linux guest +# +# Copyright (c) 2021 Red Hat, Inc. +# +# Author: +# Cleber Rosa +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +from avocado_qemu import LinuxTest + + +class HotPlugCPU(LinuxTest): + + def test(self): + """ + :avocado: tags=3Darch:x86_64 + :avocado: tags=3Dmachine:q35 + :avocado: tags=3Daccel:kvm + """ + self.require_accelerator('kvm') + self.vm.add_args('-accel', 'kvm') + self.vm.add_args('-cpu', 'Haswell') + self.vm.add_args('-smp', '1,sockets=3D1,cores=3D2,threads=3D1,maxc= pus=3D2') + self.launch_and_wait() + + self.ssh_connect('root', self.ssh_key) + self.ssh_command('test -e /sys/devices/system/cpu/cpu0') + with self.assertRaises(AssertionError): + self.ssh_command('test -e /sys/devices/system/cpu/cpu1') + + self.vm.command('device_add', + driver=3D'Haswell-x86_64-cpu', + socket_id=3D0, + core_id=3D1, + thread_id=3D0) + self.ssh_command('test -e /sys/devices/system/cpu/cpu1') --=20 2.25.4 From nobody Sat May 18 22:54:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612374187; cv=none; d=zohomail.com; s=zohoarc; b=W2vDF1m2QRPhkaMTtCc0Jl8ZhKx/uiWW0X+YYSQG8eEUhNdxaKSV/M91B37mKOWgYkQD2X5aVsHpH/3zdiK5Ggmn3E0ObrU+qctp3DaV1ywzTXCt6fRBGXEVVZDjzhG+1+yGppmUEiDvnIKsfvcSXXvcJ2t0VeWHMCSbu8eB5N0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612374187; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rH5xxjg98raiZvADhOjMFHJRqaTeSsSQDeu5asmsHOI=; b=W6kN1HACFToiARGcXFB0Nj+J9ykzU1r90Qh81gmTlnQpBc4OL/OJIxZYnw20jM3dd/cZnGAvwTiccrt/VtJMxJs/WiQlN4JG7aKZv4+7VqnTFy2dSM29Tdf+QSuQhIz78T6l8gpXnvxE9H5whMl1wElqJADuB/TSL9Gic7TTJhM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612374187716490.45318610328707; Wed, 3 Feb 2021 09:43:07 -0800 (PST) Received: from localhost ([::1]:54576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7MBG-0000Up-EJ for importer@patchew.org; Wed, 03 Feb 2021 12:43:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7LuF-00028R-Fc for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l7Lu5-0004ZS-MR for qemu-devel@nongnu.org; Wed, 03 Feb 2021 12:25:31 -0500 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-196-sNFNPiD4NyqymjnZx18ZPA-1; Wed, 03 Feb 2021 12:25:18 -0500 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 A3512804023; Wed, 3 Feb 2021 17:25:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-89.rdu2.redhat.com [10.10.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D59E91971C; Wed, 3 Feb 2021 17:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612373120; 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=rH5xxjg98raiZvADhOjMFHJRqaTeSsSQDeu5asmsHOI=; b=DGCU+N6ZxHIuyFMQ1L3WK3SaTaSZQqOSrzHPd2TUb6tpm6s5u9HjbX70E7RdrIHH1iw0/d t6k2CDmIcUJAGDNCoJfMbrWvGSECojfozmFXvr5+BEUHsyjbQbMG080MVnyhiL/kBZt67Q FcVXcr2PZEdEvQwO7HL7YuQuJVVcbpA= X-MC-Unique: sNFNPiD4NyqymjnZx18ZPA-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH 22/22] [NOTFORMERGE] Bump Avocado version to latest master Date: Wed, 3 Feb 2021 12:23:57 -0500 Message-Id: <20210203172357.1422425-23-crosa@redhat.com> In-Reply-To: <20210203172357.1422425-1-crosa@redhat.com> References: <20210203172357.1422425-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=crosa@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.539, 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: Fam Zheng , Aleksandar Rikalo , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , John Snow , Eric Auger , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This is intende to be replaced by a bump to Avocado 85.0, to be released by Feb 8 2021. Latest master contains an improvement to "avocado.utils.vmimage" that let's it download older Fedora images from the archive locations. That allows the currently set Fedora 31 images to continue being used. Reference: https://github.com/avocado-framework/avocado/milestone/11 Reference: https://github.com/avocado-framework/avocado/commit/e4d67e96ee95= 63436dcf7dd83902723576657d29 Signed-off-by: Cleber Rosa --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 62e8ffd28c..8ddf0d8c86 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,5 @@ # Add Python module requirements, one per line, to be installed # in the tests/venv Python virtual environment. For more info, # refer to: https://pip.pypa.io/en/stable/user_guide/#id1 -avocado-framework=3D=3D83.0 +git+https://github.com/avocado-framework/avocado@9b372adeec6dceaba276ca472= 9f2e5a2fcccaa4c#egg=3Davocado_framework pycdlib=3D=3D1.11.0 --=20 2.25.4