From patchwork Tue May 3 14:16:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jag Raman X-Patchwork-Id: 12835838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 321FBC433EF for ; Tue, 3 May 2022 14:18:29 +0000 (UTC) Received: from localhost ([::1]:45734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nltMC-0001cE-Aj for qemu-devel@archiver.kernel.org; Tue, 03 May 2022 10:18:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nltL7-0007gI-3o for qemu-devel@nongnu.org; Tue, 03 May 2022 10:17:21 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:53096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nltL3-0001LF-Vm for qemu-devel@nongnu.org; Tue, 03 May 2022 10:17:19 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 243BpJOG013484; Tue, 3 May 2022 14:17:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=JpBsjHAvZ1qab1yYy12cHgZOwT/JgUZDs8vVbtCv7Mk=; b=Be0X4G93V/4N5EnuW1+UJjoE88UDr2QyddhHdLDf7AEhWDDLLXUiWOjCvMDY0G7571+B dPOQYCwvG9ewduffu7dvoBK6zfgmHxoUe1MwzkidDhVPyl/TdA1wLCq9saRECFS+KB74 I86Itse8GKdKinaB5yYE5Cendna9Nr7Hk6YSGb6gr7TB9k31sSTCsqmIiqZtQ7D9MGwi pk66wwF9AeQJCGV/8zGd9IZXaL/kC/Js5YrXCO6HO/ofsf7ryXx68dqCpg3c6FXAuHA3 9ju+Qbppi6EGslE0yO6WMFjtyNZ6lqm928gD9ixRppzuGX8Jbd7i9P0KSuHXDDpZeo3T 3g== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3frvqsdtg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 May 2022 14:17:09 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 243EGR29001721; Tue, 3 May 2022 14:17:09 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3fruj91jt7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 May 2022 14:17:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T9GAH6cGU+vncknotDptoanposlCDrV4xA1qV5OFSXrXzrUGeLtJ3kEE/xmiTtAHkT6qmTyXmtwGtK1ABcBPDza86yFXYU0lqfRiQVWWJbdSna7ZJnYc01vu6ijBp2kSFeHN5EwPg9s7xMioJsnOcOVZ182hXPddHIU0q8XU8qaPS+gcRBmu2EoO9pQcKuhDlgEY+neqqHfanuXBUVdi7zAN1kW4l+caJcziGkGcKNFqE9ZlxJ+nByHZISniXFt7dWDTvCA5Y2WOi3Wgi49WRxCJjh30mmySBfsAa1HHG3F+B4VnE7N7EzlJr1V52bvDrjupeWaNvUssBJDNt8CeEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JpBsjHAvZ1qab1yYy12cHgZOwT/JgUZDs8vVbtCv7Mk=; b=RMYHj4yo4/YwM9zW6IKzgkiSA00zQ6ZvftdPlBVOUWBwzwOks1tww7UGpM2ONaRmtR29cMOb3iavR3Lmps6JcvMES9aex0UZgn0d8JBQ5tzlgxoFW8Q0zqXiMg7njZl9C7Qmp4qR6YXQgXl08shfRfbRHs1/7aNCiAJzpdJo/kSWBsHM3QNEYia//Y0++eC46qMk8ScWpvE9HMHKPvD+aUfDUm4YmTsuXkbrZrtafiV4ivS39ASy1l7o78RIAjigK4ZI1GMZ+3elBviP5RnswY12rCmOYh/hLkOaGho+SGc6R64k3OlZUPJvcvS/XeRTbPzPiGf5AKfT7FEe2BKMvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JpBsjHAvZ1qab1yYy12cHgZOwT/JgUZDs8vVbtCv7Mk=; b=BvjSBoLU6TFwXcGAqwDpEjEDbcTYvV5AgkF9csyKRvDU736azaEsVqjxaX3RQjGj6BbLk4mYwCDNBzTWZTMfPUaj1HF58bylTajXcoi+9VFZvDhM/Ma3ogq/6Q0xNx9UT2kkCKvgA5AmIeNzICLDoGHjU9YKbK97zjw/WwbOGn0= Received: from MN2PR10MB4013.namprd10.prod.outlook.com (2603:10b6:208:185::25) by MN2PR10MB3358.namprd10.prod.outlook.com (2603:10b6:208:12f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Tue, 3 May 2022 14:17:06 +0000 Received: from MN2PR10MB4013.namprd10.prod.outlook.com ([fe80::e9cb:e1ca:8189:f191]) by MN2PR10MB4013.namprd10.prod.outlook.com ([fe80::e9cb:e1ca:8189:f191%7]) with mapi id 15.20.5206.013; Tue, 3 May 2022 14:17:06 +0000 From: Jagannathan Raman To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, mst@redhat.com, f4bug@amsat.org, pbonzini@redhat.com, marcandre.lureau@redhat.com, thuth@redhat.com, bleal@redhat.com, berrange@redhat.com, eduardo@habkost.net, marcel.apfelbaum@gmail.com, eblake@redhat.com, armbru@redhat.com, quintela@redhat.com, dgilbert@redhat.com, imammedo@redhat.com, peterx@redhat.com, john.levon@nutanix.com, thanos.makatos@nutanix.com, elena.ufimtseva@oracle.com, john.g.johnson@oracle.com, kanth.ghatraju@oracle.com, jag.raman@oracle.com Subject: [PATCH v9 01/17] tests/avocado: Specify target VM argument to helper routines Date: Tue, 3 May 2022 10:16:42 -0400 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: X-ClientProxiedBy: SA9PR11CA0005.namprd11.prod.outlook.com (2603:10b6:806:6e::10) To MN2PR10MB4013.namprd10.prod.outlook.com (2603:10b6:208:185::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84db46a5-7766-4809-7a2f-08da2d0f9a40 X-MS-TrafficTypeDiagnostic: MN2PR10MB3358:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3XaSm9P+j/NJQFUu1HEjxrpmtverWG2ZW65ZJgHEbk1BdcS8nINAy0fZuF6V+bLmlmw4uQvsVq8+Qa/QzvNyTz4pH/jBjx1GHI6pnYWfQZ/KJiaqkuCShWCCBfu191rDZ146k3f7ute2EAfLgkmpEermtOs7HXBSSMNpw8/CZS8w06atWx37oReSLf09SvvBjsQ0rZFIFCy8kXppPvlvaxr9+R+zHmTXjEqlJKvNJ9Ixfm4fZ+w4MdwcAihGW0fbZuXuZAl+sgYeiPerA6GtZp3C70U46bpOLPCwuAmVZ9CyNIhvggO9pUZ/wsdUb7dIComrEQ5vFg1+yoENTMyKotFGvKmhkJpfqQmhhOlpFazhFuEU5ePJU2Y/litID9DkDY1yBVkfyf9akntk2FH7ZZJSiMeFsgtVOggIt32Hz5BTPUs9ltSO3tWOdxQKBcy4c45ajlpsWPrFMlM3NRd8kUp7D9sdL87H8Z+H+PprXY3+WR+J6elZ2WP0WnQyh3VhBzKifp/aEyI/JsBWLz1e/3frji0YBpTyuxxA9+xx/R0pTNMynweKRUKqtDf5SuisPHxryyecE2lKmX9NYUfwdF4AiO7y+9xXbGL7T61cfXQkUWe6WV3bX1Do4xI4901bqINFMZY3h7s8ZTtcicPhWI6+5oQEHNeA1FKCf0qAq09WnuJVLHVRdr9trRuATwpHKuNVuMi0FaQp7tM4/cqDUQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR10MB4013.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(36756003)(83380400001)(66946007)(2616005)(6506007)(186003)(107886003)(2906002)(6486002)(6916009)(316002)(38350700002)(38100700002)(7416002)(5660300002)(8936002)(6512007)(86362001)(4326008)(6666004)(52116002)(66476007)(508600001)(8676002)(26005)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?rvIi0v7gMJ09zWxTrIzJuU1l/kP9?= =?utf-8?q?7kbmJQ0MgEnaK3fkUTELPydiaEm5h919czbgzxVFhzzgwJajqdetmtPG8k7km9Rav?= =?utf-8?q?7/aP6Fi+U3NYbwzhJmNhfjBr2xVeNuaNfsTmVDLB+Sshtl9MAAb3y1bLA2xdevAT+?= =?utf-8?q?72dkerUDre9xjgPxVDSZdn4S7x80bdnvmZYLwWG0xxemsnpXtkNZoBurh3mKCccBV?= =?utf-8?q?lrVk8zubX3U99oiiYvQdqagFoE0/g4UzzsXfgZpjgLOlga2V35PPiUFWp40MJ8ovk?= =?utf-8?q?C0Y+27YFpIjobqMg08DHmUHji2hpQgIqPq23+tbGL3nnZmK9QTAszzyqIzXqi6spC?= =?utf-8?q?w5+VVdLUkFsDuzMiDlq66R5CQOVkIsuekNG/tnctXs5IlAJtmz6JyA69/SK4PG0z7?= =?utf-8?q?mQaPhrvZuWnDCukhBEjauzLHVKj1z/Be9Z+6KHpZgrKSBnPV0D9AwVoK6t7JU0+Ai?= =?utf-8?q?rG4Dxls+P+78Hq+rpcHCvG5szW8hprmI0cnq77kh67KLyRq5QYmEyAHiFZwbGKOFq?= =?utf-8?q?E/DPxXQezcm1f/JED7M/zvfkO5RdfzKk0Wo551HjnnYQ+votBirmx3NPGYd1447O2?= =?utf-8?q?UMbH+hOg2wXer8eW9wMjamwhNA+IsZcW1Y7fSZNtrdbcXiez1zZ9T0KqzXBajHPTT?= =?utf-8?q?JF6qp/Qe6acl4GIvqK+T618gAF9bb96HrRVqCSD9/V5OYnAI1xhMKVgYJYhGVCbi3?= =?utf-8?q?Ywp47IM/CBvLava2UR+3ffk2wi8dYT85qGtqX58RHrG0uHHMCysNti0Qcxbsn810o?= =?utf-8?q?iItDu0jwHvRueKvmftxBJi9New0v428Zc3BEJIt/u+wTEJmG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g: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84db46a5-7766-4809-7a2f-08da2d0f9a40 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4013.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2022 14:17:06.3741 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XmolGDuMm1NG/DkOBJ3vdzV7yQ1Y8nwQ2oSVu+W0oItQLZFiu5aRhEHo2VACCn14Wj8Lmcb0K2au0ZfNX5/bEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB3358 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486, 18.0.858 definitions=2022-05-03_05:2022-05-02, 2022-05-03 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 suspectscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205030103 X-Proofpoint-GUID: UdFFEEFJa8Sy1eGEkCSCnO47gw1AH0tQ X-Proofpoint-ORIG-GUID: UdFFEEFJa8Sy1eGEkCSCnO47gw1AH0tQ Received-SPF: pass client-ip=205.220.177.32; envelope-from=jag.raman@oracle.com; helo=mx0b-00069f02.pphosted.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, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Specify target VM for exec_command and exec_command_and_wait_for_pattern routines Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Beraldo Leal Reviewed-by: Stefan Hajnoczi --- tests/avocado/avocado_qemu/__init__.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py index 39f15c1d51..340a345799 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -198,7 +198,7 @@ def wait_for_console_pattern(test, success_message, failure_message=None, """ _console_interaction(test, success_message, failure_message, None, vm=vm) -def exec_command(test, command): +def exec_command(test, command, vm=None): """ Send a command to a console (appending CRLF characters), while logging the content. @@ -207,11 +207,14 @@ def exec_command(test, command): :type test: :class:`avocado_qemu.QemuSystemTest` :param command: the command to send :type command: str + :param vm: target vm + :type vm: :class:`qemu.machine.QEMUMachine` """ - _console_interaction(test, None, None, command + '\r') + _console_interaction(test, None, None, command + '\r', vm=vm) def exec_command_and_wait_for_pattern(test, command, - success_message, failure_message=None): + success_message, failure_message=None, + vm=None): """ Send a command to a console (appending CRLF characters), then wait for success_message to appear on the console, while logging the. @@ -223,8 +226,11 @@ def exec_command_and_wait_for_pattern(test, command, :param command: the command to send :param success_message: if this message appears, test succeeds :param failure_message: if this message appears, test fails + :param vm: target vm + :type vm: :class:`qemu.machine.QEMUMachine` """ - _console_interaction(test, success_message, failure_message, command + '\r') + _console_interaction(test, success_message, failure_message, command + '\r', + vm=vm) class QemuBaseTest(avocado.Test): def _get_unique_tag_val(self, tag_name):