From patchwork Fri Apr 24 11:40:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 464202 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 8ED14140082 for ; Fri, 24 Apr 2015 21:47:38 +1000 (AEST) Received: from localhost ([::1]:44333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylc50-0006kd-UU for incoming@patchwork.ozlabs.org; Fri, 24 Apr 2015 07:47:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlbzP-00051s-AH 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 1YlbzL-0008MP-PJ for qemu-devel@nongnu.org; Fri, 24 Apr 2015 07:41:47 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:46869 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlbzL-0008LO-Ii; Fri, 24 Apr 2015 07:41:43 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlUGAGErOlVbdWOb/2dsb2JhbABbgwyBLrRWAQEBAQEBBQGBApg9AoE9TAEBAQEBAYELhCEBAQR5EFE8GxmILwHLfQEBCCKGFoolBxaEFwWLUJAvlUsjYIMXOzGCRAEBAQ X-IPAS-Result: AlUGAGErOlVbdWOb/2dsb2JhbABbgwyBLrRWAQEBAQEBBQGBApg9AoE9TAEBAQEBAYELhCEBAQR5EFE8GxmILwHLfQEBCCKGFoolBxaEFwWLUJAvlUsjYIMXOzGCRAEBAQ X-IronPort-AV: E=Sophos;i="5.11,639,1422918000"; d="scan'208";a="349787602" 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-00034p-Pe; 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-0000ph-AI; Fri, 24 Apr 2015 13:41:38 +0200 Received: from berto by perseus.local with local (Exim 4.84) (envelope-from ) id 1YlbzE-0001sX-TM; Fri, 24 Apr 2015 14:41:36 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 24 Apr 2015 14:40:52 +0300 Message-Id: <57782138d21e277dddee0fd348a8ba437411bd64.1429875134.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: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi 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 updates test_stream_partial() to test that the block-stream operation never copies data from the image specified as base. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/030 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 6e6cb5a..a395a03 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -94,6 +94,19 @@ class TestSingleDrive(iotests.QMPTestCase): def test_stream_partial(self): self.assert_no_active_block_jobs() + # 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.assertNotEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_img), + qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img), + 'image file map matches backing file after a no-op') + + # And this is the operation that actually copies data result = self.vm.qmp('block-stream', device='drive0', base=backing_img) self.assert_qmp(result, 'return', {})