[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/4] qemu-iotests: add block-stream with invalid spe
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 4/4] qemu-iotests: add block-stream with invalid speed value test |
Date: |
Mon, 23 Apr 2012 16:39:49 +0100 |
Add a test to exercise the BlockJobSpeedInvalid error code path in the
block-stream command. The 'speed' parameter allows the speed limit of
the job to be applied immediately when the job starts instead of issuing
a separate block-job-set-speed command later. If the parameter has an
invalid value we expect to get an error and the job is not created.
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tests/qemu-iotests/030 | 9 +++++++++
tests/qemu-iotests/030.out | 4 ++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 978fd82..7f31841 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -147,5 +147,14 @@ class TestSetSpeed(ImageStreamingTestCase):
self.assert_no_active_streams()
+ def test_set_speed_invalid(self):
+ self.assert_no_active_streams()
+
+ result = self.vm.qmp('block-stream', device='drive0', speed=-1)
+ self.assert_qmp(result, 'error/class', 'BlockJobSpeedInvalid')
+ self.assert_qmp(result, 'error/data/value', -1)
+
+ self.assert_no_active_streams()
+
if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2', 'qed'])
diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out
index 8d7e996..89968f3 100644
--- a/tests/qemu-iotests/030.out
+++ b/tests/qemu-iotests/030.out
@@ -1,5 +1,5 @@
-...
+....
----------------------------------------------------------------------
-Ran 3 tests
+Ran 4 tests
OK
--
1.7.9.5
Re: [Qemu-devel] [PATCH 0/4] block: add optional 'speed' parameter to block-stream, Eric Blake, 2012/04/23