all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Max R. Carrara" <m.carrara@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH storage 25/26] update tests
Date: Tue, 29 Jul 2025 18:33:01 +0200	[thread overview]
Message-ID: <DBOOM8O1WIC8.1Z5M4K75IBNYI@proxmox.com> (raw)
In-Reply-To: <20250729111557.136012-26-w.bumiller@proxmox.com>

On Tue Jul 29, 2025 at 1:15 PM CEST, Wolfgang Bumiller wrote:
> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
> ---

There are a couple tests for LVM and ZFS that seem to fail; relevant
logs are below.

I've also added some comments inline further below where possible.

==========

./run_test_zfspoolplugin.pl
  pool: test-pool
 state: ONLINE
status: Some supported and requested features are not enabled on the pool.
        The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
config:

        NAME                                      STATE     READ WRITE CKSUM
        test-pool                                 ONLINE       0     0     0
          mirror-0                                ONLINE       0     0     0
            scsi-0QEMU_QEMU_HARDDISK_drive-scsi1  ONLINE       0     0     0
            scsi-0QEMU_QEMU_HARDDISK_drive-scsi2  ONLINE       0     0     0

errors: No known data errors
Start tests for ZFSPoolPlugin

run test1 "volume_size_info"

run test2 "volume_resize"

run test3 "volume_has_feature"

run test4 "volume_snapshot"

run test5 "volume_snapshot_delete"
######Ignore Output if no Test5 g: is included######
cannot destroy 'regressiontest/base-100-disk-1@__base__': snapshot has dependent clones
use '-R' to destroy the following datasets:
######End Ignore#######

run test6 "volume_rollback_is_possible"

run test7 "volume_rollback"

run test8 "parse_volname"
Test8 a: parsing wrong at ./run_test_zfspoolplugin.pl line 1044.
Test8 b: parsing wrong at ./run_test_zfspoolplugin.pl line 1067.
Test8 c: parsing wrong at ./run_test_zfspoolplugin.pl line 1089.
Test8 d: parsing wrong at ./run_test_zfspoolplugin.pl line 1111.
Test8 e: parsing wrong at ./run_test_zfspoolplugin.pl line 1133.
Test8 f: parsing wrong at ./run_test_zfspoolplugin.pl line 1155.

run test9 "parse_volume_id"

run test10 "volume_is_base"
Use of uninitialized value in numeric eq (==) at ./run_test_zfspoolplugin.pl line 863.
Argument "base" isn't numeric in numeric eq (==) at ./run_test_zfspoolplugin.pl line 875.
Test10 b: is base at ./run_test_zfspoolplugin.pl line 877.
Use of uninitialized value in numeric eq (==) at ./run_test_zfspoolplugin.pl line 887.
Use of uninitialized value in numeric eq (==) at ./run_test_zfspoolplugin.pl line 899.
Argument "basevol" isn't numeric in numeric eq (==) at ./run_test_zfspoolplugin.pl line 911.
Test10 e: is base at ./run_test_zfspoolplugin.pl line 913.
Use of uninitialized value in numeric eq (==) at ./run_test_zfspoolplugin.pl line 923.

run test11 "volume_is_base"
Test11 b at ./run_test_zfspoolplugin.pl line 795.
cannot open 'regressiontest/vm-110-disk-0': dataset does not exist
Test11 b: command 'zfs list -H -o volsize regressiontest/vm-110-disk-0' failed: exit code 1
Test11 e at ./run_test_zfspoolplugin.pl line 831.
cannot open 'regressiontest/subvol-210-disk-0': dataset does not exist
Test11 e: command 'zfs list -H -o refquota regressiontest/subvol-210-disk-0' failed: exit code 1

run test12 "vdisk_create_base"

run test13 "vdisk_alloc"
Test13 a: vdisk_alloc without vtype not allowed anymore
Test13 b: volname:zfstank99:vol-vm-112-disk-0 don't match
Test13 c: vdisk_alloc without vtype not allowed anymore
Test13 d: volname:zfstank99:subvol-ct-113-disk-0  don't match

run test14 "vdisk_free"

run test15 "template_list and vdisk_list"
Test 15 d failed
Test 15 g failed
Test 15 h failed
Test 15 i failed

run test16 "activate_storage"

run test17 "deactivate_storage"

run test18 "scan_zfs"

run test19 "path"
Test 19 a: owner is not correct: expected 'images'  get 'vm-vol' at ./run_test_zfspoolplugin.pl line 77.
Test 19 b: owner is not correct: expected 'images'  get 'vm-vol' at ./run_test_zfspoolplugin.pl line 107.
Test 19 c: owner is not correct: expected 'images'  get 'vm-vol' at ./run_test_zfspoolplugin.pl line 137.
Test 19 d: owner is not correct: expected 'images'  get 'ct-vol' at ./run_test_zfspoolplugin.pl line 167.
Test 19 e: owner is not correct: expected 'images'  get 'ct-vol' at ./run_test_zfspoolplugin.pl line 197.
Test 19 f: owner is not correct: expected 'images'  get 'ct-vol' at ./run_test_zfspoolplugin.pl line 227.
Stop tests for ZFSPoolPlugin
26 tests failed
Time: 14s

