From patchwork Wed May 13 13:27:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 471879 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 6DECC14078C for ; Wed, 13 May 2015 23:28:36 +1000 (AEST) Received: from localhost ([::1]:48930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsWiA-0007S6-IW for incoming@patchwork.ozlabs.org; Wed, 13 May 2015 09:28:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsWhV-0006Dk-7o for qemu-devel@nongnu.org; Wed, 13 May 2015 09:27:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsWhS-0003SV-U4 for qemu-devel@nongnu.org; Wed, 13 May 2015 09:27:53 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:36981 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsWhS-0003RS-NI; Wed, 13 May 2015 09:27:50 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhMFABhQU1VbdWOb/2dsb2JhbABcgw+BMrMLBQGBBJhYAoE5TAEBAQEBAYELhCEBAQR5EFE8GxmIMAHIMwEBAQcihhaKKQcWhBcFhmKEWGiRJJZ2I2GBKByBVTsxgkYBAQE X-IPAS-Result: AhMFABhQU1VbdWOb/2dsb2JhbABcgw+BMrMLBQGBBJhYAoE5TAEBAQEBAYELhCEBAQR5EFE8GxmIMAHIMwEBAQcihhaKKQcWhBcFhmKEWGiRJJZ2I2GBKByBVTsxgkYBAQE X-IronPort-AV: E=Sophos;i="5.13,420,1427752800"; d="scan'208";a="360677729" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 13 May 2015 15:27:47 +0200 Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com) by fanzine.igalia.com with esmtps (Cipher TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim) id 1YsWhP-0002et-Ge; Wed, 13 May 2015 15:27:47 +0200 Received: from fanzine.local.igalia.com ([192.168.10.13] helo=perseus.local) by mail.igalia.com with esmtps (Cipher TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim) id 1YsWhO-0000SD-3n; Wed, 13 May 2015 15:27:46 +0200 Received: from berto by perseus.local with local (Exim 4.85) (envelope-from ) id 1YsWhM-0002qy-LT; Wed, 13 May 2015 16:27:44 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 13 May 2015 16:27:39 +0300 Message-Id: <2c8aeb237820f29ce2fe43ea0ceb7a4f69b14d7b.1431523498.git.berto@igalia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Cc: Alberto Garcia , qemu-block@nongnu.org Subject: [Qemu-devel] [PATCH 09/11] qemu-iotests: test streaming to an intermediate layer 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 This adds test_stream_intermediate(), similar to test_stream() but streams to the intermediate image instead. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Fam Zheng --- tests/qemu-iotests/030 | 18 +++++++++++++++++- tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index bc53885..0927457 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -36,7 +36,8 @@ class TestSingleDrive(iotests.QMPTestCase): qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img) qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 512', backing_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 524288 512', mid_img) - self.vm = iotests.VM().add_drive("blkdebug::" + test_img) + opts = "backing.node-name=mid" + self.vm = iotests.VM().add_drive("blkdebug::" + test_img, opts) self.vm.launch() def tearDown(self): @@ -60,6 +61,21 @@ class TestSingleDrive(iotests.QMPTestCase): qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img), 'image file map does not match backing file after streaming') + def test_stream_intermediate(self): + self.assert_no_active_block_jobs() + + result = self.vm.qmp('block-stream', device='mid') + self.assert_qmp(result, 'return', {}) + + self.wait_until_completed(drive='mid') + + self.assert_no_active_block_jobs() + self.vm.shutdown() + + self.assertEqual(qemu_io('-f', 'raw', '-c', 'map', backing_img), + qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_img), + 'image file map does not match backing file after streaming') + def test_stream_pause(self): self.assert_no_active_block_jobs() diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out index 6323079..96961ed 100644 --- a/tests/qemu-iotests/030.out +++ b/tests/qemu-iotests/030.out @@ -1,5 +1,5 @@ -.............. +............... ---------------------------------------------------------------------- -Ran 14 tests +Ran 15 tests OK