public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ludwig <christian_ludwig@genua.de>
To: <pve-devel@lists.proxmox.com>
Subject: [PATCH qemu-server v4 14/20] test: custom firmware volumes in replication and migration
Date: Thu, 19 Nov 2026 15:14:26 +0100	[thread overview]
Message-ID: <4628620330daec3594be37d5f9a41f186acebbef.1795092172.git.christian_ludwig@genua.de> (raw)
In-Reply-To: <cover.1795092172.git.christian_ludwig@genua.de>

Test that custom firmware images are excluded from volume replication,
and that migration is refused for images on a local storage but works
for images on a shared storage.

Signed-off-by: Christian Ludwig <christian_ludwig@genua.de>
---
 src/test/run_qemu_migrate_tests.pl        | 62 +++++++++++++++++++++++
 src/test/test_get_replicatable_volumes.pl | 10 ++++
 2 files changed, 72 insertions(+)

diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl
index 598c1306..c79f4e07 100755
--- a/src/test/run_qemu_migrate_tests.pl
+++ b/src/test/run_qemu_migrate_tests.pl
@@ -78,6 +78,7 @@ my $storage_config = {
         "local-dir" => {
             content => {
                 images => 1,
+                'efi-firmware' => 1,
             },
             path => "/some/dir/",
             type => "dir",
@@ -89,6 +90,15 @@ my $storage_config = {
             path => "/some/other/dir/",
             type => "dir",
         },
+        "shared-dir" => {
+            content => {
+                images => 1,
+                'efi-firmware' => 1,
+            },
+            path => "/mnt/pve/shared-dir/",
+            type => "dir",
+            shared => 1,
+        },
         "zfs-alias-1" => {
             content => {
                 images => 1,
@@ -1377,6 +1387,58 @@ my $tests = [
             },
         },
     },
+    {
+        name => '105_local_firmware',
+        target => 'pve1',
+        vmid => 105,
+        vm_status => {
+            running => 0,
+        },
+        config_patch => {
+            bios => 'ovmf,firmware=local-dir:efi-firmware/custom.fd',
+        },
+        expected_calls => {},
+        expect_die => "bios: custom firmware image 'local-dir:efi-firmware/custom.fd'"
+            . " is on local storage - use a shared storage",
+        expected => {
+            source_volids => local_volids_for_vm(105),
+            target_volids => {},
+            vm_config => get_patched_config(
+                105,
+                {
+                    bios => 'ovmf,firmware=local-dir:efi-firmware/custom.fd',
+                },
+            ),
+            vm_status => {
+                running => 0,
+            },
+        },
+    },
+    {
+        name => '105_shared_firmware',
+        target => 'pve1',
+        vmid => 105,
+        vm_status => {
+            running => 0,
+        },
+        config_patch => {
+            bios => 'ovmf,firmware=shared-dir:efi-firmware/custom.fd',
+        },
+        expected_calls => $default_expected_calls_offline,
+        expected => {
+            source_volids => {},
+            target_volids => local_volids_for_vm(105),
+            vm_config => get_patched_config(
+                105,
+                {
+                    bios => 'ovmf,firmware=shared-dir:efi-firmware/custom.fd',
+                },
+            ),
+            vm_status => {
+                running => 0,
+            },
+        },
+    },
     {
         name => '149_running_missing_option_withlocaldisks',
         target => 'pve1',
diff --git a/src/test/test_get_replicatable_volumes.pl b/src/test/test_get_replicatable_volumes.pl
index d2f22667..0bafc9c7 100755
--- a/src/test/test_get_replicatable_volumes.pl
+++ b/src/test/test_get_replicatable_volumes.pl
@@ -23,6 +23,7 @@ my $storecfg = {
                 'backup' => 1,
                 'images' => 1,
                 'rootdir' => 1,
+                'efi-firmware' => 1,
             },
             path => "/var/lib/vz",
         },
@@ -160,5 +161,14 @@ $conf = PVE::QemuServer::parse_vm_config("/qemu-server/$vmid.conf", $rawconf);
 eval { $volumes = PVE::QemuConfig->get_replicatable_volumes($storecfg, $vmid, $conf, 0, 0); };
 is($@, "missing replicate feature on volume 'local:900/vm-900-disk-2.raw'\n", $test_name);
 
+$test_name = "custom firmware is shared, not owned by VM";
+$rawconf = <<__EOD__;
+bios: ovmf,firmware=local:efi-firmware/custom.fd
+__EOD__
+
+$conf = PVE::QemuServer::parse_vm_config("/qemu-server/$vmid.conf", $rawconf);
+$volumes = PVE::QemuConfig->get_replicatable_volumes($storecfg, $vmid, $conf, 0, 0);
+is_deeply($volumes, {}, $test_name);
+
 done_testing();
 exit(0);
-- 
2.34.1




  parent reply	other threads:[~2026-11-19 14:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 14:14 [PATCH v4 00/20] Support for custom EFI firmware Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 01/20] plugin: add efi-firmware content type Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 02/20] test: get_subdir: cover the " Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 03/20] plugins: allow the efi-firmware content type on file based storages Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 04/20] plugin: allow overriding the efi-firmware directory Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 05/20] plugin: support efi-firmware volumes in volume export and import Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 06/20] api: status: support efi-firmware in upload and download-url Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 07/20] test: volume access: cover efi-firmware volumes Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 08/20] test: list volumes: " Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-storage v4 09/20] test: cover efi-firmware volumes in parse_volname and path_to_volume_id Christian Ludwig
2026-11-19 14:14 ` [PATCH qemu-server v4 10/20] config: define bios schema as property-string Christian Ludwig
2026-11-19 14:14 ` [PATCH qemu-server v4 11/20] bios: add a custom firmware sub-property Christian Ludwig
2026-11-19 14:14 ` [PATCH qemu-server v4 12/20] api: check the custom firmware of the bios option Christian Ludwig
2026-11-19 14:14 ` [PATCH qemu-server v4 13/20] test: custom firmware in " Christian Ludwig
2026-11-19 14:14 ` Christian Ludwig [this message]
2026-11-19 14:14 ` [PATCH pve-manager v4 15/20] ui: storage: add efi-firmware content type support Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-manager v4 16/20] ui: form: support other content types in the ISO selector Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-manager v4 17/20] ui: qemu: allow selecting a custom EFI firmware image Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-manager v4 18/20] ui: migrate: refuse migration with a local custom " Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-docs v4 19/20] pvesm: document the efi-firmware content type Christian Ludwig
2026-11-19 14:14 ` [PATCH pve-docs v4 20/20] qm: document the custom firmware of the bios option Christian Ludwig

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=4628620330daec3594be37d5f9a41f186acebbef.1795092172.git.christian_ludwig@genua.de \
    --to=christian_ludwig@genua.de \
    --cc=pve-devel@lists.proxmox.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