==========

./run_test_lvmplugin.pl
Start tests for LVMPlugin
8000+0 records in
8000+0 records out
8388608000 bytes (8.4 GB, 7.8 GiB) copied, 4.04047 s, 2.1 GB/s
  Physical volume "/dev/loop1" successfully created.
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test1 "volume_size_info"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test2 "volume_resize"
  Size of logical volume regressiontest/vm-102-disk-1 changed from 1.00 GiB (256 extents) to 2.00 GiB (512 extents).
  Logical volume regressiontest/vm-102-disk-1 successfully resized.
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test3 "volume_has_feature"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test4 "volume_rollback_is_possible"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test5 "parse_volname"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test6 "parse_volume_id"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test7 "vdisk_alloc"
Test7 a: vdisk_alloc without vtype not allowed anymore
  Logical volume "vol-vm-112-disk-0" created.
Test7 b: volname:lvmregression:vol-vm-112-disk-0 don't match
  Logical volume "vm-102-disk-1" successfully removed.
  Logical volume "vol-vm-112-disk-0" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test8 "vdisk_free"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test15 "template_list and vdisk_list"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test10 "activate_storage"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test11 "deactivate_storage"
  0 logical volume(s) in volume group "regressiontest" now active
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Volume group "regressiontest" successfully created
  Logical volume "vm-102-disk-1" created.

run test12 "path"
  Logical volume "vm-102-disk-1" successfully removed.
  Volume group "regressiontest" successfully removed
  Labels on physical volume "/dev/loop1" successfully wiped.
Stop tests for LVMPlugin
2 tests failed
Time: 11s

==========

