From patchwork Wed May 13 13:27:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 471878 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 6B0DE140662 for ; Wed, 13 May 2015 23:28:36 +1000 (AEST) Received: from localhost ([::1]:48929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsWiA-0007Rv-Fr for incoming@patchwork.ozlabs.org; Wed, 13 May 2015 09:28:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsWhW-0006Ef-8t for qemu-devel@nongnu.org; Wed, 13 May 2015 09:27:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsWhT-0003Sv-9N for qemu-devel@nongnu.org; Wed, 13 May 2015 09:27:54 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:44220 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsWhT-0003S1-33; Wed, 13 May 2015 09:27:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhMFABhQU1VbdWOb/2dsb2JhbABcgw+BMrMLBQGBBJhYAoE5TAEBAQEBAYELhCEBAQR5EFE8GxmIMAHIMwEBAQcihhaKKQcWhBcFhmKFQJEklnYjYYMZOzGCRgEBAQ X-IPAS-Result: AhMFABhQU1VbdWOb/2dsb2JhbABcgw+BMrMLBQGBBJhYAoE5TAEBAQEBAYELhCEBAQR5EFE8GxmIMAHIMwEBAQcihhaKKQcWhBcFhmKFQJEklnYjYYMZOzGCRgEBAQ X-IronPort-AV: E=Sophos;i="5.13,420,1427752800"; d="scan'208";a="360677730" 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-0002eu-Hi; 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-0000SC-3h; Wed, 13 May 2015 15:27:46 +0200 Received: from berto by perseus.local with local (Exim 4.85) (envelope-from ) id 1YsWhM-0002qt-KD; Wed, 13 May 2015 16:27:44 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 13 May 2015 16:27:38 +0300 Message-Id: <02126c021558cda6ac4244c63a270c0657de2646.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 08/11] qemu-iotests: add no-op streaming test 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 patch tests that in a partial block-stream operation, no data is ever copied from the base image. 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, 20 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 6e6cb5a..bc53885 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -91,6 +91,24 @@ 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_no_op(self): + self.assert_no_active_block_jobs() + + # The image map is empty before the operation + empty_map = qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img) + + # This is a no-op: no data should ever be copied from the base image + result = self.vm.qmp('block-stream', device='drive0', base=mid_img) + self.assert_qmp(result, 'return', {}) + + self.wait_until_completed() + + self.assert_no_active_block_jobs() + self.vm.shutdown() + + self.assertEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img), + empty_map, 'image file map changed after a no-op') + def test_stream_partial(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