[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/11] iotests/264: add backup-cancel test-case
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH 11/11] iotests/264: add backup-cancel test-case |
Date: |
Wed, 18 Nov 2020 21:04:33 +0300 |
Check that cancel doesn't wait for 10s of nbd reconnect timeout.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
tests/qemu-iotests/264 | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/tests/qemu-iotests/264 b/tests/qemu-iotests/264
index 3c6f29317f..b830078834 100755
--- a/tests/qemu-iotests/264
+++ b/tests/qemu-iotests/264
@@ -93,13 +93,7 @@ class TestNbdReconnect(iotests.QMPTestCase):
result = self.vm.qmp('blockdev-del', node_name='backup0')
self.assert_qmp(result, 'return', {})
- def test_mirror_cancel(self):
- # Mirror speed limit doesn't work well enough, it seems that mirror
- # will run many parallel requests anyway. MAX_IN_FLIGHT is 16 and
- # MAX_IO_BYTES is 1M in mirror.c, so let's use 20M disk.
- self.init_vm(20 * 1024 * 1024)
- self.start_job('blockdev-mirror')
-
+ def cancel_job(self):
result = self.vm.qmp('block-job-cancel', device='drive0')
self.assert_qmp(result, 'return', {})
@@ -108,6 +102,19 @@ class TestNbdReconnect(iotests.QMPTestCase):
delta_t = time.time() - start_t
self.assertTrue(delta_t < 2.0)
+ def test_mirror_cancel(self):
+ # Mirror speed limit doesn't work well enough, it seems that mirror
+ # will run many parallel requests anyway. MAX_IN_FLIGHT is 16 and
+ # MAX_IO_BYTES is 1M in mirror.c, so let's use 20M disk.
+ self.init_vm(20 * 1024 * 1024)
+ self.start_job('blockdev-mirror')
+ self.cancel_job()
+
+ def test_backup_cancel(self):
+ self.init_vm(5 * 1024 * 1024)
+ self.start_job('blockdev-backup')
+ self.cancel_job()
+
if __name__ == '__main__':
iotests.main(supported_fmts=['qcow2'])
--
2.21.3
- [PATCH 00/11] mirror: cancel nbd reconnect, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 01/11] block: add new BlockDriver handler: bdrv_cancel_in_flight, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 02/11] block/nbd: implement .bdrv_cancel_in_flight, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 03/11] block/raw-format: implement .bdrv_cancel_in_flight handler, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 04/11] job: add .cancel handler for the driver, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 05/11] block/mirror: implement .cancel job handler, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 06/11] iotests/264: fix style, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 07/11] iotests/264: move to python unittest, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 09/11] iotests/264: add mirror-cancel test-case, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 08/11] iotests.py: qemu_nbd_popen: remove pid file after use, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 11/11] iotests/264: add backup-cancel test-case,
Vladimir Sementsov-Ogievskiy <=
- [PATCH 10/11] block/backup: implement .cancel job handler, Vladimir Sementsov-Ogievskiy, 2020/11/18
- Re: [PATCH 00/11] mirror: cancel nbd reconnect, Eric Blake, 2020/11/18