public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Subject: [pve-devel] [PATCH qemu-server] tests: qemu_img_convert: add rbd and btrfs snapshots convert test
Date: Tue, 27 May 2025 15:16:12 +0200	[thread overview]
Message-ID: <mailman.54.1748351790.395.pve-devel@lists.proxmox.com> (raw)

[-- Attachment #1: Type: message/rfc822, Size: 5491 bytes --]

From: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server] tests: qemu_img_convert: add rbd and btrfs snapshots convert test
Date: Tue, 27 May 2025 15:16:12 +0200
Message-ID: <20250527131612.933091-1-alexandre.derumier@groupe-cyllene.com>

Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
---
 test/run_qemu_img_convert_tests.pl | 76 ++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/test/run_qemu_img_convert_tests.pl b/test/run_qemu_img_convert_tests.pl
index 652e61f2..03756333 100755
--- a/test/run_qemu_img_convert_tests.pl
+++ b/test/run_qemu_img_convert_tests.pl
@@ -21,6 +21,26 @@ my $storage_config = {
 	    type => "dir",
 	    shared => 0,
 	},
+	"local-btrfs" => {
+	    content => {
+		images => 1,
+	    },
+	    path => "/var/lib/vz",
+	    type => "btrfs",
+	    shared => 0,
+	},
+	"krbd-store" => {
+	    monhost => "127.0.0.42,127.0.0.21,::1",
+	    fsid => 'fc4181a6-56eb-4f68-b452-8ba1f381ca2a',
+	    content => {
+		images => 1
+	    },
+	    type => "rbd",
+	    krbd => 1,
+	    pool => "cpool",
+	    username => "admin",
+	    shared => 1
+	},
 	"rbd-store" => {
 	    monhost => "127.0.0.42,127.0.0.21,::1",
 	    fsid => 'fc4181a6-56eb-4f68-b452-8ba1f381ca2a',
@@ -204,6 +224,62 @@ my $tests = [
 	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0.raw",
 	]
     },
+    {
+	name => "krbdsnapshot",
+	parameters => [
+	    "krbd-store:vm-$vmid-disk-0",
+	    "local:$vmid/vm-$vmid-disk-0.raw",
+	    1024*10,
+	    { snapname => 'foo'},
+	],
+	expected => [
+	    "/usr/bin/qemu-img", "convert", "-p", "-n", "-f", "raw", "-O", "raw",
+	    "/dev/rbd-pve/fc4181a6-56eb-4f68-b452-8ba1f381ca2a/cpool/vm-$vmid-disk-0\@foo",
+	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0.raw",
+	]
+    },
+    {
+	name => "rbdsnapshot",
+	parameters => [
+	    "rbd-store:vm-$vmid-disk-0",
+	    "local:$vmid/vm-$vmid-disk-0.raw",
+	    1024*10,
+	    { snapname => 'foo'},
+	],
+	expected => [
+	    "/usr/bin/qemu-img", "convert", "-p", "-n", "-f", "raw", "-O", "raw",
+	    "rbd:cpool/vm-$vmid-disk-0\@foo:mon_host=127.0.0.42;127.0.0.21;[\\:\\:1]:auth_supported=none",
+	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0.raw",
+	]
+    },
+    {
+	name => "btrfs_raw_snapshots",
+	parameters => [
+	    "local-btrfs:$vmid/vm-$vmid-disk-0.raw",
+	    "local:$vmid/vm-$vmid-disk-0.raw",
+	    1024*10,
+	    { snapname => 'foo'},
+	],
+	expected => [
+	    "/usr/bin/qemu-img", "convert", "-p", "-n", "-f", "raw", "-O", "raw",
+	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0\@foo/disk.raw",
+	    "/var/lib/vz/images/$vmid/vm-$vmid-disk-0.raw",
+	]
+    },
+    {
+	name => "btrfs_qcow2_snapshots",
+	parameters => [
+	    "local-btrfs:$vmid/vm-$vmid-disk-0.qcow2",
+	    "local:$vmid/vm-$vmid-disk-0.raw",
+	    1024*10,
+	    { snapname => 'snap'},
+	],
+	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",
+	]
+    },
     {
 	name => "lvmsnapshot",
 	parameters => [
-- 
2.39.5



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

             reply	other threads:[~2025-05-27 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 13:16 Alexandre Derumier via pve-devel [this message]
2025-05-28 10:30 ` [pve-devel] applied: " Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.54.1748351790.395.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=alexandre.derumier@groupe-cyllene.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal