[pve-devel] [RFC qemu-server 1/9] test: cfg2cmd: expect error for invalid volume's storage content type
Daniel Kral
d.kral at proxmox.com
Mon Sep 16 18:38:31 CEST 2024
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>
---
test/cfg2cmd/unsupported-storage-content-type.conf | 3 +++
test/run_config2command_tests.pl | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
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..35e789b2
--- /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 'no-images' does not support content-type 'images'
+scsi0: no-images: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 d48ef562..32d645f2 100755
--- a/test/run_config2command_tests.pl
+++ b/test/run_config2command_tests.pl
@@ -30,6 +30,10 @@ my $base_env = {
type => 'dir',
shared => 0,
},
+ 'no-images' => {
+ path => '/var/lib/vz',
+ type => 'dir',
+ },
'btrfs-store' => {
content => {
images => 1,
@@ -68,7 +72,7 @@ my $base_env = {
content => {
images => 1,
}
- }
+ },
}
},
vmid => 8006,
--
2.39.5
More information about the pve-devel
mailing list