diff mbox

[v9,11/11] qemu-iotests: test non-overlapping block-stream operations

Message ID edd9a53b9259702cfb48dd150680865dde71f69b.1459776815.git.berto@igalia.com
State New
Headers show

Commit Message

Alberto Garcia April 4, 2016, 1:44 p.m. UTC
Even if there are no common nodes involved, we currently don't support
several operations at the same time in the same backing chain.

Signed-off-by: Alberto Garcia <berto@igalia.com>
---
 tests/qemu-iotests/030     | 21 +++++++++++++++++++++
 tests/qemu-iotests/030.out |  4 ++--
 2 files changed, 23 insertions(+), 2 deletions(-)

Comments

Max Reitz April 27, 2016, 1:50 p.m. UTC | #1
On 04.04.2016 15:44, Alberto Garcia wrote:
> Even if there are no common nodes involved, we currently don't support
> several operations at the same time in the same backing chain.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  tests/qemu-iotests/030     | 21 +++++++++++++++++++++
>  tests/qemu-iotests/030.out |  4 ++--
>  2 files changed, 23 insertions(+), 2 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>
diff mbox

Patch

diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 6348872..144f174 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -205,6 +205,27 @@  class TestMultipleOps(iotests.QMPTestCase):
 
         self.vm.shutdown()
 
+    # We currently don't support non-overlapping jobs if they are in
+    # the same chain. If we do it in the future this test will need to
+    # be updated.
+    def test_non_overlapping(self):
+        self.assert_no_active_block_jobs()
+
+        # Set a speed limit to make sure that this job blocks the rest
+        result = self.vm.qmp('block-stream', device='node4', base=self.imgs[0], speed=32768)
+        self.assert_qmp(result, 'return', {})
+
+        result = self.vm.qmp('block-stream', device='drive0', top=self.imgs[5])
+        self.assert_qmp(result, 'error/class', 'GenericError')
+
+        result = self.vm.qmp('block-commit', device='drive0', base=self.imgs[5])
+        self.assert_qmp(result, 'error/class', 'GenericError')
+
+        self.wait_until_completed(drive='node4')
+        self.assert_no_active_block_jobs()
+
+        self.vm.shutdown()
+
 class TestSmallerBackingFile(iotests.QMPTestCase):
     backing_len = 1 * 1024 * 1024 # MB
     image_len = 2 * backing_len
diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out
index b6f2576..52d796e 100644
--- a/tests/qemu-iotests/030.out
+++ b/tests/qemu-iotests/030.out
@@ -1,5 +1,5 @@ 
-................
+.................
 ----------------------------------------------------------------------
-Ran 16 tests
+Ran 17 tests
 
 OK