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 pve-storage v3 08/19] test: cover efi-firmware volumes in parse_volname and path_to_volume_id
Date: Tue, 27 Oct 2026 11:12:19 +0100	[thread overview]
Message-ID: <a87e2dfb45ed9dc971d5223e17b4435f2146b6b8.1793029144.git@genua.de> (raw)
In-Reply-To: <cover.1793029144.git@genua.de>

Check that only names with the safe character class and the '.fd'
extension are recognized as efi-firmware volumes.

Signed-off-by: Christian Ludwig <christian_ludwig@genua.de>
---
 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




  parent reply	other threads:[~2026-10-27 10:13 UTC|newest]

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