From patchwork Mon Sep 4 11:16:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kashyap Chamarthy X-Patchwork-Id: 9937021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69BB66038C for ; Mon, 4 Sep 2017 11:17:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B5D72879D for ; Mon, 4 Sep 2017 11:17:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5016E287C5; Mon, 4 Sep 2017 11:17:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AA8F92879D for ; Mon, 4 Sep 2017 11:17:34 +0000 (UTC) Received: from localhost ([::1]:54370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dopNl-0002PW-BM for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Sep 2017 07:17:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dopMx-0002Nw-Fx for qemu-devel@nongnu.org; Mon, 04 Sep 2017 07:16:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dopMs-0002Mm-Cq for qemu-devel@nongnu.org; Mon, 04 Sep 2017 07:16:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57812) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dopMh-00025P-4r; Mon, 04 Sep 2017 07:16:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1732D4E909; Mon, 4 Sep 2017 11:16:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1732D4E909 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kchamart@redhat.com Received: from eukaryote.localdomain (ovpn-117-212.ams2.redhat.com [10.36.117.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90E43A9486; Mon, 4 Sep 2017 11:16:20 +0000 (UTC) From: Kashyap Chamarthy To: qemu-devel@nongnu.org Date: Mon, 4 Sep 2017 13:16:16 +0200 Message-Id: <20170904111616.21333-1-kchamart@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 04 Sep 2017 11:16:26 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qemu-iotests: Make test 192 use QMP; convert it to Python X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org, Kashyap Chamarthy , dgilbert@redhat.com, stefanha@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The test 192 ("Test NBD export with '-incoming' (non-shared storage migration use case from libvirt")) is currently using HMP. Replace the HMP usage with QMP, as the upstream preference seems to be: "Use QMP where possible, unless you're explicitly testing something related to HMP". While at it, convert the test from Bash to Python. Signed-off-by: Kashyap Chamarthy --- tests/qemu-iotests/192 | 78 ++++++++++++++++++---------------------------- tests/qemu-iotests/192.out | 14 ++++----- 2 files changed, 38 insertions(+), 54 deletions(-) diff --git a/tests/qemu-iotests/192 b/tests/qemu-iotests/192 index b50a2c0c8e2fccdddfae4ac58ca35937c5f784c6..692475f0a8c80c81396587d3289d4b32c0ee0d21 100755 --- a/tests/qemu-iotests/192 +++ b/tests/qemu-iotests/192 @@ -1,7 +1,4 @@ -#!/bin/bash -# -# Test NBD export with -incoming (non-shared storage migration use case from -# libvirt) +#!/usr/bin/env python # # Copyright (C) 2017 Red Hat, Inc. # @@ -18,46 +15,33 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # - -# creator -owner=famz@redhat.com - -seq=`basename $0` -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! - -_cleanup() -{ - _cleanup_test_img -} -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common.rc -. ./common.filter - -_supported_fmt generic -_supported_proto file -_supported_os Linux - -if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then - _notrun "Requires a PC machine" -fi - -size=64M -_make_test_img $size - -{ -echo "nbd_server_start unix:$TEST_DIR/nbd" -echo "nbd_server_add -w drive0" -echo "q" -} | $QEMU -nodefaults -display none -monitor stdio \ - -drive format=$IMGFMT,file=$TEST_IMG,if=ide,id=drive0 \ - -incoming defer 2>&1 | _filter_testdir | _filter_qemu | _filter_hmp - -# success, all done -echo "*** done" -rm -f $seq.full -status=0 +# Author: Kashyap Chamarthy +# [Converted to Python from the original Bash version by Fam +# Zheng (