aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-08-24 11:38:54 +0300
committerHanna Reitz <hreitz@redhat.com>2021-09-01 14:38:08 +0200
commit32f84b40ab54188852c8ea0dd9f70bf316a2f226 (patch)
tree772c6a2c730a69e3dc4d710d665dfaa3fbd8d574
parent66b63809fa71c6880f9ec4fa3d32e35c79699ae6 (diff)
downloadqemu-32f84b40ab54188852c8ea0dd9f70bf316a2f226.zip
qemu-32f84b40ab54188852c8ea0dd9f70bf316a2f226.tar.gz
qemu-32f84b40ab54188852c8ea0dd9f70bf316a2f226.tar.bz2
iotests/image-fleecing: prepare for adding new test-case
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> Message-Id: <20210824083856.17408-33-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
-rwxr-xr-xtests/qemu-iotests/tests/image-fleecing19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/tests/image-fleecing
index ec4ef5f..e210c00 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()