>  src/test/list_volumes_test.pm      | 73 ++++++++++++++++++++----------
>  src/test/parse_volname_test.pm     | 34 ++++++++++++--
>  src/test/path_to_volume_id_test.pm | 27 +++++++----
>  src/test/run_test_lvmplugin.pl     | 11 +++--
>  src/test/run_test_zfspoolplugin.pl | 45 ++++++++++--------
>  5 files changed, 129 insertions(+), 61 deletions(-)
>
> diff --git a/src/test/list_volumes_test.pm b/src/test/list_volumes_test.pm
> index e528fc3..fcc7beb 100644
> --- a/src/test/list_volumes_test.pm
> +++ b/src/test/list_volumes_test.pm
> @@ -71,6 +71,8 @@ my $scfg = {
>          'rootdir' => 1,
>          'vztmpl' => 1,
>          'images' => 1,
> +        'vm-vol' => 1,
> +        'ct-vol' => 1,
>          'snippets' => 1,
>          'backup' => 1,
>      },
> @@ -87,9 +89,9 @@ my @tests = (
>          description => 'VMID: 16110, VM, qcow2, backup, snippets',
>          vmid => '16110',
>          files => [
> -            "$storage_dir/images/16110/vm-16110-disk-0.qcow2",
> -            "$storage_dir/images/16110/vm-16110-disk-1.raw",
> -            "$storage_dir/images/16110/vm-16110-disk-2.vmdk",
> +            "$storage_dir/vms/16110/vol-vm-16110-disk-0.qcow2",
> +            "$storage_dir/vms/16110/vol-vm-16110-disk-1.raw",
> +            "$storage_dir/vms/16110/vol-vm-16110-disk-2.vmdk",
>              "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_11_40.vma.gz",
>              "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_12_45.vma.lzo",
>              "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_13_55.vma",
> @@ -99,34 +101,37 @@ my @tests = (
>          ],
>          expected => [
>              {
> -                'content' => 'images',
> +                'content' => 'vm-vol',
> +                'vtype' => 'vm-vol',
>                  'ctime' => DEFAULT_CTIME,
>                  'format' => 'qcow2',
>                  'parent' => undef,
>                  'size' => DEFAULT_SIZE,
>                  'used' => DEFAULT_USED,
>                  'vmid' => '16110',
> -                'volid' => 'local:16110/vm-16110-disk-0.qcow2',
> +                'volid' => 'local:16110/vol-vm-16110-disk-0.qcow2',
>              },
>              {
> -                'content' => 'images',
> +                'content' => 'vm-vol',
> +                'vtype' => 'vm-vol',
>                  'ctime' => DEFAULT_CTIME,
>                  'format' => 'raw',
>                  'parent' => undef,
>                  'size' => DEFAULT_SIZE,
>                  'used' => DEFAULT_USED,
>                  'vmid' => '16110',
> -                'volid' => 'local:16110/vm-16110-disk-1.raw',
> +                'volid' => 'local:16110/vol-vm-16110-disk-1.raw',
>              },
>              {
> -                'content' => 'images',
> +                'content' => 'vm-vol',
> +                'vtype' => 'vm-vol',
>                  'ctime' => DEFAULT_CTIME,
>                  'format' => 'vmdk',
>                  'parent' => undef,
>                  'size' => DEFAULT_SIZE,
>                  'used' => DEFAULT_USED,
>                  'vmid' => '16110',
> -                'volid' => 'local:16110/vm-16110-disk-2.vmdk',
> +                'volid' => 'local:16110/vol-vm-16110-disk-2.vmdk',
>              },
>              {
>                  'content' => 'backup',
> @@ -184,7 +189,8 @@ my @tests = (
>          description => 'VMID: 16112, lxc, raw, backup',
>          vmid => '16112',
>          files => [
> -            "$storage_dir/images/16112/vm-16112-disk-0.raw",
> +            "$storage_dir/cts/16112/vol-ct-16112-disk-0.raw",
> +            "$storage_dir/images/16112/vm-16112-disk-1.raw",
>              "$storage_dir/dump/vzdump-lxc-16112-2020_03_30-21_39_30.tar.lzo",
>              "$storage_dir/dump/vzdump-lxc-16112-2020_03_30-21_49_30.tar.gz",
>              "$storage_dir/dump/vzdump-lxc-16112-2020_03_30-21_49_30.tar.zst",
> @@ -192,6 +198,17 @@ my @tests = (
>              "$storage_dir/dump/vzdump-openvz-16112-2020_03_30-21_39_30.tar.bz2",
>          ],
>          expected => [
> +            {
> +                'content' => 'ct-vol',
> +                'vtype' => 'ct-vol',
> +                'ctime' => DEFAULT_CTIME,
> +                'format' => 'raw',
> +                'parent' => undef,
> +                'size' => DEFAULT_SIZE,
> +                'used' => DEFAULT_USED,
> +                'vmid' => '16112',
> +                'volid' => 'local:16112/vol-ct-16112-disk-0.raw',
> +            },
>              {
>                  'content' => 'rootdir',
>                  'ctime' => DEFAULT_CTIME,
> @@ -200,7 +217,7 @@ my @tests = (
>                  'size' => DEFAULT_SIZE,
>                  'used' => DEFAULT_USED,
>                  'vmid' => '16112',
> -                'volid' => 'local:16112/vm-16112-disk-0.raw',
> +                'volid' => 'local:16112/vm-16112-disk-1.raw',
>              },
>              {
>                  'content' => 'backup',
> @@ -254,7 +271,7 @@ my @tests = (
>          vmid => '16114',
>          files => [
>              "$storage_dir/images/16114/vm-16114-disk-0.qcow2",
> -            "$storage_dir/images/16114/vm-16114-disk-1.qcow2",
> +            "$storage_dir/vms/16114/vol-vm-16114-disk-1.qcow2",
>          ],
>          parent => [
>              "../9004/base-9004-disk-0.qcow2", "../9004/base-9004-disk-1.qcow2",
> @@ -271,14 +288,15 @@ my @tests = (
>                  'volid' => 'local:9004/base-9004-disk-0.qcow2/16114/vm-16114-disk-0.qcow2',
>              },
>              {
> -                'content' => 'images',
> +                'content' => 'vm-vol',
> +                'vtype' => 'vm-vol',
>                  'ctime' => DEFAULT_CTIME,
>                  'format' => 'qcow2',
>                  'parent' => '../9004/base-9004-disk-1.qcow2',
>                  'size' => DEFAULT_SIZE,
>                  'used' => DEFAULT_USED,
>                  'vmid' => '16114',
> -                'volid' => 'local:9004/base-9004-disk-1.qcow2/16114/vm-16114-disk-1.qcow2',
> +                'volid' => 'local:9004/base-9004-disk-1.qcow2/16114/vol-vm-16114-disk-1.qcow2',
>              },
>          ],
>      },
> @@ -287,7 +305,7 @@ my @tests = (
>          vmid => '9004',
>          files => [
>              "$storage_dir/images/9004/base-9004-disk-0.qcow2",
> -            "$storage_dir/images/9004/base-9004-disk-1.qcow2",
> +            "$storage_dir/vms/9004/base-vol-vm-9004-disk-1.qcow2",
>          ],
>          expected => [
>              {
> @@ -301,14 +319,15 @@ my @tests = (
>                  'volid' => 'local:9004/base-9004-disk-0.qcow2',
>              },
>              {
> -                'content' => 'images',
> +                'content' => 'vm-vol',
> +                'vtype' => 'vm-vol',
>                  'ctime' => DEFAULT_CTIME,
>                  'format' => 'qcow2',
>                  'parent' => undef,
>                  'size' => DEFAULT_SIZE,
>                  'used' => DEFAULT_USED,
>                  'vmid' => '9004',
> -                'volid' => 'local:9004/base-9004-disk-1.qcow2',
> +                'volid' => 'local:9004/base-vol-vm-9004-disk-1.qcow2',
>              },
>          ],
>      },
> @@ -428,21 +447,22 @@ my @tests = (
>          #"$storage_dir/images/ssss/base-4321-disk-0.qcow2/1234/vm-1234-disk-0.qcow2",
>          vmid => undef,
>          files => [
> -            "$storage_dir/images/1234/vm-1234-disk-0.qcow2",
> +            "$storage_dir/vms/1234/vol-vm-1234-disk-0.qcow2",
>          ],
>          parent => [
> -            "../ssss/base-4321-disk-0.qcow2",
> +            "../ssss/base-vol-vm-4321-disk-0.qcow2",
>          ],
>          expected => [
>              {
> -                'content' => 'images',
> +                'content' => 'vm-vol',
> +                'vtype' => 'vm-vol',
>                  'ctime' => DEFAULT_CTIME,
>                  'format' => 'qcow2',
> -                'parent' => '../ssss/base-4321-disk-0.qcow2',
> +                'parent' => '../ssss/base-vol-vm-4321-disk-0.qcow2',
>                  'size' => DEFAULT_SIZE,
>                  'used' => DEFAULT_USED,
>                  'vmid' => '1234',
> -                'volid' => 'local:1234/vm-1234-disk-0.qcow2',
> +                'volid' => 'local:1234/vol-vm-1234-disk-0.qcow2',
>              },
>          ],
>      },
> @@ -521,7 +541,7 @@ plan tests => $plan + 1;
>  
>  {
>      my $sid = 'local';
> -    my $types = ['rootdir', 'images', 'vztmpl', 'iso', 'backup', 'snippets'];
> +    my $types = ['images', 'rootdir', 'vm-vol', 'ct-vol', 'vztmpl', 'iso', 'backup', 'snippets'];
>      my @suffixes = ('qcow2', 'raw', 'vmdk', 'vhdx');
>  
>      # run through test cases
> @@ -555,6 +575,13 @@ plan tests => $plan + 1;
>          eval { $got = PVE::Storage::Plugin->list_volumes($sid, $scfg, $vmid, $types) };
>          $got = $@ if $@;
>  
> +        sub sort_by_volid {
> +            my ($data) = @_;
> +            return [sort { $a->{volid} cmp $b->{volid} } @$data];
> +        }
> +
> +        $got = sort_by_volid($got) if ref($got) && ref($got) eq 'ARRAY';
> +        $expected = sort_by_volid($expected);
>          is_deeply($got, $expected, $description) || diag(explain($got));
>  
>          # clean up after each test case, otherwise
> diff --git a/src/test/parse_volname_test.pm b/src/test/parse_volname_test.pm
> index 0d077a9..297e280 100644
> --- a/src/test/parse_volname_test.pm
> +++ b/src/test/parse_volname_test.pm
> @@ -20,6 +20,19 @@ my $tests = [
>      #
>      {
>          description => 'VM disk image, linked, qcow2, vm- as base-',
> +        volname => "$vmid/vol-vm-$vmid-disk-0.qcow2/$vmid/vol-vm-$vmid-disk-0.qcow2",
> +        expected => [
> +            'vm-vol',
> +            "vol-vm-$vmid-disk-0.qcow2",
> +            "$vmid",
> +            "vol-vm-$vmid-disk-0.qcow2",
> +            "$vmid",
> +            !!0,
> +            'qcow2',
> +        ],
> +    },
> +    {
> +        description => 'VM disk image, legacy, linked, qcow2, vm- as base-',
>          volname => "$vmid/vm-$vmid-disk-0.qcow2/$vmid/vm-$vmid-disk-0.qcow2",
>          expected => [
>              'images',
> @@ -27,11 +40,21 @@ my $tests = [
>              "$vmid",
>              "vm-$vmid-disk-0.qcow2",
>              "$vmid",
> -            undef,
> +            !!0,
>              'qcow2',
>          ],
>      },
>      #
> +    # Container volumes
> +    #
> +    {
> +        description => 'CT rootdir image',
> +        volname => "$vmid/vol-ct-$vmid-disk-0.raw",
> +        expected => [
> +            'ct-vol', "vol-ct-$vmid-disk-0.raw", "$vmid", undef, undef, !!0, 'raw',
> +        ],
> +    },
> +    #
>      # iso
>      #
>      {
> @@ -94,7 +117,7 @@ my $tests = [
>          description => 'Container rootdir, subvol',
>          volname => "$vmid/subvol-$vmid-disk-0.subvol",
>          expected =>
> -            ['images', "subvol-$vmid-disk-0.subvol", "$vmid", undef, undef, undef, 'subvol'],
> +            ['images', "subvol-$vmid-disk-0.subvol", "$vmid", undef, undef, !!0, 'subvol'],
>      },
>      {
>          description => 'Backup archive, no virtualization type',
> @@ -209,7 +232,7 @@ foreach my $s (@$disk_suffix) {
>              description => "VM disk image, $s",
>              volname => "$vmid/vm-$vmid-disk-1.$s",
>              expected => [
> -                'images', "vm-$vmid-disk-1.$s", "$vmid", undef, undef, undef, "$s",
> +                'images', "vm-$vmid-disk-1.$s", "$vmid", undef, undef, !!0, "$s",
>              ],
>          },
>          {
> @@ -221,7 +244,7 @@ foreach my $s (@$disk_suffix) {
>                  "$vmid",
>                  "base-$vmid-disk-0.$s",
>                  "$vmid",
> -                undef,
> +                !!0,
>                  "$s",
>              ],
>          },
> @@ -229,7 +252,7 @@ foreach my $s (@$disk_suffix) {
>              description => "VM disk image, base, $s",
>              volname => "$vmid/base-$vmid-disk-0.$s",
>              expected => [
> -                'images', "base-$vmid-disk-0.$s", "$vmid", undef, undef, 'base-', "$s",
> +                'images', "base-$vmid-disk-0.$s", "$vmid", undef, undef, !!1, "$s",
>              ],
>          },
>      );
> @@ -295,6 +318,7 @@ plan tests => scalar @$tests + 1;
>  
>  my $seen_vtype;
>  my $vtype_subdirs = { map { $_ => 1 } keys %{ PVE::Storage::Plugin::get_vtype_subdirs() } };
> +delete $vtype_subdirs->{rootdir}; # this one cannot be observed, it maps to the 'ct-vol' type.
>  
>  foreach my $t (@$tests) {
>      my $description = $t->{description};
> diff --git a/src/test/path_to_volume_id_test.pm b/src/test/path_to_volume_id_test.pm
> index ab7e276..bb2d47f 100644
> --- a/src/test/path_to_volume_id_test.pm
> +++ b/src/test/path_to_volume_id_test.pm
> @@ -25,8 +25,9 @@ my $scfg = {
>              'maxfiles' => 0,
>              'content' => {
>                  'snippets' => 1,
> -                'rootdir' => 1,
>                  'images' => 1,
> +                'vm-vol' => 1,
> +                'ct-vol' => 1,
>                  'iso' => 1,
>                  'backup' => 1,
>                  'vztmpl' => 1,
> @@ -44,24 +45,31 @@ my $scfg = {
>  # expected    => the result that path_to_volume_id should return
>  my @tests = (
>      {
> -        description => 'Image, qcow2',
> +        description => 'Image, qcow2, legacy naming',
>          volname => "$storage_dir/images/16110/vm-16110-disk-0.qcow2",
>          expected => [
>              'images', 'local:16110/vm-16110-disk-0.qcow2',
>          ],
>      },
> +    {
> +        description => 'Image, qcow2',
> +        volname => "$storage_dir/vms/16110/vol-vm-16110-disk-0.qcow2",
> +        expected => [
> +            'vm-vol', 'local:16110/vol-vm-16110-disk-0.qcow2',
> +        ],
> +    },
>      {
>          description => 'Image, raw',
> -        volname => "$storage_dir/images/16112/vm-16112-disk-0.raw",
> +        volname => "$storage_dir/vms/16112/vol-vm-16112-disk-0.raw",
>          expected => [
> -            'images', 'local:16112/vm-16112-disk-0.raw',
> +            'vm-vol', 'local:16112/vol-vm-16112-disk-0.raw',
>          ],
>      },
>      {
>          description => 'Image template, qcow2',
> -        volname => "$storage_dir/images/9004/base-9004-disk-0.qcow2",
> +        volname => "$storage_dir/vms/9004/base-vol-vm-9004-disk-0.qcow2",
>          expected => [
> -            'images', 'local:9004/base-9004-disk-0.qcow2',
> +            'vm-vol', 'local:9004/base-vol-vm-9004-disk-0.qcow2',
>          ],
>      },
>  
> @@ -141,14 +149,14 @@ my @tests = (
>          description => 'Rootdir, folder subvol, legacy naming',
>          volname => "$storage_dir/images/1234/subvol-1234-disk-0.subvol/", # fileparse needs / at the end
>          expected => [
> -            'ct-vol', 'local:1234/subvol-1234-disk-0.subvol',
> +            'images', 'local:1234/subvol-1234-disk-0.subvol',
>          ],
>      },
>      {
>          description => 'Rootdir, folder subvol',
> -        volname => "$storage_dir/images/1234/subvol-1234-disk-0.subvol/", # fileparse needs / at the end
> +        volname => "$storage_dir/cts/1234/vol-ct-1234-disk-0.subvol/", # fileparse needs / at the end
>          expected => [
> -            'images', 'local:1234/subvol-1234-disk-0.subvol',
> +            'ct-vol', 'local:1234/vol-ct-1234-disk-0.subvol',
>          ],
>      },
>      {
> @@ -239,6 +247,7 @@ plan tests => scalar @tests + 1;
>  
>  my $seen_vtype;
>  my $vtype_subdirs = { map { $_ => 1 } keys %{ PVE::Storage::Plugin::get_vtype_subdirs() } };
> +delete $vtype_subdirs->{rootdir}; # this one cannot be observed, it maps to the 'ct-vol' type.
>  
>  foreach my $tt (@tests) {
>      my $file = $tt->{volname};
> diff --git a/src/test/run_test_lvmplugin.pl b/src/test/run_test_lvmplugin.pl
> index e87a3de..92e8d6e 100755
> --- a/src/test/run_test_lvmplugin.pl
> +++ b/src/test/run_test_lvmplugin.pl
> @@ -159,7 +159,7 @@ my $test7 = sub {
>  
>      eval {
>          my $tmp_volid =
> -            PVE::Storage::vdisk_alloc($cfg, $storagename, "112", "raw", undef, 1024 * 1024);
> +            PVE::Storage::vdisk_alloc($cfg, $storagename, "112", "raw", undef, 1024 * 1024, undef);

^ Assuming that this should be "images" instead of undef above, since
vdisk_alloc now throws when undef is passed.

Should probably also add a test that expects `vdisk_alloc()` to throw
when undef is passed.

>  
>          if ($tmp_volid ne "$storagename:vm-112-disk-0") {
>              die "volname:$tmp_volid don't match\n";
> @@ -186,15 +186,16 @@ my $test7 = sub {
>      }
>  
>      eval {
> -        my $tmp_volid =
> -            PVE::Storage::vdisk_alloc($cfg, $storagename, "112", "raw", undef, 2048 * 1024);
> +        my $tmp_volid = PVE::Storage::vdisk_alloc(
> +            $cfg, $storagename, "112", "raw", undef, 2048 * 1024, 'vm-vol',
> +        );
>  
> -        if ($tmp_volid ne "$storagename:vm-112-disk-1") {
> +        if ($tmp_volid ne "$storagename:vol-vm-112-disk-1") {
>              die "volname:$tmp_volid don't match\n";
>          }

^ This here also trips up; see the following output:

run test7 "vdisk_alloc"
  Logical volume "vm-112-disk-0" created.
  Logical volume "vol-vm-112-disk-2" created.
Test7 b: volname:lvmregression:vol-vm-112-disk-2 don't match
  Logical volume "vm-102-disk-1" successfully removed.
  Logical volume "vm-112-disk-0" successfully removed.
  Logical volume "vol-vm-112-disk-2" successfully removed.
  Volume group "regressiontest" successfully removed

Haven't fully investigated yet, but at a quick glance this seems
related to the changes to `my $get_vm_disk_number = sub { ... }`
and `get_next_vm_diskname()` done in patch 17.

>          eval {
>              run_command(
> -                "lvs --noheadings -o lv_size $vgname/vm-112-disk-1",
> +                "lvs --noheadings -o lv_size $vgname/vol-vm-112-disk-1",
>                  outfunc => sub {
>                      my $tmp = shift;
>                      if ($tmp !~ m/2\.00g/) {
> diff --git a/src/test/run_test_zfspoolplugin.pl b/src/test/run_test_zfspoolplugin.pl
> index 9bd70a8..99ab6e2 100755
> --- a/src/test/run_test_zfspoolplugin.pl
> +++ b/src/test/run_test_zfspoolplugin.pl
> @@ -580,7 +580,7 @@ my $test13 = sub {
>  
>      eval {
>          my $tmp_volid =
> -            PVE::Storage::vdisk_alloc($cfg, $storagename, "112", "raw", undef, 1024 * 1024);
> +            PVE::Storage::vdisk_alloc($cfg, $storagename, "112", "raw", undef, 1024 * 1024, undef);

^ Trips up; assuming this also takes "images" instead of undef due to
the changes made to `vdisk_alloc()`.

>  
>          if ($tmp_volid ne "$storagename:vm-112-disk-0") {
>              die "volname:$tmp_volid don't match\n";
> @@ -607,18 +607,19 @@ my $test13 = sub {
>      }
>  
>      eval {
> -        my $tmp_volid =
> -            PVE::Storage::vdisk_alloc($cfg, $storagename, "112", "raw", undef, 2048 * 1024);
> +        my $tmp_volid = PVE::Storage::vdisk_alloc(
> +            $cfg, $storagename, "112", "raw", undef, 2048 * 1024, 'vm-vol',
> +        );
>  
> -        if ($tmp_volid ne "$storagename:vm-112-disk-1") {
> +        if ($tmp_volid ne "$storagename:vol-vm-112-disk-1") {
>              die "volname:$tmp_volid don't match\n";

^ Also trips up; probably due to the changes related to disk-number
fetching as mentioned above.

>          }
>          eval {
>              run_command(
> -                "zfs get -H volsize $zpath\/vm-112-disk-1",
> +                "zfs get -H volsize $zpath\/vol-vm-112-disk-1",
>                  outfunc => sub {
>                      my $tmp = shift;
> -                    if ($tmp !~ m/^$zpath\/vm-112-disk-1.*volsize.*2G.*$/) {
> +                    if ($tmp !~ m/^$zpath\/vol-vm-112-disk-1.*volsize.*2G.*$/) {
>                          die "size don't match\n";
>                      }
>                  },
> @@ -635,8 +636,9 @@ my $test13 = sub {
>      }
>  
>      eval {
> -        my $tmp_volid =
> -            PVE::Storage::vdisk_alloc($cfg, $storagename, "113", "subvol", undef, 1024 * 1024);
> +        my $tmp_volid = PVE::Storage::vdisk_alloc(
> +            $cfg, $storagename, "113", "subvol", undef, 1024 * 1024, undef,
> +        );

^ Trips up as well; see above.

>  
>          if ($tmp_volid ne "$storagename:subvol-113-disk-0") {
>              die "volname:$tmp_volid  don't match\n";
> @@ -663,18 +665,19 @@ my $test13 = sub {
>      }
>  
>      eval {
> -        my $tmp_volid =
> -            PVE::Storage::vdisk_alloc($cfg, $storagename, "113", "subvol", undef, 2048 * 1024);
> +        my $tmp_volid = PVE::Storage::vdisk_alloc(
> +            $cfg, $storagename, "113", "subvol", undef, 2048 * 1024, 'ct-vol',
> +        );
>  
> -        if ($tmp_volid ne "$storagename:subvol-113-disk-1") {
> +        if ($tmp_volid ne "$storagename:subvol-ct-113-disk-1") {
>              die "volname:$tmp_volid  don't match\n";

^ Trips up as well; see above.

>          }
>          eval {
>              run_command(
> -                "zfs get -H refquota $zpath\/subvol-113-disk-1",
> +                "zfs get -H refquota $zpath\/subvol-ct-113-disk-1",
>                  outfunc => sub {
>                      my $tmp = shift;
> -                    if ($tmp !~ m/^$zpath\/subvol-113-disk-1.*refquota.*G.*$/) {
> +                    if ($tmp !~ m/^$zpath\/subvol-ct-113-disk-1.*refquota.*G.*$/) {
>                          die "size don't match\n";
>                      }
>                  },
> @@ -778,7 +781,7 @@ my $test11 = sub {

^ Bunch of things for this test fail; at a quick glance this also seems
related to the changes to `my $get_vm_disk_number = sub { ... }`
and `get_next_vm_diskname()` done in patch 17.

>  
>      print "\nrun test11 \"volume_is_base\"\n";
>  
> -    eval { PVE::Storage::vdisk_clone($cfg, "$storagename:$vmdisk", 110); };
> +    eval { PVE::Storage::vdisk_clone($cfg, "$storagename:$vmdisk", 110, undef, undef); };
>      if (!$@) {
>          $count++;
>          warn "Test11 a: clone_image only works on base images";
> @@ -786,7 +789,7 @@ my $test11 = sub {
>  
>      eval {
>          if ("$storagename:$vmbase\/vm-110-disk-0" ne
> -            PVE::Storage::vdisk_clone($cfg, "$storagename:$vmbase", 110, '__base__')
> +            PVE::Storage::vdisk_clone($cfg, "$storagename:$vmbase", 110, '__base__', undef)
>          ) {
>              $count++;
>              warn "Test11 b";
> @@ -806,13 +809,15 @@ my $test11 = sub {
>          warn "Test11 b: $@";
>      }
>  
> -    eval { PVE::Storage::vdisk_clone($cfg, "$storagename:$vmbase\/$vmlinked", 111); };
> +    eval {
> +        PVE::Storage::vdisk_clone($cfg, "$storagename:$vmbase\/$vmlinked", 111, undef, undef);
> +    };
>      if (!$@) {
>          $count++;
>          warn "Test11 c: clone_image only works on base images";
>      }
>  
> -    eval { PVE::Storage::vdisk_clone($cfg, "$storagename:$ctdisk", 110); };
> +    eval { PVE::Storage::vdisk_clone($cfg, "$storagename:$ctdisk", 110, undef, undef); };
>      if (!$@) {
>          $count++;
>          warn "Test11 d: clone_image only works on base images";
> @@ -820,7 +825,7 @@ my $test11 = sub {
>  
>      eval {
>          if ("$storagename:$ctbase\/subvol-210-disk-0" ne
> -            PVE::Storage::vdisk_clone($cfg, "$storagename:$ctbase", 210, '__base__')
> +            PVE::Storage::vdisk_clone($cfg, "$storagename:$ctbase", 210, '__base__', undef)
>          ) {
>              $count++;
>              warn "Test11 e";
> @@ -840,7 +845,9 @@ my $test11 = sub {
>          warn "Test11 e: $@";
>      }
>  
> -    eval { PVE::Storage::vdisk_clone($cfg, "$storagename:$ctbase\/$ctlinked", 211); };
> +    eval {
> +        PVE::Storage::vdisk_clone($cfg, "$storagename:$ctbase\/$ctlinked", 211, undef, undef);
> +    };
>      if (!$@) {
>          $count++;
>          warn "Test11 f: clone_image only works on base images";



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-07-29 16:32 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 11:15 [pve-devel] [RFC storage 00/26+10+3] unify vtype and content-type and Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 01/26] btrfs: remove unnecessary mkpath call Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 02/26] parse_volname: remove openvz 'rootdir' case Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 03/26] drop rootdir case in path_to_volume_id Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 04/26] escape dirs in path_to_volume_id regexes Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 05/26] tests: drop rootdir/ tests Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 06/26] common: use v5.36 Wolfgang Bumiller
2025-07-29 13:59   ` Fiona Ebner
2025-07-29 14:42     ` Thomas Lamprecht
2025-07-29 11:15 ` [pve-devel] [PATCH storage 07/26] common: add pve-storage-vtype standard option with new types Wolfgang Bumiller
2025-07-29 13:50   ` Fiona Ebner
2025-07-29 11:15 ` [pve-devel] [PATCH storage 08/26] prepare for vm-vol and ct-vol content and vtypes Wolfgang Bumiller
2025-07-30  8:38   ` Fabian Grünbichler
2025-08-08 12:01     ` Wolfgang Bumiller
2025-07-30  9:14   ` Fabian Grünbichler
2025-08-08 12:05     ` Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 09/26] plugins: add new content types to all plugindata Wolfgang Bumiller
2025-07-30  8:38   ` Fabian Grünbichler
2025-08-08 12:10     ` Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 10/26] plugins: update volname parsing for new naming convention Wolfgang Bumiller
2025-07-30  8:37   ` Fabian Grünbichler
2025-07-30  8:53     ` Wolfgang Bumiller
2025-07-30  8:58       ` Fabian Grünbichler
2025-07-29 11:15 ` [pve-devel] [PATCH storage 11/26] plugin: add vm/ct-vol to 'local' storage default content types Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 12/26] plugin: support new vtypes in activate_storage checks Wolfgang Bumiller
2025-07-30  8:36   ` Fabian Grünbichler
2025-08-08 13:16     ` Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 13/26] plugin, btrfs: update list_images and list_volumes Wolfgang Bumiller
2025-07-30  8:36   ` Fabian Grünbichler
2025-07-30  8:41     ` Fiona Ebner
2025-07-29 11:15 ` [pve-devel] [PATCH storage 14/26] plugins: update image/volume listing to support new types Wolfgang Bumiller
2025-07-30  8:36   ` Fabian Grünbichler
2025-07-29 11:15 ` [pve-devel] [PATCH storage 15/26] common: add is_volume_type and is_type_change_allowed helpers Wolfgang Bumiller
2025-07-30  9:01   ` Fabian Grünbichler
2025-07-29 11:15 ` [pve-devel] [PATCH storage 16/26] common: add volume_type_from_name convenience helper Wolfgang Bumiller
2025-07-30  8:36   ` Fabian Grünbichler
2025-07-30  9:09     ` Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 17/26] plugins: add vtype parameter to alloc_image Wolfgang Bumiller
2025-07-30  9:24   ` Fabian Grünbichler
2025-07-30 14:00   ` Max R. Carrara
2025-07-30 14:05     ` Max R. Carrara
2025-07-30 14:26       ` Fabian Grünbichler
2025-07-30 14:49         ` Max R. Carrara
2025-07-30 15:01           ` Fabian Grünbichler
2025-07-29 11:15 ` [pve-devel] [PATCH storage 18/26] plugins: update create_base methods Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 19/26] plugins: update clone_image methods Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 20/26] plugins: update rename_volumes methods Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 21/26] plugins: update volume_import methods Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 22/26] zfs: update 'path' method for new naming scheme Wolfgang Bumiller
2025-07-30  9:31   ` Fabian Grünbichler
2025-07-29 11:15 ` [pve-devel] [PATCH storage 23/26] pvesm: add vtype parameter to import command Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 24/26] api: add vtype parameter to create call Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH storage 25/26] update tests Wolfgang Bumiller
2025-07-29 16:33   ` Max R. Carrara [this message]
2025-07-29 11:15 ` [pve-devel] [PATCH storage 26/26] update ApiChangeLog Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH container 1/3] add vtype to vdisk_alloc and vdisk_clone calls Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH container 2/3] expect 'vm-vol' vtype in get_replicatable_volumes Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH container 3/3] add vtype to rename_volume call Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 01/10] add vtype to vdisk_alloc and vdisk_clone calls Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 02/10] add vtype parameter to rename_volume call Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 03/10] expect 'vm-vol' vtype in get_replicatable_volumes Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 04/10] expect 'vm-vol' vtype wherever 'images' was expected Wolfgang Bumiller
2025-07-30  8:40   ` Fabian Grünbichler
2025-07-30  9:17   ` Fiona Ebner
2025-07-30  9:33     ` Fiona Ebner
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 05/10] tests: update QmMock to support vtypes Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 06/10] tests: scripted: update tests to new vtypes and paths Wolfgang Bumiller
2025-07-29 14:13   ` Max R. Carrara
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 07/10] make tidy Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 08/10] tests: fixup restore test to use new volume naming scheme Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 09/10] tests: update remaining tests to new snapshot paths Wolfgang Bumiller
2025-07-29 11:15 ` [pve-devel] [PATCH qemu-server 10/10] tests: regenerate cfg2cmd files Wolfgang Bumiller
2025-07-29 14:19   ` Max R. Carrara
2025-07-29 15:34 ` [pve-devel] partially-applied: [RFC storage 00/26+10+3] unify vtype and content-type and Fiona Ebner

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=DBOOM8O1WIC8.1Z5M4K75IBNYI@proxmox.com \
    --to=m.carrara@proxmox.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal