From 1ba8fed460ea7ccb1a0dc2f93fd98806384f9d13 Mon Sep 17 00:00:00 2001 From: Zhenchao Liu Date: Thu, 14 Nov 2024 14:38:51 +0800 Subject: [PATCH] multihost: Testing image Signed-off-by: Zhenchao Liu --- qemu/tests/cfg/multihost.cfg | 14 ++++++++++++++ qemu/tests/multihost.py | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 qemu/tests/cfg/multihost.cfg create mode 100644 qemu/tests/multihost.py diff --git a/qemu/tests/cfg/multihost.cfg b/qemu/tests/cfg/multihost.cfg new file mode 100644 index 0000000000..4e366023cc --- /dev/null +++ b/qemu/tests/cfg/multihost.cfg @@ -0,0 +1,14 @@ +- multihost: + type = multihost + vms = '' + start_vm = no + kill_vm = no + nodes = node1 + multihost = yes + storage_type = nfs + force_create_image = yes + remove_image = yes + images = img1 img2 + qcow2: + image_cluster_size = 1M + preallocated = metadata diff --git a/qemu/tests/multihost.py b/qemu/tests/multihost.py new file mode 100644 index 0000000000..e94d2e4b6d --- /dev/null +++ b/qemu/tests/multihost.py @@ -0,0 +1,17 @@ +from virttest.vt_imgr import vt_imgr + + +def run(test, params, env): + images = dict() + for image_tag in params.objects("images"): + images[image_tag] = vt_imgr.query_image(image_tag) + + for image_id in images.values(): + cloned_image_id = vt_imgr.clone_image(image_id) + test.log.info( + "%s: %s", cloned_image_id, vt_imgr.get_image_info(cloned_image_id) + ) + vt_imgr.update_image(cloned_image_id, {"destroy": {}}) + vt_imgr.destroy_image_object(cloned_image_id) + vt_imgr.update_image(image_id, {"destroy": {}}) + vt_imgr.destroy_image_object(image_id)