From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 97B001FF0B0 for ; Tue, 27 Oct 2026 11:13:49 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8B14A21690; Tue, 27 Oct 2026 11:13:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=genua.de; s=202307; t=1793095940; bh=TnXqmK0VGkwvhaUbk2L0avdwccfx0aGe/Nll/eQrsxI=; h=Date:From:To:Subject:References:In-Reply-To:From; b=mUcL7XECgCjl8j3vvsVI8GczqJ7zvrejcAQ3WEJ0BqYN85hDBUv6NUzIdxA65n1iR AOQn1BoDf46Qc1B8TbJVAzuWoL300RaDxnyOicaxN+Rw+ELdI5mm40c+UgvCwHFXBO hdhvIzsdVAODmmrK/vSnREhie8+pVt91D20FGYzQ4kP7MrHronxWfnlmvmrmXaoE6e VXYvj78pE37Riht3z0kJTbRUXV6RqqDuS74yxKKYVpoBnXe0RprhWVN3iLCHxvv+fF 4EbUZhDbkrrp3qsaQ/gsMu7iLPER4P2/TM1gM6PblPH9iFPhcCaAO/vXR/xiEewEoD WdT2VmL1JmRqw== Date: Tue, 27 Oct 2026 11:12:19 +0100 From: Christian Ludwig To: Subject: [PATCH pve-storage v3 08/19] test: cover efi-firmware volumes in parse_volname and path_to_volume_id Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [192.168.217.185] X-ClientProxiedBy: kch1-mta09.win.genua.de (10.208.16.109) 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.067 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 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: MKILDBEPI2IPFJ2CFRQFEJQLRYB7HUCT X-Message-ID-Hash: MKILDBEPI2IPFJ2CFRQFEJQLRYB7HUCT 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: Check that only names with the safe character class and the '.fd' extension are recognized as efi-firmware volumes. Signed-off-by: Christian Ludwig --- src/test/parse_volname_test.pm | 26 ++++++++++++++++++++++++++ src/test/path_to_volume_id_test.pm | 13 +++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/test/parse_volname_test.pm b/src/test/parse_volname_test.pm index 7e937aa..7c6b4a0 100644 --- a/src/test/parse_volname_test.pm +++ b/src/test/parse_volname_test.pm @@ -166,6 +166,14 @@ my $tests = [ expected => ['import', 'import.ova/disk.raw', undef, undef, undef, undef, 'ova+raw'], }, # + # EFI firmware + # + { + description => 'EFI firmware, fd', + volname => 'efi-firmware/custom-ovmf-code.fd', + expected => ['efi-firmware', 'custom-ovmf-code.fd', undef, undef, undef, undef, 'raw'], + }, + # # failed matches # { @@ -207,6 +215,24 @@ my $tests = [ volname => "import/test.foo", expected => "unable to parse directory volume name 'import/test.foo'\n", }, + { + description => 'Failed match: EFI firmware, wrong extension', + volname => 'efi-firmware/custom-ovmf-code.raw', + expected => + "unable to parse directory volume name 'efi-firmware/custom-ovmf-code.raw'\n", + }, + { + description => 'Failed match: EFI firmware, upper case extension', + volname => 'efi-firmware/custom-ovmf-code.FD', + expected => + "unable to parse directory volume name 'efi-firmware/custom-ovmf-code.FD'\n", + }, + { + description => 'Failed match: EFI firmware, unsafe characters', + volname => 'efi-firmware/custom ovmf code.fd', + expected => + "unable to parse directory volume name 'efi-firmware/custom ovmf code.fd'\n", + }, ]; # create more test cases for VM disk images matches diff --git a/src/test/path_to_volume_id_test.pm b/src/test/path_to_volume_id_test.pm index dfa51e6..10beb5e 100644 --- a/src/test/path_to_volume_id_test.pm +++ b/src/test/path_to_volume_id_test.pm @@ -29,6 +29,7 @@ my $scfg = { 'iso' => 1, 'backup' => 1, 'vztmpl' => 1, + 'efi-firmware' => 1, }, }, }, @@ -185,6 +186,13 @@ my @tests = ( 'import', 'local:import/import.ovf', ], }, + { + description => 'EFI firmware, fd', + volname => "$storage_dir/efi-firmware/custom-ovmf-code.fd", + expected => [ + 'efi-firmware', 'local:efi-firmware/custom-ovmf-code.fd', + ], + }, # no matches, path or files with failures { @@ -232,6 +240,11 @@ my @tests = ( volname => "$storage_dir/import/test.foo", expected => [''], }, + { + description => 'EFI firmware, wrong extension', + volname => "$storage_dir/efi-firmware/custom-ovmf-code.raw", + expected => [''], + }, ); plan tests => scalar @tests + 1; -- 2.34.1