From patchwork Fri Aug 22 14:51:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 382244 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CA0DF140086 for ; Sat, 23 Aug 2014 00:55:10 +1000 (EST) Received: from localhost ([::1]:37582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKqFB-0005r4-0C for incoming@patchwork.ozlabs.org; Fri, 22 Aug 2014 10:55:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKqCT-00017L-Kv for qemu-devel@nongnu.org; Fri, 22 Aug 2014 10:52:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKqCO-0005fC-KW for qemu-devel@nongnu.org; Fri, 22 Aug 2014 10:52:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKqCO-0005f5-CW for qemu-devel@nongnu.org; Fri, 22 Aug 2014 10:52:16 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7MEqF1S030996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 22 Aug 2014 10:52:15 -0400 Received: from noname.redhat.com (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7MEptpG005727; Fri, 22 Aug 2014 10:52:14 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Fri, 22 Aug 2014 16:51:36 +0200 Message-Id: <1408719113-5316-13-git-send-email-kwolf@redhat.com> In-Reply-To: <1408719113-5316-1-git-send-email-kwolf@redhat.com> References: <1408719113-5316-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com Subject: [Qemu-devel] [PULL 12/29] qemu-iotests: Fix 028 reference output for qed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We need to filter out driver-specific options in the "Formatting..." string printed by qemu when creating the backup image. Reported-by: Peter Wu Signed-off-by: Kevin Wolf Tested-by: Peter Wu --- tests/qemu-iotests/028 | 1 + tests/qemu-iotests/028.out | 3 ++- tests/qemu-iotests/common.filter | 22 ++++++++++++++++++++++ tests/qemu-iotests/common.rc | 19 +------------------ 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028 index 9e701e1..a1f4423 100755 --- a/tests/qemu-iotests/028 +++ b/tests/qemu-iotests/028 @@ -113,6 +113,7 @@ QEMU_COMM_TIMEOUT=1 # Silence output since it contains the disk image path and QEMU's readline # character echoing makes it very hard to filter the output _send_qemu_cmd $h "drive_backup disk ${TEST_IMG}.copy" "(qemu)" >/dev/null +_send_qemu_cmd $h "" "Formatting" | _filter_img_create qemu_cmd_repeat=20 _send_qemu_cmd $h "info block-jobs" "No active jobs" _send_qemu_cmd $h 'quit' "" diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out index 0e1a5ae..e8d0245 100644 --- a/tests/qemu-iotests/028.out +++ b/tests/qemu-iotests/028.out @@ -468,7 +468,8 @@ No errors were found on the image. block-backup -Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=4294968832 backing_file='TEST_DIR/t.qcow2.base' backing_fmt='qcow2' encryption=off cluster_size=65536 lazy_refcounts=off +Formatting 'TEST_DIR/t.IMGFMT.copy', fmt=IMGFMT size=4294968832 backing_file='TEST_DIR/t.IMGFMT.base' backing_fmt='IMGFMT' +(qemu) (qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo blockinfo block-info block-jinfo block-joinfo block-jobinfo block-jobs Type backup, device disk: Completed 0 of 4294968832 bytes, speed limit 0 bytes/s iininfinfoinfo info binfo blinfo bloinfo blocinfo blockinfo block-info block-jinfo block-joinfo block-jobinfo block-jobs diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter index a04df7f..51192c8 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -170,5 +170,27 @@ _filter_qmp() -e 's#^{"QMP":.*}$#QMP_VERSION#' } +# replace driver-specific options in the "Formatting..." line +_filter_img_create() +{ + sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ + -e "s#$TEST_DIR#TEST_DIR#g" \ + -e "s#$IMGFMT#IMGFMT#g" \ + -e "s# encryption=off##g" \ + -e "s# cluster_size=[0-9]\\+##g" \ + -e "s# table_size=[0-9]\\+##g" \ + -e "s# compat='[^']*'##g" \ + -e "s# compat6=\\(on\\|off\\)##g" \ + -e "s# static=\\(on\\|off\\)##g" \ + -e "s# zeroed_grain=\\(on\\|off\\)##g" \ + -e "s# subformat='[^']*'##g" \ + -e "s# adapter_type='[^']*'##g" \ + -e "s# lazy_refcounts=\\(on\\|off\\)##g" \ + -e "s# block_size=[0-9]\\+##g" \ + -e "s# block_state_zero=\\(on\\|off\\)##g" \ + -e "s# log_size=[0-9]\\+##g" \ + -e "s/archipelago:a/TEST_DIR\//g" +} + # make sure this script returns success /bin/true diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 3fd691e..9c49deb 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -149,24 +149,7 @@ _make_test_img() else $QEMU_IMG create -f $IMGFMT $extra_img_options "$img_name" $image_size 2>&1 fi - ) | \ - sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ - -e "s#$TEST_DIR#TEST_DIR#g" \ - -e "s#$IMGFMT#IMGFMT#g" \ - -e "s# encryption=off##g" \ - -e "s# cluster_size=[0-9]\\+##g" \ - -e "s# table_size=[0-9]\\+##g" \ - -e "s# compat='[^']*'##g" \ - -e "s# compat6=\\(on\\|off\\)##g" \ - -e "s# static=\\(on\\|off\\)##g" \ - -e "s# zeroed_grain=\\(on\\|off\\)##g" \ - -e "s# subformat='[^']*'##g" \ - -e "s# adapter_type='[^']*'##g" \ - -e "s# lazy_refcounts=\\(on\\|off\\)##g" \ - -e "s# block_size=[0-9]\\+##g" \ - -e "s# block_state_zero=\\(on\\|off\\)##g" \ - -e "s# log_size=[0-9]\\+##g" \ - -e "s/archipelago:a/TEST_DIR\//g" + ) | _filter_img_create # Start an NBD server on the image file, which is what we'll be talking to if [ $IMGPROTO = "nbd" ]; then