From patchwork Fri Apr 24 11:40:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 464204 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 0E741140082 for ; Fri, 24 Apr 2015 21:48:44 +1000 (AEST) Received: from localhost ([::1]:44345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylc66-0008Ut-BZ for incoming@patchwork.ozlabs.org; Fri, 24 Apr 2015 07:48:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlbzP-00052p-Nl for qemu-devel@nongnu.org; Fri, 24 Apr 2015 07:41:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlbzM-0008Ma-9Z for qemu-devel@nongnu.org; Fri, 24 Apr 2015 07:41:47 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:46854 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlbzM-0008KO-2g; Fri, 24 Apr 2015 07:41:44 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlUGAGErOlVbdWOb/2dsb2JhbABbgwyBLrRWAQEBAQEBBQGBApg9AoE9TAEBAQEBAYELhCEBAQR5EFE8GxmILwHLfQEBAQcihhaKJQcWhBcFhjyFFJAvlUsjYIEnHIFUOzGCRAEBAQ X-IPAS-Result: AlUGAGErOlVbdWOb/2dsb2JhbABbgwyBLrRWAQEBAQEBBQGBApg9AoE9TAEBAQEBAYELhCEBAQR5EFE8GxmILwHLfQEBAQcihhaKJQcWhBcFhjyFFJAvlUsjYIEnHIFUOzGCRAEBAQ X-IronPort-AV: E=Sophos;i="5.11,639,1422918000"; d="scan'208";a="349787606" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 24 Apr 2015 13:41:39 +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 1YlbzH-00034q-RI; Fri, 24 Apr 2015 13:41:39 +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 1YlbzG-0000pi-9c; Fri, 24 Apr 2015 13:41:38 +0200 Received: from berto by perseus.local with local (Exim 4.84) (envelope-from ) id 1YlbzE-0001sc-U2; Fri, 24 Apr 2015 14:41:36 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 24 Apr 2015 14:40:53 +0300 Message-Id: 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: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi 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 --- 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 a395a03..9cbc2d3 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 fa16b5c..6323079 100644 --- a/tests/qemu-iotests/030.out +++ b/tests/qemu-iotests/030.out @@ -1,5 +1,5 @@ -............. +.............. ---------------------------------------------------------------------- -Ran 13 tests +Ran 14 tests OK