From nobody Sun Apr 28 03:09:15 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=1616538006; cv=none; d=zohomail.com; s=zohoarc; b=hXd4SM4Xnj4Cx626xh14A0MpoYdpAfaE5tVBh9HrL+/1OXbwfQnFfvqNXoCzKcokNHoRBtyBS8XEEFsWtDk9lM+iiVeq41up1J5MUYjxyHCppXmekIM8vm5Mk17LZomVdxgU57jtBkSW/Uu8VSmXotFxNqI9yzSW8lqiBCrKugE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538006; 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=vJeSH/djHWK9OshZxvKc5DommzW+sKFhqyh+yN1lwSw=; b=HXBkBdO84N9/1Nl8jWv62vFZKQC+TzSRGSiFPB1r7C1ZUV+jy/jFV53/2fqktcrjrkOuWJ0Vx/IsP7gzgOCozB5jwxrAnen6rUtRo3Xj3x9nW5vfspPsSXp0XPa9wYUMMKx++dcYkWzdMxIz16crKvHfDHPBPiPh8YaKwRdWuvU= 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 16165380062341007.6803417883142; Tue, 23 Mar 2021 15:20:06 -0700 (PDT) Received: from localhost ([::1]:59334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpNc-000334-SG for importer@patchew.org; Tue, 23 Mar 2021 18:20:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJf-0006zt-RF for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJd-0002pf-Mo for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:15:59 -0400 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-280-HyLhaPydPvqhIouaFKLOzg-1; Tue, 23 Mar 2021 18:15:54 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F41991853021; Tue, 23 Mar 2021 22:15:52 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D3936087C; Tue, 23 Mar 2021 22:15:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537756; 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=vJeSH/djHWK9OshZxvKc5DommzW+sKFhqyh+yN1lwSw=; b=HzQtUf2rUQN63WMqjRktGU8s6OOLLzCncItnMXe4d8xSCIT0mdkwGm98l8EniL5UI4EuSj 5f2pX42AJvnGAtsrShrWJAKl00YBtpZoh9ySv7bDZ41Q5cr3pwdty5D9eBccW+YTVZfQVA fjvVE2INXNjU96qAK8B3wmqUwnNzcG4= X-MC-Unique: HyLhaPydPvqhIouaFKLOzg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 01/10] tests/acceptance/virtiofs_submounts.py: add missing accel tag Date: Tue, 23 Mar 2021 18:15:30 -0400 Message-Id: <20210323221539.3532660-2-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal 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 tag 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 Reviewed-by: Eric Auger --- 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 46fa65392a..5b74ce2929 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -70,6 +70,7 @@ def test_something_that_needs_cmd1_and_cmd2(self): class VirtiofsSubmountsTest(LinuxTest): """ :avocado: tags=3Darch:x86_64 + :avocado: tags=3Daccel:kvm """ =20 def get_portfwd(self): --=20 2.25.4 From nobody Sun Apr 28 03:09:15 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=1616537973; cv=none; d=zohomail.com; s=zohoarc; b=lweWACUFhN5ImNpu/UUDvFGiEwtSk1BUUYBepjX4YCP2+oIM3w3BjhcQiE8qNn30CUKhWiBOOQms6dJbbZ4Sn5v30lorvRUSyWfX2xq8Cnh4kI2gq41CJjEYBgU7k0EV25Z6MC79MNGMy0gj9pRJcjWYszdcNJAI24RVh4ma5XU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616537973; 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=m6RABPgzm9GQ0CDaBSB5dium36L1mCKEKLhgAcc/LZI=; b=ODsjw9SwrXtSj1TFInwqWQP7dYtSNkGLxuwb64qG/Kcvkkn9OQa0V4Z3lacEuQg6btecu0LOD8uOb1LM6ZTV6wW0S8InNti0oQxnT4sJsYNf4JPwYXULEp/kGUa+lBs+TLSe/OCzqiNG3BbhmNHUUsuc9CkRNy8SneJX+pnNkYA= 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 1616537973843149.86627289770422; Tue, 23 Mar 2021 15:19:33 -0700 (PDT) Received: from localhost ([::1]:57612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpN6-00026y-P6 for importer@patchew.org; Tue, 23 Mar 2021 18:19:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJg-00071V-N3 for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJe-0002pl-D1 for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:00 -0400 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-192-q28QGhJnM1CLaYF9jsA9NQ-1; Tue, 23 Mar 2021 18:15:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B9DC9520F; Tue, 23 Mar 2021 22:15:54 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F92860877; Tue, 23 Mar 2021 22:15:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537757; 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=m6RABPgzm9GQ0CDaBSB5dium36L1mCKEKLhgAcc/LZI=; b=LkiJ2DCvg1u1fiH6B92jOSJbkakkCoVhx4nrsLfSLxMPMvUBB0KCjc/GPAncHQ8EyVZqsc 8k61UD5CuIudwFEaJnAgUL/6XB/5qSFdlc3LeI8eUp15KGt6nz67KrGzmgoamtjii6mG2C LGdxNe7qKwYJcXQMxJt0duGSiaArRE0= X-MC-Unique: q28QGhJnM1CLaYF9jsA9NQ-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 02/10] tests/acceptance/virtiofs_submounts.py: evaluate string not length Date: Tue, 23 Mar 2021 18:15:31 -0400 Message-Id: <20210323221539.3532660-3-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal 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 Reviewed-by: Eric Auger Reviewed-by: Willian Rampazzo --- 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 5b74ce2929..ca64b76301 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -251,7 +251,7 @@ def setUp(self): =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 Sun Apr 28 03:09:15 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=1616538500; cv=none; d=zohomail.com; s=zohoarc; b=gGv6q7g97TE1gIdgVeLiQ9HmhKmHf1QIDC9lFRY/aMqUytKBZApVu/Y+LcFycYto/mfOc/4CPDmqjGBB11FMcXkNPotHeOieX/QsBskMwRUxLxDMNAfb2FutZRkzzApcF+gUGpCFvAF6QKhNsx8puaLnzR0dCZIxkM3+5W3wqog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538500; 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=RXjSaEHMpAyVR1pzAaZhvgLIrPoXk6JJNXLfAy1cs3I=; b=ZOq9Do+LqgzKMDhGExUNMqHiOOfQFgbi6pKwuLCvwQdCKAVRvdz4eBbeoxFRqf+2PvBolmnejipV1Ag5Z5pkVaS8rYckZmFpDm1WlPbNvq0le60i19ETFq7csR7sfCE3eas+ey+pNNtYhdxYE0k+/8+X12aqyRR5ZyoWE5QfK4w= 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 1616538500160376.8345694497897; Tue, 23 Mar 2021 15:28:20 -0700 (PDT) Received: from localhost ([::1]:58560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpVb-0000jM-0f for importer@patchew.org; Tue, 23 Mar 2021 18:28:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJr-000782-FZ for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJi-0002rb-Dt for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:11 -0400 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-306-ifzhDsiVNYmtgJuo7YjEzg-1; Tue, 23 Mar 2021 18:15:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80DF588EF00; Tue, 23 Mar 2021 22:15:56 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA56A60877; Tue, 23 Mar 2021 22:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537761; 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=RXjSaEHMpAyVR1pzAaZhvgLIrPoXk6JJNXLfAy1cs3I=; b=Qg2IC7l4EzT4fhwjyAm77VVWvl8xknbEIbiJgvmscWGP+1BDqr0bUlFxvbIHGsBt5sVXdz BpMCy2B1mgrl326yFgNjaEviOL+FbimXNbDnXMWPLEzEOR+P3K/YnTHSJKIKUA8js3QvnG 3foBNg2hub7bKJjihs1sZJm3bYM2ytg= X-MC-Unique: ifzhDsiVNYmtgJuo7YjEzg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 03/10] Python: add utility function for retrieving port redirection Date: Tue, 23 Mar 2021 18:15:32 -0400 Message-Id: <20210323221539.3532660-4-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal 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.utils" module to host the utility function and a test. Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Eric Auger Reviewed-by: Willian Rampazzo --- python/qemu/utils.py | 35 ++++++++++++++++++++++++ tests/acceptance/info_usernet.py | 29 ++++++++++++++++++++ tests/acceptance/linux_ssh_mips_malta.py | 16 +++++------ tests/acceptance/virtiofs_submounts.py | 21 ++++---------- tests/vm/basevm.py | 7 ++--- 5 files changed, 78 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 6dbd02d49d..052008f02d 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 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 @@ def get_kernel_info(self, endianess, wordsize): 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 ca64b76301..57a7047342 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -9,6 +9,8 @@ from avocado_qemu import wait_for_console_pattern from avocado.utils import ssh =20 +from qemu.utils import get_info_usernet_hostfwd_port + =20 def run_cmd(args): subp =3D subprocess.Popen(args, @@ -73,27 +75,14 @@ class VirtiofsSubmountsTest(LinuxTest): :avocado: tags=3Daccel:kvm """ =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 @@ 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 @@ def boot(self, img, extra_args=3D[]): 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 Sun Apr 28 03:09:15 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=1616538656; cv=none; d=zohomail.com; s=zohoarc; b=nD/HXfHC4rM62pkvOqOyr/lKGfp/9x1ec0w1JRyCxZEIZEGTf9TNsm66aQW98jX7xdsPg+xnb27kd8MC0WwdK8SDgOfUXwmzbiYGUJJ45Zv5bxhkEMFgEWvYxgvZhcO8Mt56QDTKQICO+JHKUJSeYo7Mdzw6xy1bNoiHDqodebs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538656; 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=lULuSr6pc7nl0O74e33zp2cJROUTZXU8HvwdAX1dEFE=; b=UA87QATX1NsMh5bbz3pkdO7Y65c8rq6qCoLJlPmqvTl0NaYjkat5faBK/VZbidcfBTN6mgl9sL3ttHpl9TxgMWv1c2M2apy2DW0vz1sKI3s2Ss2S6J2/ifd9hUXdcBdSoVrM2R6447WOQBTVVlOl/29BVy2eqgsm5Hk2vqZL1IE= 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 1616538656801184.82400591841588; Tue, 23 Mar 2021 15:30:56 -0700 (PDT) Received: from localhost ([::1]:36564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpY7-0004lh-MQ for importer@patchew.org; Tue, 23 Mar 2021 18:30:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJw-0007Am-TI for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lOpJj-0002rl-M1 for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:15 -0400 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-511-81_xsqJ8MiG6g4d8Qokbqw-1; Tue, 23 Mar 2021 18:15:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 644B21853021; Tue, 23 Mar 2021 22:15:58 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A14DE60877; Tue, 23 Mar 2021 22:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537762; 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=lULuSr6pc7nl0O74e33zp2cJROUTZXU8HvwdAX1dEFE=; b=PrMyadzsx7SVhuLCTJj0KaGuiajw0XSW+9P1lrIdRES9Diw3ZwiqoL7SjkZY/cZ1HlFBhj lvY2HkmzJxBwtcnMXjgrAJazPaBMhez04fUYEMb7kvKRmyOJ3eyJkh1o6PE5co9MMptRdU y0WhgonoAcXnSJ4Q/c0WnbNStE1qTH0= X-MC-Unique: 81_xsqJ8MiG6g4d8Qokbqw-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 04/10] Acceptance Tests: move useful ssh methods to base class Date: Tue, 23 Mar 2021 18:15:33 -0400 Message-Id: <20210323221539.3532660-5-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal 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 Reviewed-by: Eric Auger --- tests/acceptance/avocado_qemu/__init__.py | 48 ++++++++++++++++++++++- tests/acceptance/linux_ssh_mips_malta.py | 38 ++---------------- tests/acceptance/virtiofs_submounts.py | 37 ----------------- 3 files changed, 50 insertions(+), 73 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 83b1741ec8..67f75f66e5 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -20,6 +20,7 @@ from avocado.utils import cloudinit from avocado.utils import datadrainer from avocado.utils import network +from avocado.utils import ssh from avocado.utils import vmimage from avocado.utils.path import find_command =20 @@ -43,6 +44,8 @@ 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 def is_readable_executable_file(path): return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK) @@ -253,7 +256,50 @@ def fetch_asset(self, name, 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 052008f02d..3f590a081f 100644 --- a/tests/acceptance/linux_ssh_mips_malta.py +++ b/tests/acceptance/linux_ssh_mips_malta.py @@ -12,7 +12,7 @@ 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 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 @@ def get_kernel_info(self, endianess, wordsize): 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:" + port) - self.ssh_session =3D ssh.Session(self.VM_IP, port=3Dint(port), - 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 @@ def boot_debian_wheezy_image_and_ssh_login(self, endiane= ss, kernel_path): 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 57a7047342..bed8ce44df 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -9,8 +9,6 @@ from avocado_qemu import wait_for_console_pattern from avocado.utils import ssh =20 -from qemu.utils import get_info_usernet_hostfwd_port - =20 def run_cmd(args): subp =3D subprocess.Popen(args, @@ -75,41 +73,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 Sun Apr 28 03:09:15 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=1616538270; cv=none; d=zohomail.com; s=zohoarc; b=RVJDE3bEtoC/MIRL4BGSwr90Cip0826s0yvgaRcMej1Lh1544RYRqE+P1be3O4GAni3iR7yWKZWU9sAiQQpNCQ5NmzBH2uy6rI5ZkiXMS2wMha5ZmMZW2ohxq3ozy34Yl8Qj2Z9u5dZGNQMPMkS9Sfci7dtnJw1CVW3w3h235T0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538270; 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=pUF/d8A/xCBHEdfSYYeyhvTL8lcPePbg+yFc9KYn3oQ=; b=V39wvNWwtcsh+bOp1OrPtnb8/vgXYFIUqYkotTRJ6OYf4zhohlM9QC8D2SBSV+/7t9otvAuMprP9V1MED85x41pvTUS7stsVs0s9qFT8X2LVrLZIfk2nrignLN9Zogk20F3QrOJhBqo/62UIWHpoOrpG8euoTyLJgpX3gk2mOwY= 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 1616538270552648.1389491378958; Tue, 23 Mar 2021 15:24:30 -0700 (PDT) Received: from localhost ([::1]:45524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpRt-0001lK-D8 for importer@patchew.org; Tue, 23 Mar 2021 18:24:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpK1-0007FG-Ma for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJq-0002tL-EO for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:19 -0400 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-403-Jb8N1j3TNfyrGmlGTStREA-1; Tue, 23 Mar 2021 18:16:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D8F3100746C; Tue, 23 Mar 2021 22:16:00 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 843AC6087C; Tue, 23 Mar 2021 22:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537764; 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=pUF/d8A/xCBHEdfSYYeyhvTL8lcPePbg+yFc9KYn3oQ=; b=UXBK8AN+gi8EUq4+FSAkquT/c/MkoLWRBdY2yNv0slM6L0+uSZ+nTLp0ODVZhe8gXM2Yfw duszzUQmYao/CjAng2b/6BHJwxAZ7JWFZS1+jc3bhzxpoZsxUPnEeCTi4DzJNSDuw2S9t6 +PbMcyI8gQ7iiYph8IkRP7Ap4zSi688= X-MC-Unique: Jb8N1j3TNfyrGmlGTStREA-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 05/10] Acceptance Tests: add port redirection for ssh by default Date: Tue, 23 Mar 2021 18:15:34 -0400 Message-Id: <20210323221539.3532660-6-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Aleksandar Rikalo , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal 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 Reviewed-by: Eric Auger Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 4 +++- tests/acceptance/virtiofs_submounts.py | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 67f75f66e5..e75b002c70 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -309,10 +309,12 @@ class LinuxTest(Test, LinuxSSHMixIn): timeout =3D 900 chksum =3D None =20 - def setUp(self, ssh_pubkey=3DNone): + def setUp(self, ssh_pubkey=3DNone, network_device_type=3D'virtio-net'): 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', '%s,netdev=3Dvnet' % network_device_ty= pe) 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 bed8ce44df..e10a935ac4 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -207,10 +207,6 @@ def setUp(self): 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 Sun Apr 28 03:09:15 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=1616538119; cv=none; d=zohomail.com; s=zohoarc; b=O7L/x5vismSpLm3jKoDLhxg7Kv4Kg2s6aojuOA/R+Ay/83+XzLgTBU/8GBKvasv+s6pizA3pijoZUOWe1vWrFUeIWpC3btPQaZ2TqMeDm2AIF0km6LAwf/EmVqaLVFjBJ4j56KxpOcwf6n08FI8XpCmjw0Q5ayilH0Hhz2FFTdo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538119; 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=lCMCJ9YBsuX6UDILY+qEiNarHjJkquTp8drAoNMdiPM=; b=HTLp3HY+ek/6VFLEJoVBz/n89gVJck18fPqfEDbEnkSyY0UZziZ2ACsIlZUmrUP5UmvESyE4a9vNLT4PZ6DjIj4Eo/iaTMeT9VQUa93LIpbSUVTju3A+dH+khP9l04b/vVhRadOhFsa1jYBmDKUUlCMYML/aPCCvTvJuAMWn1sY= 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 1616538119217204.75421387744757; Tue, 23 Mar 2021 15:21:59 -0700 (PDT) Received: from localhost ([::1]:37494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpPS-000690-0f for importer@patchew.org; Tue, 23 Mar 2021 18:21:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJz-0007E5-RL for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJt-0002tr-SF for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:19 -0400 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-186-sqLszR-KPd2MojJBbiir4g-1; Tue, 23 Mar 2021 18:16:10 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACFFB5200; Tue, 23 Mar 2021 22:16:09 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6BF1F60877; Tue, 23 Mar 2021 22:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537772; 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=lCMCJ9YBsuX6UDILY+qEiNarHjJkquTp8drAoNMdiPM=; b=Q7bYsqtxqCSWa9WSTFIg1Zr9fr3/RUKEI3AosIqrcmYW8tMebpQmOkFcd3JZ8M818x3XxD ++Q//tVyfpYhCNPshZYzx11kK4c+gXRbVGUIwpsIEuVJF7H0iyPiadTESpCt9gMtlRUrSH mIlhPreRK2cjV77lAYdwv8Cq5N7lnpA= X-MC-Unique: sqLszR-KPd2MojJBbiir4g-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 06/10] Acceptance Tests: make username/password configurable Date: Tue, 23 Mar 2021 18:15:35 -0400 Message-Id: <20210323221539.3532660-7-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal 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 makes the username/password used for authentication configurable, because some guest operating systems may have restrictions on accounts to be used for logins, and it just makes it better documented. Signed-off-by: Cleber Rosa Reviewed-by: Eric Auger Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index e75b002c70..535f63a48d 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -308,6 +308,8 @@ class LinuxTest(Test, LinuxSSHMixIn): =20 timeout =3D 900 chksum =3D None + username =3D 'root' + password =3D 'password' =20 def setUp(self, ssh_pubkey=3DNone, network_device_type=3D'virtio-net'): super(LinuxTest, self).setUp() @@ -370,8 +372,8 @@ def prepare_cloudinit(self, ssh_pubkey=3DNone): with open(ssh_pubkey) as pubkey: pubkey_content =3D pubkey.read() cloudinit.iso(cloudinit_iso, self.name, - username=3D'root', - password=3D'password', + username=3Dself.username, + password=3Dself.password, # QEMU's hard coded usermode router address phone_home_host=3D'10.0.2.2', phone_home_port=3Dself.phone_home_port, --=20 2.25.4 From nobody Sun Apr 28 03:09:15 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=1616538905; cv=none; d=zohomail.com; s=zohoarc; b=j9bmvZIojuBL+o95eg7b9VBcrpHk0qkqmBYtwR25Efp32a+yUMrbMDNyffuAiGA3Z5YtE+zWq5zg5TMJbCBzWmVlkFEnivioBNb2/N6t3KM/G5uTMoH9+Ro/CGdegGR1NB1i6eNO026qF+3+sePFOlMtGOk8u1T322PJd41SMik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538905; 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=rN2Ca2cfr8rsESK/gKojXf/O2EltzAXcDdJYKp5zdDg=; b=NyXOwkNHadC/jYD+A1jUlKpgJI7d3fHg8ALfxKRMcxoEZvHBUkPGe+ETjUBailLU94iu2zelgAEmeplNCGMjH6KeKJPCSaVwgNN9Ow0Xs7vMJ1/PQCLw0jhcW6SJ79ZSPmgT8oJtxzStAW2yXdaAAxajtj1W2Wn8inaBoSFr3NA= 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 1616538905622284.1291624655904; Tue, 23 Mar 2021 15:35:05 -0700 (PDT) Received: from localhost ([::1]:46682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpc6-0002ml-LR for importer@patchew.org; Tue, 23 Mar 2021 18:35:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpK4-0007Gy-0B for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lOpJw-0002ue-NJ for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:23 -0400 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-_fbFx1-GMNeqd840eLCJSg-1; Tue, 23 Mar 2021 18:16:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FD4988EF02; Tue, 23 Mar 2021 22:16:11 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD75D60877; Tue, 23 Mar 2021 22:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537774; 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=rN2Ca2cfr8rsESK/gKojXf/O2EltzAXcDdJYKp5zdDg=; b=YUMOBWkFxy6gfDLBOka/a04RF+KxlmXulhkGpg/bweDfL4ujaG8oxpT6NZ4vvkSwsrfP41 Jjb/eI1DkzXaSS9Zpv3c7kMfc6tAZZX65rQ9kqisBRSPVO2CuIpiEuUV5ZXSS+dJgBJL2R jUx59N8+l4ELGnANuyFvmGOaQLdNY4Y= X-MC-Unique: _fbFx1-GMNeqd840eLCJSg-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 07/10] Acceptance Tests: set up SSH connection by default after boot for LinuxTest Date: Tue, 23 Mar 2021 18:15:36 -0400 Message-Id: <20210323221539.3532660-8-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal 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 LinuxTest specifically targets users that need to interact with Linux guests. So, it makes sense to give a connection by default, and avoid requiring it as boiler-plate code. Signed-off-by: Cleber Rosa Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Willian Rampazzo --- tests/acceptance/avocado_qemu/__init__.py | 5 ++++- tests/acceptance/virtiofs_submounts.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 535f63a48d..4960142bcc 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -390,7 +390,7 @@ 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): + def launch_and_wait(self, set_up_ssh_connection=3DTrue): self.vm.set_console() self.vm.launch() console_drainer =3D datadrainer.LineLogger(self.vm.console_socket.= fileno(), @@ -398,3 +398,6 @@ def launch_and_wait(self): 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) + if set_up_ssh_connection: + self.log.info('Setting up the SSH connection') + self.ssh_connect(self.username, self.ssh_key) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index e10a935ac4..e019d3b896 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -136,7 +136,6 @@ def set_up_virtiofs(self): =20 def launch_vm(self): self.launch_and_wait() - self.ssh_connect('root', self.ssh_key) =20 def set_up_nested_mounts(self): scratch_dir =3D os.path.join(self.shared_dir, 'scratch') --=20 2.25.4 From nobody Sun Apr 28 03:09:15 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=1616538781; cv=none; d=zohomail.com; s=zohoarc; b=BOoeH2lbfA2jbIYIrKLjdRCssL8Jd+Encz4CEiLuJVWOeiTywbOwP85zn0O0W0RaMfO7t2GxKwtmcSDp7Gk+FpaRwGCzAOm1N083e5OmdnmxvcA+EVVdN3BbOD3mH7jBS1vCvglCnh4EAmYHE4Ii5q3maf8XPSQhfgc/ZbVVUr8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538781; 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=XVajM2muatNuYxwQApJ+cMuC2tYvS+qML4X+hN2+rlo=; b=N8o8qQli9rE6RJxHZm1IzVltrPxXmkYpPA5x+YqxVSb5KfTf38G6ucLBSXio3Q9gmLzqz4ezF7wjlHJHcZo+oZEUeDKeAhubvulx/p8dh0+F1X7HwbZaL9Q60Eq7W1/pikBaIOeT3WnY8+R7D6sE85FG5Bv4wycM3PzDpLkBLmI= 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 1616538781835608.9458248988109; Tue, 23 Mar 2021 15:33:01 -0700 (PDT) Received: from localhost ([::1]:41286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpa8-0007rn-JO for importer@patchew.org; Tue, 23 Mar 2021 18:33:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpK1-0007FQ-RQ for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29605) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpJx-0002uk-3v for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:21 -0400 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-111-SoB-ic90Pr6Y1JoOniMJrA-1; Tue, 23 Mar 2021 18:16:14 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31CB4800D53; Tue, 23 Mar 2021 22:16:13 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F9236087C; Tue, 23 Mar 2021 22:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537776; 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=XVajM2muatNuYxwQApJ+cMuC2tYvS+qML4X+hN2+rlo=; b=IWsPkOYG/qBHGtHfcXa4FbMEv7AEWCnRLJ42EkOzEQdPgAhxJeP1DxS/6Hh9lLEQyIIIGP vWPC3hITdxAD9OGEE/w0FUvDhTMz5kkVfeYidFwZNPq51TrWB5ffhK1AqGLfJukp0j0IDP 7wVz0+RfzyV7c1zceFnhtjd1pt1+/7I= X-MC-Unique: SoB-ic90Pr6Y1JoOniMJrA-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 08/10] tests/acceptance/virtiofs_submounts.py: remove launch_vm() Date: Tue, 23 Mar 2021 18:15:37 -0400 Message-Id: <20210323221539.3532660-9-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal 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 LinuxTest class' launch_and_wait() method now behaves the same way as this test's custom launch_vm(), so let's just use the upper layer (common) method. Signed-off-by: Cleber Rosa Reviewed-by: Eric Auger Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Willian Rampazzo --- tests/acceptance/virtiofs_submounts.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/acceptance/virtiofs_submounts.py b/tests/acceptance/virt= iofs_submounts.py index e019d3b896..d77ee35674 100644 --- a/tests/acceptance/virtiofs_submounts.py +++ b/tests/acceptance/virtiofs_submounts.py @@ -134,9 +134,6 @@ def set_up_virtiofs(self): '-numa', 'node,memdev=3Dmem') =20 - def launch_vm(self): - self.launch_and_wait() - def set_up_nested_mounts(self): scratch_dir =3D os.path.join(self.shared_dir, 'scratch') try: @@ -225,7 +222,7 @@ def test_pre_virtiofsd_set_up(self): self.set_up_nested_mounts() =20 self.set_up_virtiofs() - self.launch_vm() + self.launch_and_wait() self.mount_in_guest() self.check_in_guest() =20 @@ -235,14 +232,14 @@ def test_pre_launch_set_up(self): =20 self.set_up_nested_mounts() =20 - self.launch_vm() + self.launch_and_wait() self.mount_in_guest() self.check_in_guest() =20 def test_post_launch_set_up(self): self.set_up_shared_dir() self.set_up_virtiofs() - self.launch_vm() + self.launch_and_wait() =20 self.set_up_nested_mounts() =20 @@ -252,7 +249,7 @@ def test_post_launch_set_up(self): def test_post_mount_set_up(self): self.set_up_shared_dir() self.set_up_virtiofs() - self.launch_vm() + self.launch_and_wait() self.mount_in_guest() =20 self.set_up_nested_mounts() @@ -265,7 +262,7 @@ def test_two_runs(self): self.set_up_nested_mounts() =20 self.set_up_virtiofs() - self.launch_vm() + self.launch_and_wait() self.mount_in_guest() self.check_in_guest() =20 --=20 2.25.4 From nobody Sun Apr 28 03:09:15 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=1616538202; cv=none; d=zohomail.com; s=zohoarc; b=CN616C2qUwpl/6/7X0Z4I0r2jikh7PsB3duvsoXK5xC98uHdM+CQtl7ITJhWfTSay5q//eBjztn6u6mCqT8iw/FdsfFgwUvjCkrAmUfCKJvgVuOglkvhEU9ZuRNOJSkT+GQjWq/SubjHFhbsQAiAgnoOX7jbn6EGrT5aHcM9alM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538202; 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=szWjbKFM1QoVsZlF7m3k24d/7L+hdazgGp7d2CQTCu8=; b=kbhVPPzQ37z6H/EeM1VzXsf4dpRZxfht/nQ5RwGAgT5IfXIcGQC/emR8hAJzKSuAK412SYIpTypSA0IVZj/eAg6ftsvopF3jFC5QZt8NUmxIu1KTPs6d/x7KKK5H+3W5uBVHycfgX23M1iiTmj93PC+Q/WoBeOO27iO3g0RUZ9w= 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 1616538202019438.8277029192973; Tue, 23 Mar 2021 15:23:22 -0700 (PDT) Received: from localhost ([::1]:42288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpQm-0008R2-Qz for importer@patchew.org; Tue, 23 Mar 2021 18:23:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpK3-0007G9-Oo for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lOpJz-0002ut-7J for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:23 -0400 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-523-rOP-Rw84Ooy5U9dvP_Pwdw-1; Tue, 23 Mar 2021 18:16:16 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 021DA88EF02; Tue, 23 Mar 2021 22:16:15 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5226760877; Tue, 23 Mar 2021 22:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537778; 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=szWjbKFM1QoVsZlF7m3k24d/7L+hdazgGp7d2CQTCu8=; b=X7ksoFp9wveMZWUMTtmdyQmLtDwn05jAsrEJPzYW1BOJnHNIxH4D78jO5f2TxTF36owMQ3 v58JrmJsb2IU+7G5J9cmZ+oKbe8WaE+cKhVrsd4AEsRl/081THZ21dwnX6RQDYJBqcFXfP 5PHEQzGmPlycwVBw59ch83K2IROn8Fs= X-MC-Unique: rOP-Rw84Ooy5U9dvP_Pwdw-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 09/10] Acceptance Tests: add basic documentation on LinuxTest base class Date: Tue, 23 Mar 2021 18:15:38 -0400 Message-Id: <20210323221539.3532660-10-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-Type: text/plain; charset="utf-8" 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Cleber Rosa Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Willian Rampazzo Reviewed-by: Eric Auger Reviewed-by: Wainer dos Santos Moschetta --- docs/devel/testing.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 1da4c4e4c4..ed2a06db28 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -810,6 +810,31 @@ 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_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 Sun Apr 28 03:09:15 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=1616538394; cv=none; d=zohomail.com; s=zohoarc; b=JL19oJngV+4RF43EuVO8DQcG0KokFl1+o4CAPgK2+0Msv2OeR9HasGzEND+EixanLCSePgWL5ne0JjUZE8WyYcIGYAoOBo3HOUi29ZCh1ogVwbvMQUscXq0FeLbB0el8RO6D4V50XdBbOt5zHsvPLn11Q6+d40G+sEtOELjfrL8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616538394; 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=lxyMINRc2kCT3U1iHvR5qE4P+n3VGqCOIDNeRgap+f4=; b=cMlhtnV5K/T7lx3V3B6HGMfFGFvc6g2g4bzdEFovcZbx4U0GZI1sNSZqor9wa+vr3B1KIljJG0rt8+wzsxWdm6coxcIc+ghPVf80Ns96jsI2nVq1541UWD7L9oo4z4fIh+UF7VAnS7kI6zc2nAZ3lAM64CFu91AckS7lcLty1CI= 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 1616538394925407.70275038453485; Tue, 23 Mar 2021 15:26:34 -0700 (PDT) Received: from localhost ([::1]:50566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOpTt-0004Ij-9T for importer@patchew.org; Tue, 23 Mar 2021 18:26:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpK5-0007Kt-Fr for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOpK1-0002vx-G9 for qemu-devel@nongnu.org; Tue, 23 Mar 2021 18:16:25 -0400 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-345--6mH9M8pPGWMeBqWFRqw4A-1; Tue, 23 Mar 2021 18:16:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7E5E185302C; Tue, 23 Mar 2021 22:16:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-119-39.rdu2.redhat.com [10.10.119.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 211AE60877; Tue, 23 Mar 2021 22:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616537779; 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=lxyMINRc2kCT3U1iHvR5qE4P+n3VGqCOIDNeRgap+f4=; b=eXyGZ7WHJtGTLpaVHkbHiifiJltqCQboLvqWKsX/O+ItO3GfS2MgRQ/K8Vc80vLoXWizLO Q4EplwQqYbYwgMFkVFOToiec9zfIcnma6xkn/ZQ6f7q8qdJjY431ubC4/cwI9xky9P6bmO I2JP2viRTqWZECj6k1R9uoSWTVMsZMU= X-MC-Unique: -6mH9M8pPGWMeBqWFRqw4A-1 From: Cleber Rosa To: qemu-devel@nongnu.org Subject: [PATCH v2 10/10] Acceptance Tests: introduce CPU hotplug test Date: Tue, 23 Mar 2021 18:15:39 -0400 Message-Id: <20210323221539.3532660-11-crosa@redhat.com> In-Reply-To: <20210323221539.3532660-1-crosa@redhat.com> References: <20210323221539.3532660-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-Type: text/plain; charset="utf-8" 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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 , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Eric Auger , John Snow , Willian Rampazzo , Cleber Rosa , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Beraldo Leal Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 Reviewed-by: Eric Auger --- tests/acceptance/hotplug_cpu.py | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 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..6374bf1b54 --- /dev/null +++ b/tests/acceptance/hotplug_cpu.py @@ -0,0 +1,37 @@ +# 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_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