[PATCH pve-storage v1 41/54] test: parse volname: adapt tests regarding 'import' volume type

Max R. Carrara
2026-04-22T11:17:44Z

Give the existing test cases unique 'description' keys and also
reorder them.

Add additional test cases for qcow2, vmdk and raw files.

Signed-off-by: Max R. Carrara <m.carrara@proxmox.com>
---
src/test/parse_volname_test.pm | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/test/parse_volname_test.pm b/src/test/parse_volname_test.pm
index a03ac163..ea07c56b 100644
--- a/src/test/parse_volname_test.pm
+++ b/src/test/parse_volname_test.pm
@@ -146,27 +146,42 @@ my $tests = [
expected => ['import', 'import.ovf', undef, undef, undef, undef, 'ovf'],
},
{
- description => "Import, inner file of ova",
+ description => "Import, qcow2",
+ volname => 'import/import.qcow2',
+ expected => ['import', 'import.qcow2', undef, undef, undef, undef, 'qcow2'],
+ },
+ {
+ description => "Import, vmdk",
+ volname => 'import/import.vmdk',
+ expected => ['import', 'import.vmdk', undef, undef, undef, undef, 'vmdk'],
+ },
+ {
+ description => "Import, raw",
+ volname => 'import/import.raw',
+ expected => ['import', 'import.raw', undef, undef, undef, undef, 'raw'],
+ },
+ {
+ description => "Import, inner file of ova (qcow2)",
volname => 'import/import.ova/disk.qcow2',
expected =>
['import', 'import.ova/disk.qcow2', undef, undef, undef, undef, 'ova+qcow2'],
},
{
- description => "Import, inner file of ova",
+ description => "Import, inner file of ova (vmdk)",
volname => 'import/import.ova/disk.vmdk',
expected => ['import', 'import.ova/disk.vmdk', undef, undef, undef, undef, 'ova+vmdk'],
},
+ {
+ description => "Import, inner file of ova (raw)",
+ volname => 'import/import.ova/disk.raw',
+ expected => ['import', 'import.ova/disk.raw', undef, undef, undef, undef, 'ova+raw'],
+ },
{
description => "Import, inner file of ova with whitespace in name",
volname => 'import/import.ova/OS disk.vmdk',
expected =>
['import', 'import.ova/OS disk.vmdk', undef, undef, undef, undef, 'ova+vmdk'],
},
- {
- description => "Import, inner file of ova",
- volname => 'import/import.ova/disk.raw',
- expected => ['import', 'import.ova/disk.raw', undef, undef, undef, undef, 'ova+raw'],
- },
#
# failed matches
#
--
2.47.3