From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 8CD131FF0DE for ; Thu, 19 Nov 2026 15:16:41 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 35D2A21710; Thu, 19 Nov 2026 15:15:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=genua.de; s=202307; t=1795097667; bh=m+pIW1v/HzfrXKKESTEq+euKhI8rD2LeELp2zKQLAeU=; h=Date:From:To:Subject:References:In-Reply-To:From; b=FaOl3qLQ/tM1cIxyn6Zf4wpmFJjk5tFORPXLexPLsN/IMoOSHtN6x3xaHPRxcSEF0 cb2rqiqqAE7Jw3RPNeRuIJpC9pW3BIyDj7JSmTzkvD/tTuOXmcxyZYACekZq76VAQL SThuSu7e/gnGPINRqp/RkaYUzV4C58y4cXCvjWBBRCR3q1cr6y7BF5HRXSEX6EeFhM 08YhDgEQlr0QDo2KCVMmmGhzkggmjCIiToTGxAL57jEqN4CA0DAaQVpStZIKoJx1PU ndgllGx70Pr17H5C14+k4YpsFcxupdznaFO+RX3NKbQLKZtp68LpO22Ih8NqQOkdFO nOJej+/wQ2Sag== Date: Thu, 19 Nov 2026 15:14:26 +0100 From: Christian Ludwig To: Subject: [PATCH qemu-server v4 14/20] test: custom firmware volumes in replication and migration Message-ID: <4628620330daec3594be37d5f9a41f186acebbef.1795092172.git.christian_ludwig@genua.de> References: MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [192.168.217.185] X-ClientProxiedBy: kch1-mta08.win.genua.de (10.208.16.108) To kch1-mta07.win.genua.de (10.208.16.107) Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-SPAM-LEVEL: Spam detection results: 0 AWL 0.051 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record UNPARSEABLE_RELAY 0.001 Informational: message has unparseable relay lines Message-ID-Hash: UKEKDZ23HIUWSTKSROQWQXYDZQ4QFI2C X-Message-ID-Hash: UKEKDZ23HIUWSTKSROQWQXYDZQ4QFI2C X-MailFrom: christian_ludwig@genua.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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