From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 5741F1FF13B for ; Wed, 22 Apr 2026 13:18:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 68CDE19359; Wed, 22 Apr 2026 13:14:50 +0200 (CEST) From: "Max R. Carrara" To: pve-devel@lists.proxmox.com Subject: [PATCH pve-storage v1 43/54] test: parse volname: move backup file test creation into sep. block Date: Wed, 22 Apr 2026 13:13:09 +0200 Message-ID: <20260422111322.257380-44-m.carrara@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260422111322.257380-1-m.carrara@proxmox.com> References: <20260422111322.257380-1-m.carrara@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776856361891 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.083 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: D2TXZQ7PQKY7P3UDCVBBYCGXMQ5EDWS5 X-Message-ID-Hash: D2TXZQ7PQKY7P3UDCVBBYCGXMQ5EDWS5 X-MailFrom: m.carrara@proxmox.com 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: Similar to the previous commit, move the code that adds additional tests for backup file volnames into a separate block, for future organizational purposes. Signed-off-by: Max R. Carrara --- src/test/parse_volname_test.pm | 88 +++++++++++++++++----------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/src/test/parse_volname_test.pm b/src/test/parse_volname_test.pm index 3777e6e8..fb300ad5 100644 --- a/src/test/parse_volname_test.pm +++ b/src/test/parse_volname_test.pm @@ -271,54 +271,56 @@ my $tests = [ } } -# create more test cases for backup files matches -my $bkp_suffix = { - qemu => ['vma', 'vma.gz', 'vma.lzo', 'vma.zst'], - lxc => ['tar', 'tgz', 'tar.gz', 'tar.lzo', 'tar.zst', 'tar.bz2'], - openvz => ['tar', 'tgz', 'tar.gz', 'tar.lzo', 'tar.zst'], -}; +# Additional tests for backup files +{ + my $bkp_suffixes = { + qemu => ['vma', 'vma.gz', 'vma.lzo', 'vma.zst'], + lxc => ['tar', 'tgz', 'tar.gz', 'tar.lzo', 'tar.zst', 'tar.bz2'], + openvz => ['tar', 'tgz', 'tar.gz', 'tar.lzo', 'tar.zst'], + }; -for my $virt (keys $bkp_suffix->%*) { - my $suffix = $bkp_suffix->{$virt}; - for my $s ($suffix->@*) { - my @arr = ( - { - description => "Backup archive, $virt, $s", - volname => "backup/vzdump-$virt-$vmid-2020_03_30-21_12_40.$s", - expected => [ - 'backup', - "vzdump-$virt-$vmid-2020_03_30-21_12_40.$s", - "$vmid", - undef, - undef, - undef, - 'raw', - ], - }, - ); + for my $virt (keys $bkp_suffixes->%*) { + my $suffixes = $bkp_suffixes->{$virt}; + for my $suffix ($suffixes->@*) { + my @extra_tests = ( + { + description => "Backup archive, $virt, $suffix", + volname => "backup/vzdump-$virt-$vmid-2020_03_30-21_12_40.$suffix", + expected => [ + 'backup', + "vzdump-$virt-$vmid-2020_03_30-21_12_40.$suffix", + "$vmid", + undef, + undef, + undef, + 'raw', + ], + }, + ); - push($tests->@*, @arr); + push($tests->@*, @extra_tests); + } } -} -# create more test cases for failed backup files matches -my $non_bkp_suffix = { - qemu => ['vms.gz', 'vma.xz'], - lxc => ['zip.gz', 'tgz.lzo'], -}; -for my $virt (keys $non_bkp_suffix->%*) { - my $suffix = $non_bkp_suffix->{$virt}; - for my $s ($suffix->@*) { - my @arr = ( - { - description => "Failed match: Backup archive, $virt, $s", - volname => "backup/vzdump-$virt-$vmid-2020_03_30-21_12_40.$s", - expected => - "unable to parse directory volume name 'backup/vzdump-$virt-$vmid-2020_03_30-21_12_40.$s'\n", - }, - ); + # Failed tests + my $non_bkp_suffixes = { + qemu => ['vms.gz', 'vma.xz'], + lxc => ['zip.gz', 'tgz.lzo'], + }; + for my $virt (keys $non_bkp_suffixes->%*) { + my $suffixes = $non_bkp_suffixes->{$virt}; + for my $suffix ($suffixes->@*) { + my @extra_tests = ( + { + description => "Failed match: Backup archive, $virt, $suffix", + volname => "backup/vzdump-$virt-$vmid-2020_03_30-21_12_40.$suffix", + expected => + "unable to parse directory volume name 'backup/vzdump-$virt-$vmid-2020_03_30-21_12_40.$suffix'\n", + }, + ); - push($tests->@*, @arr); + push($tests->@*, @extra_tests); + } } } -- 2.47.3