From patchwork Tue Dec 1 23:16:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 551078 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 8F5DB1401DE for ; Wed, 2 Dec 2015 10:17:19 +1100 (AEDT) Received: from localhost ([::1]:55327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3uAf-0000K9-Mw for incoming@patchwork.ozlabs.org; Tue, 01 Dec 2015 18:17:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3uAE-0007s3-0U for qemu-devel@nongnu.org; Tue, 01 Dec 2015 18:16:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3uAC-0002LL-S5 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 18:16:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3uA7-0002Jq-7s; Tue, 01 Dec 2015 18:16:43 -0500 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 CA565E7067; Tue, 1 Dec 2015 23:16:42 +0000 (UTC) Received: from scv.usersys.redhat.com (unused [10.10.50.145] (may be forged)) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB1NGed9026213; Tue, 1 Dec 2015 18:16:42 -0500 From: John Snow To: qemu-block@nongnu.org Date: Tue, 1 Dec 2015 18:16:38 -0500 Message-Id: <1449011799-2790-3-git-send-email-jsnow@redhat.com> In-Reply-To: <1449011799-2790-1-git-send-email-jsnow@redhat.com> References: <1449011799-2790-1-git-send-email-jsnow@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: kwolf@redhat.com, John Snow , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH for-2.6 2/3] iotests: 124: move incremental failure 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 Code motion only, in preparation for adjusting the setUp procedure for this test. Signed-off-by: John Snow --- tests/qemu-iotests/124 | 117 +++++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 57 deletions(-) diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index 778bfdd..2a0119d 100644 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -344,63 +344,6 @@ class TestIncrementalBackup(TestIncrementalBackupBase): self.check_backups() - def test_incremental_failure(self): - '''Test: Verify backups made after a failure are correct. - - Simulate a failure during an incremental backup block job, - emulate additional writes, then create another incremental backup - afterwards and verify that the backup created is correct. - ''' - - # Create a blkdebug interface to this img as 'drive1', - # but don't actually create a new image. - drive1 = self.add_node('drive1', self.drives[0]['fmt'], - path=self.drives[0]['file'], - backup=self.drives[0]['backup']) - result = self.vm.qmp('blockdev-add', options={ - 'id': drive1['id'], - 'driver': drive1['fmt'], - 'file': { - 'driver': 'blkdebug', - 'image': { - 'driver': 'file', - 'filename': drive1['file'] - }, - 'set-state': [{ - 'event': 'flush_to_disk', - 'state': 1, - 'new_state': 2 - }], - 'inject-error': [{ - 'event': 'read_aio', - 'errno': 5, - 'state': 2, - 'immediately': False, - 'once': True - }], - } - }) - self.assert_qmp(result, 'return', {}) - - self.create_anchor_backup(self.drives[0]) - self.add_bitmap('bitmap0', drive1) - # Note: at this point, during a normal execution, - # Assume that the VM resumes and begins issuing IO requests here. - - self.hmp_io_writes(drive1['id'], (('0xab', 0, 512), - ('0xfe', '16M', '256k'), - ('0x64', '32736k', '64k'))) - - result = self.create_incremental(validate=False) - self.assertFalse(result) - self.hmp_io_writes(drive1['id'], (('0x9a', 0, 512), - ('0x55', '8M', '352k'), - ('0x78', '15872k', '1M'))) - self.create_incremental() - self.vm.shutdown() - self.check_backups() - - def test_transaction_failure(self): '''Test: Verify backups made from a transaction that partially fails. @@ -548,5 +491,65 @@ class TestIncrementalBackup(TestIncrementalBackupBase): granularity=64000) +class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase): + '''Incremental backup tests that utilize a BlkDebug filter on drive0.''' + + def test_incremental_failure(self): + '''Test: Verify backups made after a failure are correct. + + Simulate a failure during an incremental backup block job, + emulate additional writes, then create another incremental backup + afterwards and verify that the backup created is correct. + ''' + + # Create a blkdebug interface to this img as 'drive1', + # but don't actually create a new image. + drive1 = self.add_node('drive1', self.drives[0]['fmt'], + path=self.drives[0]['file'], + backup=self.drives[0]['backup']) + result = self.vm.qmp('blockdev-add', options={ + 'id': drive1['id'], + 'driver': drive1['fmt'], + 'file': { + 'driver': 'blkdebug', + 'image': { + 'driver': 'file', + 'filename': drive1['file'] + }, + 'set-state': [{ + 'event': 'flush_to_disk', + 'state': 1, + 'new_state': 2 + }], + 'inject-error': [{ + 'event': 'read_aio', + 'errno': 5, + 'state': 2, + 'immediately': False, + 'once': True + }], + } + }) + self.assert_qmp(result, 'return', {}) + + self.create_anchor_backup(self.drives[0]) + self.add_bitmap('bitmap0', drive1) + # Note: at this point, during a normal execution, + # Assume that the VM resumes and begins issuing IO requests here. + + self.hmp_io_writes(drive1['id'], (('0xab', 0, 512), + ('0xfe', '16M', '256k'), + ('0x64', '32736k', '64k'))) + + result = self.create_incremental(validate=False) + self.assertFalse(result) + self.hmp_io_writes(drive1['id'], (('0x9a', 0, 512), + ('0x55', '8M', '352k'), + ('0x78', '15872k', '1M'))) + self.create_incremental() + self.vm.shutdown() + self.check_backups() + + if __name__ == '__main__': iotests.main(supported_fmts=['qcow2'])