From patchwork Tue Apr 19 20:44:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jag Raman X-Patchwork-Id: 12819469 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 BF833C433F5 for ; Tue, 19 Apr 2022 22:48:18 +0000 (UTC) Received: from localhost ([::1]:55596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngwdt-0007tS-TE for qemu-devel@archiver.kernel.org; Tue, 19 Apr 2022 18:48:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngwdA-0007CR-P8 for qemu-devel@nongnu.org; Tue, 19 Apr 2022 18:47:32 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:43194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngwd8-0003xr-To for qemu-devel@nongnu.org; Tue, 19 Apr 2022 18:47:32 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23JIPdAf024809; Tue, 19 Apr 2022 20:44:38 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=TTytcwBs3sC/ZBTlu4Wy3DNcmkSqW1CaZzbotzrSEgI=; b=NoZNpfeUbbSu+4V5eFN/EbABU1T90puNAIXMH0u9s/zvxU0OrhY2lVYfcO2PSLEbzMh5 vCczz90fVe5revMGMg91i1IVYytmAPGC8dmPQ757ReYZLoL4o/JGyaPJAJObjLDnSsqW OpY19mN2Hozw/yN51v7UmmOPQffJ+Kwbm8BZih3DzkngXORMJDeb1ObKKpEEDjYizt28 FhbqgPTGs1lNrdj7YDYuBoZ1D1VzLNPetSm7Diwwcnt6PoD73hgKx4DlkHsMEqfn4fnD MQvymcTzlejt8VoneAWTkarLe88vhldYF1VA/xZ8sGz34rrxKlrKVTMVqB4cmBOb2uwh xg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com with ESMTP id 3ffnp9f29x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Apr 2022 20:44:38 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23JKZj3F034097; Tue, 19 Apr 2022 20:44:37 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2108.outbound.protection.outlook.com [104.47.55.108]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3ffm830c1a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Apr 2022 20:44:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GqTV0rjeQZmIxXjcMLxT5TE/9kHOs6eHgPCB1U6f85bDb3VESDPYGSiZZ7ko4L5bYz/hqcF5mSB6UjrgtViWFa/f/AtWjDXcOdscd3X+yuLP4/MSbmWUVmtWhAcO4Nm6jTW2O/6BD6KhDQ/NKHQUtzfZ/sMqjLDvNpUT6/Wxk+a7h655Be9owg1fpKTsBkM0aJ45cCXyIpFykIE2d22t507YyIKtRtIhlxaZYDpbyLUbHw8dHdD28y58xSwrlpbk+habK/0zkZc5ceqbMYXzZQnDeKeEGbkImmVfGakfk8wXwUhsPV0itx4lkmZlEIzuyuGsV018YxvYolOBZ2LmCA== 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=TTytcwBs3sC/ZBTlu4Wy3DNcmkSqW1CaZzbotzrSEgI=; b=P7MbJM97bIwCL54EYHKRc25X3PGjf2P4aefV8LeMVT2cb1JVOt8qpgXjBYc33zXZjTNzeORjuOGrLAYoZUIiBlvfVxTW1Fnm6LAZorv35k+/ry1+FIxNIM/thV9hfBqsz03ncyoE5CWzoOS8KxearSbmzBPoLLLtvxADRztb4eTjOjWIpxYElNlPtwNRe/KEt676+pZGLc4dN6l7vw0vEBgyruTpJwUcpCuaSn6sqPtmC7h+L4zGezK+GHWr/X6EzwH9LrOAH5yu3tL8c8ykMs5ioZb5mmzny5qEvyFyYc5BzrN5CkNr+VvzMZOiLUjRicSkoQ+25KDX5zddYN/Ujw== 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=TTytcwBs3sC/ZBTlu4Wy3DNcmkSqW1CaZzbotzrSEgI=; b=To5dEuTa/S9uK1+x1wvf9j4iGVjnBFdycHrbPgf8t98WP3yIk6QyBIf7kgdncxX+0VRdOGaERQD1MbJ942W6KfbvQ9iQQ5mft39yAlikmwj8608gePWYM9ztSOn3e0vIoxn6k4yrf64ZIwjJovqILw0cSCBimARKKKYtijbNISo= Received: from MN2PR10MB4013.namprd10.prod.outlook.com (2603:10b6:208:185::25) by MWHPR10MB1998.namprd10.prod.outlook.com (2603:10b6:300:10c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Tue, 19 Apr 2022 20:44:35 +0000 Received: from MN2PR10MB4013.namprd10.prod.outlook.com ([fe80::e104:96ca:aa5c:2bac]) by MN2PR10MB4013.namprd10.prod.outlook.com ([fe80::e104:96ca:aa5c:2bac%4]) with mapi id 15.20.5164.025; Tue, 19 Apr 2022 20:44:34 +0000 From: Jagannathan Raman To: qemu-devel@nongnu.org Subject: [PATCH v8 01/17] tests/avocado: Specify target VM argument to helper routines Date: Tue, 19 Apr 2022 16:44:06 -0400 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: X-ClientProxiedBy: BYAPR04CA0029.namprd04.prod.outlook.com (2603:10b6:a03:40::42) 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: bd319b6e-0d5c-4a09-8164-08da2245697e X-MS-TrafficTypeDiagnostic: MWHPR10MB1998: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: jFaybOLvrH+OdTs1p+9yGsMbSBOOqzEO23dq4x7JyPUx2cEoatC4be+xk4Ko9e75GR99uq9EfEA3TE5Sbo7ZJ6t85Y0lpKFz789Q97UH+HHd5j6yODD8vnlOXs4v8jHdtFtE0boMiX8rOnjJCNOf/YJach7mMpR8Rj7pEvB1NLrqcwtqVdv28mV/gWjc7NJQz+B3nxgyka21mMEKAd0lJjNDVDEeS9pqGO27E2twoE6nU9UdaMelYupHoIe5Ely+OIvXJprdj8Y+cEAz1p46pGwF3IZPDgUUY3UNPalZNBmplURzkInf6QdjoWAWsWGXv+mjdoIerQwzz6P621AV5jWkGuOsLDN8VMYcE8SythyBopjPPYQrrFzHU/Rm0q7bw+louWAyOrADML10BNXnC76cJaLtzcANVlHOF9qFhSdbF1ox3srO5Pgn8xNVmB4+gAbjjh6bcxFgTqwxf2cXqI3l8gGojXE44qiozSLCRp71O8oL2lhdFGgQhsCjJeXHyE/v6ruyfoXmzmOatHRxFjSYSrmPrcaZ8zphBbXFwSVdlxPNO8qkbZ15V2yWMOSJglANatzDJzkOBNR0sQ9SXxZREcv26gcjTHejmgzae7nrqJT8HnJYeulQuWQt3M2Mgr8fNhLhNJz/KbizmDzKjdw/fvZ6aV5ggsfiJ55gPoESCpusz4VDZqPMQKjnYInl2u5qilaBgB/7n7e/n/ESVA== 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)(83380400001)(6486002)(4326008)(66946007)(66556008)(38100700002)(66476007)(8936002)(7416002)(5660300002)(8676002)(38350700002)(2906002)(52116002)(107886003)(508600001)(2616005)(186003)(36756003)(26005)(316002)(6916009)(6506007)(6512007)(6666004)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9XhooB+/ujvRKh4YdfcGtcMZIMar?= =?utf-8?q?rghPog7lWIbwC1PFikT4X37IVhuPcwbG7Qz2dpDbhAMbINcnzrXmFYt/5Z4XlvTxh?= =?utf-8?q?xiCieRH2Hms0YDuo3NfnxwaQhVG/wAuPekG4G0fkvHil4Zzr/616H2DwyZdWb67w0?= =?utf-8?q?IhsSGetOfU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RXUf2dG4IOIf8LAYmswZozewJL2csf0Ipw?= =?utf-8?q?XrSRyN23TROczrqS8IOD7oV0xPCBccRIgFaeUQ2moG5CeK8KJ9WkBADwWWv7tNGjh?= =?utf-8?q?FGVZbTj7BJvLN+pCG3K1P7TdeJPmHsGBBKTl1vccnj8kMkE1pwj6R3pZmWYj//x3p?= =?utf-8?q?HwhuraB3fgiv4+GtOBhpdpICrsjgJ8pP6ReT/T/MHnDJcuE1UD17sS1D+SOwjQlvJ?= =?utf-8?q?N3vJ+zhSXrXCz6+WyCHzvSAQvxus2hsEzHjoCHl47x/FCVLlfWYXzHacr2jw99tV+?= =?utf-8?q?RyUXNA0IXc9JQOOkfpq9iaNZmcNqMncqoche9XSgs8uqqspFzAF6VaGSYVsF1IbR+?= =?utf-8?q?lqQlYLUjITMiARAjXtQV8JYgHt1VoD6GDOE66ZEZ6hffrG7vMKSpEO+td5Gr9LS4g?= =?utf-8?q?JYFjeN037nfSevKQfClW8F0w/pQMlKbKQGHDBd9GHOPscMtMXWDNEXylDVgNc6wwY?= =?utf-8?q?CCQK5pkw0V952Yr/09JFdw+ufD45TxU+SL3rKgzGzGCTG+JcQxmSDFhvCAvsG5mAP?= =?utf-8?q?GYK7lt9U6lSWQY1lLd38BxzZukdm5faysg2Xar6e84+olCzrQkYiHATG5A10bDpOj?= =?utf-8?q?oyAwqKAsQ9IYFAkBdGm5yt2vPXR0jGSQ=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd319b6e-0d5c-4a09-8164-08da2245697e X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4013.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2022 20:44:34.8707 (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: eKuffJlx83iwVnEKCDMKU/IwIYFzXTK1QnYvrmYpbybnlJ/1yKxbL1pcetbEpyi9T1D0KA9tuwnUBc8HDOa36A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1998 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486, 18.0.858 definitions=2022-04-19_07:2022-04-15, 2022-04-19 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204190115 X-Proofpoint-ORIG-GUID: wyc4fTm_efrRa0Vg2c4xpFzoEXjaWiM1 X-Proofpoint-GUID: wyc4fTm_efrRa0Vg2c4xpFzoEXjaWiM1 Received-SPF: pass client-ip=205.220.165.32; envelope-from=jag.raman@oracle.com; helo=mx0a-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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: eduardo@habkost.net, elena.ufimtseva@oracle.com, thuth@redhat.com, john.g.johnson@oracle.com, berrange@redhat.com, bleal@redhat.com, john.levon@nutanix.com, mst@redhat.com, armbru@redhat.com, quintela@redhat.com, f4bug@amsat.org, thanos.makatos@nutanix.com, kanth.ghatraju@oracle.com, stefanha@redhat.com, marcandre.lureau@redhat.com, pbonzini@redhat.com, jag.raman@oracle.com, eblake@redhat.com, dgilbert@redhat.com 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 ac85e36a4d..18a34a798c 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):