Message ID | 20210906190654.183421-7-vsementsov@virtuozzo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=tHH0=N4=nongnu.org=qemu-devel-bounces+qemu-devel=archiver.kernel.org@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 464BBC433EF for <qemu-devel@archiver.kernel.org>; Mon, 6 Sep 2021 19:14:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8E52661051 for <qemu-devel@archiver.kernel.org>; Mon, 6 Sep 2021 19:14:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8E52661051 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org>) id 1mNK53-0000Us-HW for qemu-devel@archiver.kernel.org; Mon, 06 Sep 2021 15:14:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <vsementsov@virtuozzo.com>) id 1mNJxm-0005a4-E5; Mon, 06 Sep 2021 15:07:27 -0400 Received: from mail-eopbgr80094.outbound.protection.outlook.com ([40.107.8.94]:32928 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <vsementsov@virtuozzo.com>) id 1mNJxk-0002Fk-SP; Mon, 06 Sep 2021 15:07:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a3kvCc7QpRKd493AhOGIuF+G8KfV2VciYPPAra3FpZNLpdsA3InFMCyob0Keie9CUtuPRM7i7Ki4RWJ0RHgzEO3e5EueEW9jG1YxXLo5UAMmzcvLxobit4/GX3br8iW8flBnE9FYBleJZRNGSaZVg41DADfm9KoLVfe36VhgsacdW2jWnIOoNiNi+SHmRnO0wAgX/NqMkBk6HN+jeqXGOUGHGhIlJUjdTW8+R2sbWGK2DRIWpEjeB8No8n3VNYt3KsFyw6G2MRYPGndyKJasoE3GYSKp9j+LgccyuH5VrDVPjxEsxIGZyDzOiYsRp5Ti0MglebdhDHUxDXdTyGafBA== 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; bh=zMF/6wu1+dnI35RF1X1ZIDaL5AGb7fYHv2cyajliO1w=; b=leygk8ELtjzS7A05/pzYrWen/5204kB9LvWkVDlU8upG2DZ5J7yM61LrGM1WNJPjc0vT6eaERWF7EbGDe0dBiR46EG/t/ScUk/nIKEmxkWOq95VCfIRd9OSwg6zV9BOIY4y+Ba3GPrE/oepzDbYFihsvot358sfG0RiQda4xU/wHCg7BQWMSaYGzyq+K+8C4bJM6lybZ1zrCyO2+rHjpad9p5UGONAZZu/js49c9kGsvNxD8gBrtTT+gmFBVtmRj7BfehwfYBKLTh95xHp1anaW8DykChmjeOeEWTSTlDdOYqzxhrFHe5zbe2lJ/Ul5U48LEpTcnmpdYu26B06YZyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zMF/6wu1+dnI35RF1X1ZIDaL5AGb7fYHv2cyajliO1w=; b=f66JQ99I6Jh4vym5VMlNANGXfPd6JjeozyqK6vN7h2ae3G8f+f4GqDwDa4W02srhx9UrOmv83/PyJpaE43Al5MD0FQjGKBjY+TDSSyiZlF6NWWZa3vaopw5i/xc2uJbWhr24fjDH9V+0JaXcckJ9TUgwhlSAPLwGmArc3hS6c0E= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4849.eurprd08.prod.outlook.com (2603:10a6:20b:c3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.24; Mon, 6 Sep 2021 19:07:15 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::2817:53b3:f8b4:fe22]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::2817:53b3:f8b4:fe22%8]) with mapi id 15.20.4478.025; Mon, 6 Sep 2021 19:07:15 +0000 From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eblake@redhat.com, den@openvz.org Subject: [PATCH v3 6/9] iotests.py: add qemu_tool_popen() Date: Mon, 6 Sep 2021 22:06:51 +0300 Message-Id: <20210906190654.183421-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210906190654.183421-1-vsementsov@virtuozzo.com> References: <20210906190654.183421-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: HE1PR05CA0302.eurprd05.prod.outlook.com (2603:10a6:7:93::33) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (185.215.60.196) by HE1PR05CA0302.eurprd05.prod.outlook.com (2603:10a6:7:93::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17 via Frontend Transport; Mon, 6 Sep 2021 19:07:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4504b478-cf4a-4334-c7a1-08d971698a2f X-MS-TrafficTypeDiagnostic: AM6PR08MB4849: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <AM6PR08MB4849AD1E8AA89517F1A18AAEC1D29@AM6PR08MB4849.eurprd08.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wv3Ubdlae9JEomMUP9QVKKjPDfI5/5NY++h0C3bl2iSy1TRPi2Hq1fJntvWMiTz9L7NOYYdfFgesFiwtXrKizr3KIRgOoX4fuSf3qxO+30BYNpGISrejSISpRsrlhR2BSJICiQLlAGFD1ASRKXJ1ERk8ysFDnAJQV5UrLxNzfUrny1hO7mlxBvT1Gpr9a2OBuOJJk/t0c57PC1biVnlwI2yDtrY+GHcqMMXAeTtoXZCIbqnImEH3n7Exp7yIcpvz6B/oRXOoBk/FfgEGRTuB6OWT5tYOJfQQqOM09S9k5+2uY2MEop/w9eBRVlIFkeibPhjEmqz25hJ4wMgEriX00dXHL2919+TpzXJNoaMtMb54a9ZWygdnDHJoGhwZOlm/VTlsm/fmWpZGvpbJb/zteGAMLhfn/2cGVQvPAKbH5UR8ItmsozFzfF3sDB1kQOfqU1bO+l3b80H9YkRzoK70e9JsWreKinqqDWfL3p3pBDeYiOOUeh1H2rK1aU96+CxrPxU6nlmooka+JJDUWqbolEZ6KEksa5zujarHXexmzNPp7HF8OhQaFnIpyTluBjSZ3vj29ynFK8O1nIzxz+aPVcvLK76fetD6uKFjOxQLTyXAbVpJ7D8n4Lxft2s59VNUJf2nCqivY2bLLuVDqPV4bIhwhUveuIiZ0rWWQfMhKRF7JwC/GRA+lif9DkXOVzPKlb2uCHfvXDOdWeC0B6R2Ew== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(39840400004)(346002)(366004)(396003)(136003)(66476007)(66556008)(38350700002)(478600001)(83380400001)(26005)(66946007)(8676002)(5660300002)(1076003)(186003)(38100700002)(52116002)(2616005)(4326008)(8936002)(36756003)(107886003)(6506007)(86362001)(6666004)(956004)(6512007)(316002)(6486002)(2906002)(6916009); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YE/yZYN5Nk0C7rHSfruVL6nHwerPH3GxIjD4/hxfsojUhc1PTPw7e9zGuSkSY7UaLfXpBDoKPeVwXKkioeVVJz2Jy8Yrgt11C4jhQb0+ozTgbGAwyqRLZ+1VIqDyfCUT63kXH49+HbUzg8cEd16JbW4WgxW//oSH2W1+sXp8hHoM7lYBoIEm3O2I+6V3C8kO0f0zLWoKxd7e5GpHKNPhBmuhDAVIAsBeBBFW1qLzTCCgRg45a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So X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4504b478-cf4a-4334-c7a1-08d971698a2f X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2021 19:07:15.4901 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h57R3jsjvJC/hMUHe1Mr/wjB9gZE+UoSQiTs1DMx80cJL3fHFrEHzet2k+4Se3Mq5bQ/L4/nLkr+ZDs4GTr5QTzYA81R3mixmhQbtrnOTq4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4849 Received-SPF: pass client-ip=40.107.8.94; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org> |
Series |
nbd reconnect on open
|
expand
|
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 89663dac06..b518545c09 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -106,14 +106,21 @@ def unarchive_sample_image(sample, fname): shutil.copyfileobj(f_in, f_out) +def qemu_tool_popen(tool: str, args: Sequence[str], + connect_stderr: bool = True) -> subprocess.Popen: + stderr = subprocess.STDOUT if connect_stderr else None + return subprocess.Popen(args, + stdout=subprocess.PIPE, + stderr=stderr, + universal_newlines=True) + + def qemu_tool_pipe_and_status(tool: str, args: Sequence[str], connect_stderr: bool = True) -> Tuple[str, int]: """ Run a tool and return both its output and its exit code """ - stderr = subprocess.STDOUT if connect_stderr else None - with subprocess.Popen(args, stdout=subprocess.PIPE, - stderr=stderr, universal_newlines=True) as subp: + with qemu_tool_popen(tool, args, connect_stderr) as subp: output = subp.communicate()[0] if subp.returncode < 0: cmd = ' '.join(args)
Split qemu_tool_popen() from qemu_tool_pipe_and_status() to be used separately. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> --- tests/qemu-iotests/iotests.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)