Danilo C. L. de Paula fda7fbc
From 6b9a6ba9ed753ad7aa714b35de938ebeeb4fa6cb Mon Sep 17 00:00:00 2001
Danilo C. L. de Paula fda7fbc
From: Sergio Lopez Pascual <slp@redhat.com>
Danilo C. L. de Paula fda7fbc
Date: Fri, 7 Feb 2020 10:27:49 +0000
Danilo C. L. de Paula fda7fbc
Subject: [PATCH 16/18] iotests: Test handling of AioContexts with some
Danilo C. L. de Paula fda7fbc
 blockdev actions
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
RH-Author: Sergio Lopez Pascual <slp@redhat.com>
Danilo C. L. de Paula fda7fbc
Message-id: <20200207112749.25073-10-slp@redhat.com>
Danilo C. L. de Paula fda7fbc
Patchwork-id: 93762
Danilo C. L. de Paula fda7fbc
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 9/9] iotests: Test handling of AioContexts with some blockdev actions
Danilo C. L. de Paula fda7fbc
Bugzilla: 1745606 1746217 1773517 1779036 1782111 1782175 1783965
Danilo C. L. de Paula fda7fbc
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Danilo C. L. de Paula fda7fbc
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Danilo C. L. de Paula fda7fbc
RH-Acked-by: Max Reitz <mreitz@redhat.com>
Danilo C. L. de Paula fda7fbc
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
Includes the following tests:
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
 - Adding a dirty bitmap.
Danilo C. L. de Paula fda7fbc
   * RHBZ: 1782175
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
 - Starting a drive-mirror to an NBD-backed target.
Danilo C. L. de Paula fda7fbc
   * RHBZ: 1746217, 1773517
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
 - Aborting an external snapshot transaction.
Danilo C. L. de Paula fda7fbc
   * RHBZ: 1779036
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
 - Aborting a blockdev backup transaction.
Danilo C. L. de Paula fda7fbc
   * RHBZ: 1782111
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
For each one of them, a VM with a number of disks running in an
Danilo C. L. de Paula fda7fbc
IOThread AioContext is used.
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
Signed-off-by: Sergio Lopez <slp@redhat.com>
Danilo C. L. de Paula fda7fbc
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Danilo C. L. de Paula fda7fbc
(cherry picked from commit 9b8c59e7610b9c5315ef093d801843dbe8debfac)
Danilo C. L. de Paula fda7fbc
Signed-off-by: Sergio Lopez <slp@redhat.com>
Danilo C. L. de Paula fda7fbc
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Danilo C. L. de Paula fda7fbc
---
Danilo C. L. de Paula fda7fbc
 tests/qemu-iotests/281     | 247 +++++++++++++++++++++++++++++++++++++++++++++
Danilo C. L. de Paula fda7fbc
 tests/qemu-iotests/281.out |   5 +
Danilo C. L. de Paula fda7fbc
 tests/qemu-iotests/group   |   1 +
Danilo C. L. de Paula fda7fbc
 3 files changed, 253 insertions(+)
Danilo C. L. de Paula fda7fbc
 create mode 100755 tests/qemu-iotests/281
Danilo C. L. de Paula fda7fbc
 create mode 100644 tests/qemu-iotests/281.out
