Received: from eggs.gnu.org ([2001:4830:134:3::10]:36445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsOZk-00040R-Or for qemu-devel@nongnu.org; Wed, 04 Jun 2014 23:42:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsOZd-00020u-CJ for qemu-devel@nongnu.org; Wed, 04 Jun 2014 23:42:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsOZd-00020i-3W for qemu-devel@nongnu.org; Wed, 04 Jun 2014 23:42:41 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s553ge2a017565 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 4 Jun 2014 23:42:40 -0400 From: Fam Zheng Date: Thu, 5 Jun 2014 11:42:36 +0800 Message-Id: <1401939756-11150-4-git-send-email-famz@redhat.com> In-Reply-To: <1401939756-11150-1-git-send-email-famz@redhat.com> References: <1401939756-11150-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] qemu-iotests: Test 0-length image for mirror List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , jcody@redhat.com, Max Reitz , Stefan Hajnoczi , Paolo Bonzini All behavior and invariant should hold for images with 0 length, so add a class to repeat all the tests in TestSingleDrive. Signed-off-by: Fam Zheng --- tests/qemu-iotests/041 | 5 +++++ tests/qemu-iotests/041.out | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index ec470b2..ae876ad 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -206,6 +206,11 @@ class TestSingleDrive(ImageMirroringTestCase): target=target_img) self.assert_qmp(result, 'error/class', 'DeviceNotFound') +class TestSingleDriveZeroLength(TestSingleDrive): + def setUp(self): + TestSingleDrive.image_len = 0 + return TestSingleDrive.setUp(self) + class TestMirrorNoBacking(ImageMirroringTestCase): image_len = 2 * 1024 * 1024 # MB diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out index 6d9bee1..cafb816 100644 --- a/tests/qemu-iotests/041.out +++ b/tests/qemu-iotests/041.out @@ -1,5 +1,5 @@ -........................... +..................................... ---------------------------------------------------------------------- -Ran 27 tests +Ran 37 tests OK -- 2.0.0