[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/14] iotests/264: add backup-cancel test-case
From: |
Eric Blake |
Subject: |
[PULL 14/14] iotests/264: add backup-cancel test-case |
Date: |
Fri, 12 Feb 2021 14:16:19 -0600 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Check that cancel doesn't wait for 10s of nbd reconnect timeout.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210205163720.887197-11-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
tests/qemu-iotests/264 | 21 ++++++++++++++-------
tests/qemu-iotests/264.out | 4 ++--
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/tests/qemu-iotests/264 b/tests/qemu-iotests/264
index 347e53add51b..4f96825a22c2 100755
--- a/tests/qemu-iotests/264
+++ b/tests/qemu-iotests/264
@@ -94,20 +94,27 @@ class TestNbdReconnect(iotests.QMPTestCase):
result = self.vm.qmp('blockdev-del', node_name='backup0')
self.assert_qmp(result, 'return', {})
+ def cancel_job(self):
+ result = self.vm.qmp('block-job-cancel', device='drive0')
+ self.assert_qmp(result, 'return', {})
+
+ start_t = time.time()
+ self.vm.event_wait('BLOCK_JOB_CANCELLED')
+ 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()
- result = self.vm.qmp('block-job-cancel', device='drive0')
- self.assert_qmp(result, 'return', {})
-
- start_t = time.time()
- self.vm.event_wait('BLOCK_JOB_CANCELLED')
- delta_t = time.time() - start_t
- self.assertTrue(delta_t < 2.0)
+ def test_backup_cancel(self):
+ self.init_vm(5 * 1024 * 1024)
+ self.start_job('blockdev-backup')
+ self.cancel_job()
if __name__ == '__main__':
diff --git a/tests/qemu-iotests/264.out b/tests/qemu-iotests/264.out
index fbc63e62f885..8d7e99670093 100644
--- a/tests/qemu-iotests/264.out
+++ b/tests/qemu-iotests/264.out
@@ -1,5 +1,5 @@
-..
+...
----------------------------------------------------------------------
-Ran 2 tests
+Ran 3 tests
OK
--
2.30.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PULL 14/14] iotests/264: add backup-cancel test-case,
Eric Blake <=