From patchwork Tue Mar 29 02:49:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Cody X-Patchwork-Id: 8681601 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1832D9F54E for ; Tue, 29 Mar 2016 02:51:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 76E52201FE for ; Tue, 29 Mar 2016 02:51:24 +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 AADCC20166 for ; Tue, 29 Mar 2016 02:51:23 +0000 (UTC) Received: from localhost ([::1]:44170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akjkZ-0001zk-6e for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Mar 2016 22:51:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akjj2-0007iw-RA for qemu-devel@nongnu.org; Mon, 28 Mar 2016 22:49:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akjj1-0001PM-M6 for qemu-devel@nongnu.org; Mon, 28 Mar 2016 22:49:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akjiz-0001OU-Je; Mon, 28 Mar 2016 22:49:45 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 26F99C00EB05; Tue, 29 Mar 2016 02:49:45 +0000 (UTC) Received: from localhost (ovpn-112-65.phx2.redhat.com [10.3.112.65]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2T2nhwj025170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO); Mon, 28 Mar 2016 22:49:44 -0400 From: Jeff Cody To: qemu-block@nongnu.org Date: Mon, 28 Mar 2016 22:49:36 -0400 Message-Id: <1459219776-15818-4-git-send-email-jcody@redhat.com> In-Reply-To: <1459219776-15818-1-git-send-email-jcody@redhat.com> References: <1459219776-15818-1-git-send-email-jcody@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, jcody@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 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 From: Alberto Garcia 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 Message-id: 5272a2aa57bc0b3f981f8b3e0c813e58a88c974b.1458566441.git.berto@igalia.com Signed-off-by: Jeff Cody --- 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