From patchwork Mon Mar 21 13:47:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 8633301 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F1EC5C0553 for ; Mon, 21 Mar 2016 13:49:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F3DD20320 for ; Mon, 21 Mar 2016 13:49:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A49AB201F5 for ; Mon, 21 Mar 2016 13:49:32 +0000 (UTC) Received: from localhost ([::1]:57898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai0D6-0004a0-2u for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 Mar 2016 09:49:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai0C4-0002ud-7D for qemu-devel@nongnu.org; Mon, 21 Mar 2016 09:48:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai0C2-0003Jb-EH for qemu-devel@nongnu.org; Mon, 21 Mar 2016 09:48:28 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:63846 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai0C2-0003EU-77; Mon, 21 Mar 2016 09:48:26 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BDAgCs+u9W/5tjdVteHAGDFoFFpiwFAYEPkFWCDwENgXCGDQKBJjgUAQEBAQEBAWQnhEIBAQR5ED8SPBsZiCsBvmYBAQEBBiCFVoJDh1GFCgWHYI93jgSJM4VUjwYeAQFCg2doihUBAQE X-IPAS-Result: A2BDAgCs+u9W/5tjdVteHAGDFoFFpiwFAYEPkFWCDwENgXCGDQKBJjgUAQEBAQEBAWQnhEIBAQR5ED8SPBsZiCsBvmYBAQEBBiCFVoJDh1GFCgWHYI93jgSJM4VUjwYeAQFCg2doihUBAQE X-IronPort-AV: E=Sophos;i="5.24,372,1454972400"; d="scan'208";a="33491412" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 21 Mar 2016 14:47:47 +0100 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim) id 1ai0BP-0000Wr-3n; Mon, 21 Mar 2016 14:47:47 +0100 Received: from berto by perseus.local with local (Exim 4.86_2) (envelope-from ) id 1ai0B7-00045L-6A; Mon, 21 Mar 2016 15:47:29 +0200 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Mon, 21 Mar 2016 15:47:27 +0200 Message-Id: <5272a2aa57bc0b3f981f8b3e0c813e58a88c974b.1458566441.git.berto@igalia.com> X-Mailer: git-send-email 2.8.0.rc3 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 , Stefan Hajnoczi , qemu-block@nongnu.org, Max Reitz Subject: [Qemu-devel] [PATCH v2 3/3] 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 48a924c..3ac2443 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