[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 5/5] qemu-iotests: add block-stream speed val
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 5/5] qemu-iotests: add block-stream speed value test case |
Date: |
Wed, 25 Apr 2012 08:21:48 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
On 04/25/2012 07:17 AM, Stefan Hajnoczi wrote:
> Add tests to exercise the InvalidParameter 'speed' error code path, as
> well as the regular success case for setting the speed. The
> block-stream '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.
>
> It turns out that cancelling a block job is a common operation in these
> test cases, let's extract a cancel_and_wait() function instead of
> duplicating the QMP commands.
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> Acked-by: Kevin Wolf <address@hidden>
> ---
> +
> + def test_set_speed_invalid(self):
> self.assert_no_active_streams()
>
> + result = self.vm.qmp('block-stream', device='drive0', speed=2 * 1024
> * 1024)
> + self.assert_qmp(result, {})
> +
> + self.assert_no_active_streams()
> +
> + result = self.vm.qmp('block-stream', device='drive0')
> + self.assert_qmp(result, 'return', {})
> +
> + result = self.vm.qmp('block-job-set-speed', device='drive0',
> speed=-1)
> + self.assert_qmp(result, 'error/class', 'InvalidParameter')
> + self.assert_qmp(result, 'error/data/name', 'speed')
> +
> + self.cancel_and_wait()
> +
> + def test_set_speed_invalid(self):
Duplicate def test_set_speed_invalid. Bad copy-and-paste issue? The
first one looks bogus, the second one looks correct.
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v3 0/5] block: add optional 'speed' parameter to block-stream, Stefan Hajnoczi, 2012/04/25
- [Qemu-devel] [PATCH v3 2/5] block: use Error mechanism instead of -errno for block_job_set_speed(), Stefan Hajnoczi, 2012/04/25
- [Qemu-devel] [PATCH v3 3/5] block: change block-job-set-speed argument from 'value' to 'speed', Stefan Hajnoczi, 2012/04/25
- [Qemu-devel] [PATCH v3 1/5] block: use Error mechanism instead of -errno for block_job_create(), Stefan Hajnoczi, 2012/04/25
- [Qemu-devel] [PATCH v3 5/5] qemu-iotests: add block-stream speed value test case, Stefan Hajnoczi, 2012/04/25
- Re: [Qemu-devel] [PATCH v3 5/5] qemu-iotests: add block-stream speed value test case,
Eric Blake <=
- [Qemu-devel] [PATCH v3 4/5] block: add 'speed' optional parameter to block-stream, Stefan Hajnoczi, 2012/04/25