]> git.proxmox.com Git - pve-storage.git/commitdiff
tests: archive info: make deterministic
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 15 May 2020 17:10:21 +0000 (19:10 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 15 May 2020 17:10:23 +0000 (19:10 +0200)
nothing worse than jumping test results due to not sorting the tests
and thus making discussions harder (which test # failed) and it may
imply another error by mistake.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
test/archive_info_test.pm

index 60d606eb38011aa17031ef6535da6246f29128a8..ce873b34836789168498ddcef1dbcaa573b7675c 100644 (file)
@@ -71,10 +71,10 @@ my $bkp_suffix = {
 };
 
 # create more test cases for backup files matches
-foreach my $virt (keys %$bkp_suffix) {
-    my ($format, $decomp) = @{ $bkp_suffix->{$virt} };
+for my $virt (sort keys %$bkp_suffix) {
+    my ($format, $decomp) = $bkp_suffix->{$virt}->@*;
 
-    foreach my $suffix (keys %$decomp) {
+    for my $suffix (sort keys %$decomp) {
        my @arr = (
            {
                description => "Backup archive, $virt, $format.$suffix",
@@ -101,7 +101,7 @@ my $non_bkp_suffix = {
 };
 
 # create tests for failed matches
-foreach my $virt (keys %$non_bkp_suffix) {
+for my $virt (sort keys %$non_bkp_suffix) {
     my $suffix = $non_bkp_suffix->{$virt};
     foreach my $s (@$suffix) {
        my @arr = (