[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 32/33] iotests/image-fleecing: prepare for adding new test-cas
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v6 32/33] iotests/image-fleecing: prepare for adding new test-case |
Date: |
Wed, 21 Jul 2021 13:05:54 +0300 |
We are going to add a test-case with some behavior modifications. So,
let's prepare a function to be reused.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/tests/image-fleecing | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/tests/image-fleecing
b/tests/qemu-iotests/tests/image-fleecing
index ec4ef5f3f6..e210c00d28 100755
--- a/tests/qemu-iotests/tests/image-fleecing
+++ b/tests/qemu-iotests/tests/image-fleecing
@@ -48,12 +48,7 @@ remainder = [('0xd5', '0x108000', '32k'), # Right-end of
partial-left [1]
('0xdc', '32M', '32k'), # Left-end of partial-right [2]
('0xcd', '0x3ff0000', '64k')] # patterns[3]
-with iotests.FilePath('base.img') as base_img_path, \
- iotests.FilePath('fleece.img') as fleece_img_path, \
- iotests.FilePath('nbd.sock',
- base_dir=iotests.sock_dir) as nbd_sock_path, \
- iotests.VM() as vm:
-
+def do_test(base_img_path, fleece_img_path, nbd_sock_path, vm):
log('--- Setting up images ---')
log('')
@@ -163,3 +158,15 @@ with iotests.FilePath('base.img') as base_img_path, \
log('')
log('Done')
+
+
+def test():
+ with iotests.FilePath('base.img') as base_img_path, \
+ iotests.FilePath('fleece.img') as fleece_img_path, \
+ iotests.FilePath('nbd.sock',
+ base_dir=iotests.sock_dir) as nbd_sock_path, \
+ iotests.VM() as vm:
+ do_test(base_img_path, fleece_img_path, nbd_sock_path, vm)
+
+
+test()
--
2.29.2
- [PATCH v6 15/33] block/copy-before-write: cbw_init(): rename variables, (continued)
- [PATCH v6 15/33] block/copy-before-write: cbw_init(): rename variables, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 19/33] block/copy-before-write: initialize block-copy bitmap, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 20/33] block/block-copy: make setting progress optional, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 23/33] python/qemu/machine.py: refactor _qemu_args(), Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 21/33] block/copy-before-write: make public block driver, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 26/33] iotests/222: fix pylint and mypy complains, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 22/33] qapi: publish copy-before-write filter, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 27/33] iotests/222: constantly use single quotes for strings, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 24/33] python/qemu/machine: QEMUMachine: improve qmp() method, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 25/33] iotests.py: VM: add own __enter__ method, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 32/33] iotests/image-fleecing: prepare for adding new test-case,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v6 31/33] iotests/image-fleecing: rename tgt_node, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 30/33] iotests/image-fleecing: proper source device, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 29/33] iotests.py: hmp_qemu_io: support qdev, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 28/33] iotests: move 222 to tests/image-fleecing, Vladimir Sementsov-Ogievskiy, 2021/07/21
- [PATCH v6 33/33] iotests/image-fleecing: add test-case for copy-before-write filter, Vladimir Sementsov-Ogievskiy, 2021/07/21