[pve-devel] [PATCH v8 qemu-server 05/11] test: qemu img convert: add test cases for snapshots

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Apr 3 14:31:03 CEST 2025


From: Fiona Ebner <f.ebner at proxmox.com>

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
No changes to v7.

 test/run_qemu_img_convert_tests.pl | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/test/run_qemu_img_convert_tests.pl b/test/run_qemu_img_convert_tests.pl
index 20ff387..29c188d 100755
--- a/test/run_qemu_img_convert_tests.pl
+++ b/test/run_qemu_img_convert_tests.pl
@@ -194,6 +194,24 @@ my $tests = [
 	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0.raw",
 	]
     },
+    {
+	name => "lvmsnapshot",
+	parameters => [ "local-lvm:vm-$vmid-disk-0", "local:$vmid/vm-$vmid-disk-0.raw", 1024*10, 'foo', 0, undef ],
+	expected => [
+	    "/usr/bin/qemu-img", "convert", "-p", "-n", "-f", "raw", "-O", "raw",
+	    "/dev/pve/snap_vm-$vmid-disk-0_foo",
+	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0.raw",
+	]
+    },
+    {
+	name => "qcow2snapshot",
+	parameters => [ "local:$vmid/vm-$vmid-disk-0.qcow2", "local:$vmid/vm-$vmid-disk-0.raw", 1024*10, 'snap', 0, undef ],
+	expected => [
+	    "/usr/bin/qemu-img", "convert", "-p", "-n", "-l", "snapshot.name=snap", "-f", "qcow2", "-O", "raw",
+	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0.qcow2",
+	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0.raw",
+	]
+    },
 ];
 
 my $command;
-- 
2.39.5





More information about the pve-devel mailing list