[pve-devel] [PATCH qemu-server v2 01/15] test: cfg2cmd: expect error for invalid volume's storage content type

Fiona Ebner f.ebner at proxmox.com
Wed Feb 19 16:45:24 CET 2025


Am 11.02.25 um 17:08 schrieb Daniel Kral:
> Tests whether when running `config_to_command` it will correctly fail
> with an error message that a volume cannot be used if the underlying
> storage does not support its content type.
> 
> Signed-off-by: Daniel Kral <d.kral at proxmox.com>
> ---
> changes since v1:
> - no changes except removing unrelated diff
> 
>  test/cfg2cmd/unsupported-storage-content-type.conf | 3 +++
>  test/run_config2command_tests.pl                   | 4 ++++
>  2 files changed, 7 insertions(+)
>  create mode 100644 test/cfg2cmd/unsupported-storage-content-type.conf
> 
> diff --git a/test/cfg2cmd/unsupported-storage-content-type.conf b/test/cfg2cmd/unsupported-storage-content-type.conf
> new file mode 100644
> index 00000000..e33165a8
> --- /dev/null
> +++ b/test/cfg2cmd/unsupported-storage-content-type.conf
> @@ -0,0 +1,3 @@
> +# TEST: Unsupported storage content type in a volume disk
> +# EXPECT_ERROR: storage 'noimages' does not support content-type 'images'
> +scsi0: noimages:8006/vm-8006-disk-0.raw,iothread=1,size=32G
> diff --git a/test/run_config2command_tests.pl b/test/run_config2command_tests.pl
> index 2feebd4a..440682d4 100755
> --- a/test/run_config2command_tests.pl
> +++ b/test/run_config2command_tests.pl
> @@ -31,6 +31,10 @@ my $base_env = {
>  		type => 'dir',
>  		shared => 0,
>  	    },
> +	    noimages => {
> +		path => '/var/lib/vz',
> +		type => 'dir',
> +	    },

I'd add some other content type in this hash. Because we have default
content types, this is not a hash that could be reached by parsing a
storage configuration. Just to avoid any potential (future) breakage
with not having a 'content' key at all.

>  	    'btrfs-store' => {
>  		content => {
>  		    images => 1,





More information about the pve-devel mailing list