Danilo C. L. de Paula fda7fbc
Danilo C. L. de Paula fda7fbc
diff --git a/tests/qemu-iotests/281 b/tests/qemu-iotests/281
Danilo C. L. de Paula fda7fbc
new file mode 100755
Danilo C. L. de Paula fda7fbc
index 0000000..269d583
Danilo C. L. de Paula fda7fbc
--- /dev/null
Danilo C. L. de Paula fda7fbc
+++ b/tests/qemu-iotests/281
Danilo C. L. de Paula fda7fbc
@@ -0,0 +1,247 @@
Danilo C. L. de Paula fda7fbc
+#!/usr/bin/env python
Danilo C. L. de Paula fda7fbc
+#
Danilo C. L. de Paula fda7fbc
+# Test cases for blockdev + IOThread interactions
Danilo C. L. de Paula fda7fbc
+#
Danilo C. L. de Paula fda7fbc
+# Copyright (C) 2019 Red Hat, Inc.
Danilo C. L. de Paula fda7fbc
+#
Danilo C. L. de Paula fda7fbc
+# This program is free software; you can redistribute it and/or modify
Danilo C. L. de Paula fda7fbc
+# it under the terms of the GNU General Public License as published by
Danilo C. L. de Paula fda7fbc
+# the Free Software Foundation; either version 2 of the License, or
Danilo C. L. de Paula fda7fbc
+# (at your option) any later version.
Danilo C. L. de Paula fda7fbc
+#
Danilo C. L. de Paula fda7fbc
+# This program is distributed in the hope that it will be useful,
Danilo C. L. de Paula fda7fbc
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
Danilo C. L. de Paula fda7fbc
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Danilo C. L. de Paula fda7fbc
+# GNU General Public License for more details.
Danilo C. L. de Paula fda7fbc
+#
Danilo C. L. de Paula fda7fbc
+# You should have received a copy of the GNU General Public License
Danilo C. L. de Paula fda7fbc
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Danilo C. L. de Paula fda7fbc
+#
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+import os
Danilo C. L. de Paula fda7fbc
+import iotests
Danilo C. L. de Paula fda7fbc
+from iotests import qemu_img
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+image_len = 64 * 1024 * 1024
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+# Test for RHBZ#1782175
Danilo C. L. de Paula fda7fbc
+class TestDirtyBitmapIOThread(iotests.QMPTestCase):
Danilo C. L. de Paula fda7fbc
+    drive0_img = os.path.join(iotests.test_dir, 'drive0.img')
Danilo C. L. de Paula fda7fbc
+    images = { 'drive0': drive0_img }
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def setUp(self):
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            qemu_img('create', '-f', iotests.imgfmt,
Danilo C. L. de Paula fda7fbc
+                     self.images[name], str(image_len))
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.vm = iotests.VM()
Danilo C. L. de Paula fda7fbc
+        self.vm.add_object('iothread,id=iothread0')
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            self.vm.add_blockdev('driver=file,filename=%s,node-name=file_%s'
Danilo C. L. de Paula fda7fbc
+                                 % (self.images[name], name))
Danilo C. L. de Paula fda7fbc
+            self.vm.add_blockdev('driver=qcow2,file=file_%s,node-name=%s'
Danilo C. L. de Paula fda7fbc
+                                 % (name, name))
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.vm.launch()
Danilo C. L. de Paula fda7fbc
+        self.vm.qmp('x-blockdev-set-iothread',
Danilo C. L. de Paula fda7fbc
+                    node_name='drive0', iothread='iothread0',
Danilo C. L. de Paula fda7fbc
+                    force=True)
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def tearDown(self):
Danilo C. L. de Paula fda7fbc
+        self.vm.shutdown()
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            os.remove(self.images[name])
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def test_add_dirty_bitmap(self):
Danilo C. L. de Paula fda7fbc
+        result = self.vm.qmp(
Danilo C. L. de Paula fda7fbc
+            'block-dirty-bitmap-add',
Danilo C. L. de Paula fda7fbc
+            node='drive0',
Danilo C. L. de Paula fda7fbc
+            name='bitmap1',
Danilo C. L. de Paula fda7fbc
+            persistent=True,
Danilo C. L. de Paula fda7fbc
+        )
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.assert_qmp(result, 'return', {})
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+# Test for RHBZ#1746217 & RHBZ#1773517
Danilo C. L. de Paula fda7fbc
+class TestNBDMirrorIOThread(iotests.QMPTestCase):
Danilo C. L. de Paula fda7fbc
+    nbd_sock = os.path.join(iotests.sock_dir, 'nbd.sock')
Danilo C. L. de Paula fda7fbc
+    drive0_img = os.path.join(iotests.test_dir, 'drive0.img')
Danilo C. L. de Paula fda7fbc
+    mirror_img = os.path.join(iotests.test_dir, 'mirror.img')
Danilo C. L. de Paula fda7fbc
+    images = { 'drive0': drive0_img, 'mirror': mirror_img }
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def setUp(self):
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            qemu_img('create', '-f', iotests.imgfmt,
Danilo C. L. de Paula fda7fbc
+                     self.images[name], str(image_len))
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.vm_src = iotests.VM(path_suffix='src')
Danilo C. L. de Paula fda7fbc
+        self.vm_src.add_object('iothread,id=iothread0')
Danilo C. L. de Paula fda7fbc
+        self.vm_src.add_blockdev('driver=file,filename=%s,node-name=file0'
Danilo C. L. de Paula fda7fbc
+                          % (self.drive0_img))
Danilo C. L. de Paula fda7fbc
+        self.vm_src.add_blockdev('driver=qcow2,file=file0,node-name=drive0')
Danilo C. L. de Paula fda7fbc
+        self.vm_src.launch()
Danilo C. L. de Paula fda7fbc
+        self.vm_src.qmp('x-blockdev-set-iothread',
Danilo C. L. de Paula fda7fbc
+                        node_name='drive0', iothread='iothread0',
Danilo C. L. de Paula fda7fbc
+                        force=True)
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.vm_tgt = iotests.VM(path_suffix='tgt')
Danilo C. L. de Paula fda7fbc
+        self.vm_tgt.add_object('iothread,id=iothread0')
Danilo C. L. de Paula fda7fbc
+        self.vm_tgt.add_blockdev('driver=file,filename=%s,node-name=file0'
Danilo C. L. de Paula fda7fbc
+                          % (self.mirror_img))
Danilo C. L. de Paula fda7fbc
+        self.vm_tgt.add_blockdev('driver=qcow2,file=file0,node-name=drive0')
Danilo C. L. de Paula fda7fbc
+        self.vm_tgt.launch()
Danilo C. L. de Paula fda7fbc
+        self.vm_tgt.qmp('x-blockdev-set-iothread',
Danilo C. L. de Paula fda7fbc
+                        node_name='drive0', iothread='iothread0',
Danilo C. L. de Paula fda7fbc
+                        force=True)
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def tearDown(self):
Danilo C. L. de Paula fda7fbc
+        self.vm_src.shutdown()
Danilo C. L. de Paula fda7fbc
+        self.vm_tgt.shutdown()
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            os.remove(self.images[name])
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def test_nbd_mirror(self):
Danilo C. L. de Paula fda7fbc
+        result = self.vm_tgt.qmp(
Danilo C. L. de Paula fda7fbc
+            'nbd-server-start',
Danilo C. L. de Paula fda7fbc
+            addr={
Danilo C. L. de Paula fda7fbc
+                'type': 'unix',
Danilo C. L. de Paula fda7fbc
+                'data': { 'path': self.nbd_sock }
Danilo C. L. de Paula fda7fbc
+            }
Danilo C. L. de Paula fda7fbc
+        )
Danilo C. L. de Paula fda7fbc
+        self.assert_qmp(result, 'return', {})
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        result = self.vm_tgt.qmp(
Danilo C. L. de Paula fda7fbc
+            'nbd-server-add',
Danilo C. L. de Paula fda7fbc
+            device='drive0',
Danilo C. L. de Paula fda7fbc
+            writable=True
Danilo C. L. de Paula fda7fbc
+        )
Danilo C. L. de Paula fda7fbc
+        self.assert_qmp(result, 'return', {})
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        result = self.vm_src.qmp(
Danilo C. L. de Paula fda7fbc
+            'drive-mirror',
Danilo C. L. de Paula fda7fbc
+            device='drive0',
Danilo C. L. de Paula fda7fbc
+            target='nbd+unix:///drive0?socket=' + self.nbd_sock,
Danilo C. L. de Paula fda7fbc
+            sync='full',
Danilo C. L. de Paula fda7fbc
+            mode='existing',
Danilo C. L. de Paula fda7fbc
+            speed=64*1024*1024,
Danilo C. L. de Paula fda7fbc
+            job_id='j1'
Danilo C. L. de Paula fda7fbc
+        )
Danilo C. L. de Paula fda7fbc
+        self.assert_qmp(result, 'return', {})
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.vm_src.event_wait(name="BLOCK_JOB_READY")
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+# Test for RHBZ#1779036
Danilo C. L. de Paula fda7fbc
+class TestExternalSnapshotAbort(iotests.QMPTestCase):
Danilo C. L. de Paula fda7fbc
+    drive0_img = os.path.join(iotests.test_dir, 'drive0.img')
Danilo C. L. de Paula fda7fbc
+    snapshot_img = os.path.join(iotests.test_dir, 'snapshot.img')
Danilo C. L. de Paula fda7fbc
+    images = { 'drive0': drive0_img, 'snapshot': snapshot_img }
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def setUp(self):
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            qemu_img('create', '-f', iotests.imgfmt,
Danilo C. L. de Paula fda7fbc
+                     self.images[name], str(image_len))
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.vm = iotests.VM()
Danilo C. L. de Paula fda7fbc
+        self.vm.add_object('iothread,id=iothread0')
Danilo C. L. de Paula fda7fbc
+        self.vm.add_blockdev('driver=file,filename=%s,node-name=file0'
Danilo C. L. de Paula fda7fbc
+                          % (self.drive0_img))
Danilo C. L. de Paula fda7fbc
+        self.vm.add_blockdev('driver=qcow2,file=file0,node-name=drive0')
Danilo C. L. de Paula fda7fbc
+        self.vm.launch()
Danilo C. L. de Paula fda7fbc
+        self.vm.qmp('x-blockdev-set-iothread',
Danilo C. L. de Paula fda7fbc
+                    node_name='drive0', iothread='iothread0',
Danilo C. L. de Paula fda7fbc
+                    force=True)
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def tearDown(self):
Danilo C. L. de Paula fda7fbc
+        self.vm.shutdown()
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            os.remove(self.images[name])
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def test_external_snapshot_abort(self):
Danilo C. L. de Paula fda7fbc
+        # Use a two actions transaction with a bogus values on the second
Danilo C. L. de Paula fda7fbc
+        # one to trigger an abort of the transaction.
Danilo C. L. de Paula fda7fbc
+        result = self.vm.qmp('transaction', actions=[
Danilo C. L. de Paula fda7fbc
+            {
Danilo C. L. de Paula fda7fbc
+                'type': 'blockdev-snapshot-sync',
Danilo C. L. de Paula fda7fbc
+                'data': { 'node-name': 'drive0',
Danilo C. L. de Paula fda7fbc
+                          'snapshot-file': self.snapshot_img,
Danilo C. L. de Paula fda7fbc
+                          'snapshot-node-name': 'snap1',
Danilo C. L. de Paula fda7fbc
+                          'mode': 'absolute-paths',
Danilo C. L. de Paula fda7fbc
+                          'format': 'qcow2' }
Danilo C. L. de Paula fda7fbc
+            },
Danilo C. L. de Paula fda7fbc
+            {
Danilo C. L. de Paula fda7fbc
+                'type': 'blockdev-snapshot-sync',
Danilo C. L. de Paula fda7fbc
+                'data': { 'node-name': 'drive0',
Danilo C. L. de Paula fda7fbc
+                          'snapshot-file': '/fakesnapshot',
Danilo C. L. de Paula fda7fbc
+                          'snapshot-node-name': 'snap2',
Danilo C. L. de Paula fda7fbc
+                          'mode': 'absolute-paths',
Danilo C. L. de Paula fda7fbc
+                          'format': 'qcow2' }
Danilo C. L. de Paula fda7fbc
+            },
Danilo C. L. de Paula fda7fbc
+        ])
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        # Crashes on failure, we expect this error.
Danilo C. L. de Paula fda7fbc
+        self.assert_qmp(result, 'error/class', 'GenericError')
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+# Test for RHBZ#1782111
Danilo C. L. de Paula fda7fbc
+class TestBlockdevBackupAbort(iotests.QMPTestCase):
Danilo C. L. de Paula fda7fbc
+    drive0_img = os.path.join(iotests.test_dir, 'drive0.img')
Danilo C. L. de Paula fda7fbc
+    drive1_img = os.path.join(iotests.test_dir, 'drive1.img')
Danilo C. L. de Paula fda7fbc
+    snap0_img = os.path.join(iotests.test_dir, 'snap0.img')
Danilo C. L. de Paula fda7fbc
+    snap1_img = os.path.join(iotests.test_dir, 'snap1.img')
Danilo C. L. de Paula fda7fbc
+    images = { 'drive0': drive0_img,
Danilo C. L. de Paula fda7fbc
+               'drive1': drive1_img,
Danilo C. L. de Paula fda7fbc
+               'snap0': snap0_img,
Danilo C. L. de Paula fda7fbc
+               'snap1': snap1_img }
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def setUp(self):
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            qemu_img('create', '-f', iotests.imgfmt,
Danilo C. L. de Paula fda7fbc
+                     self.images[name], str(image_len))
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.vm = iotests.VM()
Danilo C. L. de Paula fda7fbc
+        self.vm.add_object('iothread,id=iothread0')
Danilo C. L. de Paula fda7fbc
+        self.vm.add_device('virtio-scsi,iothread=iothread0')
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            self.vm.add_blockdev('driver=file,filename=%s,node-name=file_%s'
Danilo C. L. de Paula fda7fbc
+                                 % (self.images[name], name))
Danilo C. L. de Paula fda7fbc
+            self.vm.add_blockdev('driver=qcow2,file=file_%s,node-name=%s'
Danilo C. L. de Paula fda7fbc
+                                 % (name, name))
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        self.vm.add_device('scsi-hd,drive=drive0')
Danilo C. L. de Paula fda7fbc
+        self.vm.add_device('scsi-hd,drive=drive1')
Danilo C. L. de Paula fda7fbc
+        self.vm.launch()
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def tearDown(self):
Danilo C. L. de Paula fda7fbc
+        self.vm.shutdown()
Danilo C. L. de Paula fda7fbc
+        for name in self.images:
Danilo C. L. de Paula fda7fbc
+            os.remove(self.images[name])
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+    def test_blockdev_backup_abort(self):
Danilo C. L. de Paula fda7fbc
+        # Use a two actions transaction with a bogus values on the second
Danilo C. L. de Paula fda7fbc
+        # one to trigger an abort of the transaction.
Danilo C. L. de Paula fda7fbc
+        result = self.vm.qmp('transaction', actions=[
Danilo C. L. de Paula fda7fbc
+            {
Danilo C. L. de Paula fda7fbc
+                'type': 'blockdev-backup',
Danilo C. L. de Paula fda7fbc
+                'data': { 'device': 'drive0',
Danilo C. L. de Paula fda7fbc
+                          'target': 'snap0',
Danilo C. L. de Paula fda7fbc
+                          'sync': 'full',
Danilo C. L. de Paula fda7fbc
+                          'job-id': 'j1' }
Danilo C. L. de Paula fda7fbc
+            },
Danilo C. L. de Paula fda7fbc
+            {
Danilo C. L. de Paula fda7fbc
+                'type': 'blockdev-backup',
Danilo C. L. de Paula fda7fbc
+                'data': { 'device': 'drive1',
Danilo C. L. de Paula fda7fbc
+                          'target': 'snap1',
Danilo C. L. de Paula fda7fbc
+                          'sync': 'full' }
Danilo C. L. de Paula fda7fbc
+            },
Danilo C. L. de Paula fda7fbc
+        ])
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+        # Hangs on failure, we expect this error.
Danilo C. L. de Paula fda7fbc
+        self.assert_qmp(result, 'error/class', 'GenericError')
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+if __name__ == '__main__':
Danilo C. L. de Paula fda7fbc
+    iotests.main(supported_fmts=['qcow2'],
Danilo C. L. de Paula fda7fbc
+                 supported_protocols=['file'])
Danilo C. L. de Paula fda7fbc
diff --git a/tests/qemu-iotests/281.out b/tests/qemu-iotests/281.out
Danilo C. L. de Paula fda7fbc
new file mode 100644
Danilo C. L. de Paula fda7fbc
index 0000000..89968f3
Danilo C. L. de Paula fda7fbc
--- /dev/null
Danilo C. L. de Paula fda7fbc
+++ b/tests/qemu-iotests/281.out
Danilo C. L. de Paula fda7fbc
@@ -0,0 +1,5 @@
Danilo C. L. de Paula fda7fbc
+....
Danilo C. L. de Paula fda7fbc
+----------------------------------------------------------------------
Danilo C. L. de Paula fda7fbc
+Ran 4 tests
Danilo C. L. de Paula fda7fbc
+
Danilo C. L. de Paula fda7fbc
+OK
Danilo C. L. de Paula fda7fbc
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
Danilo C. L. de Paula fda7fbc
index 01301cd..c0e8197 100644
Danilo C. L. de Paula fda7fbc
--- a/tests/qemu-iotests/group
Danilo C. L. de Paula fda7fbc
+++ b/tests/qemu-iotests/group
Danilo C. L. de Paula fda7fbc
@@ -287,3 +287,4 @@
Danilo C. L. de Paula fda7fbc
 273 backing quick
Danilo C. L. de Paula fda7fbc
 277 rw quick
Danilo C. L. de Paula fda7fbc
 280 rw migration quick
Danilo C. L. de Paula fda7fbc
+281 rw quick
Danilo C. L. de Paula fda7fbc
-- 
Danilo C. L. de Paula fda7fbc
1.8.3.1
Danilo C. L. de Paula fda7fbc