mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-04-28 20:53:27 +00:00
test: add test case exposing issue with unknown sections
While unknown sections do lead to an error in strict mode, in non-strict mode the line is just skipped, meaning that key-value pairs from the unknown section will override the key-value pairs from the previous section. Fixed by the next commit. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Link: https://lore.proxmox.com/20250127112923.31703-6-f.ebner@proxmox.com
This commit is contained in:
parent
df6d255b0f
commit
c80f968cc1
44
test/parse-config-expected/unknown-sections.conf
Normal file
44
test/parse-config-expected/unknown-sections.conf
Normal file
@ -0,0 +1,44 @@
|
||||
boot: order=scsi0
|
||||
cores: 2
|
||||
cpu: x86-64-v2-AES
|
||||
ide2: lvm:vm-120-cloudinit,media=cdrom
|
||||
ipconfig0: ip6=dhcp
|
||||
memory: 4096
|
||||
meta: creation-qemu=9.0.2,ctime=1725975013
|
||||
name: foo
|
||||
net0: vmxnet3=BC:24:11:2C:69:EC,bridge=vnet0,firewall=1
|
||||
numa: 0
|
||||
ostype: l26
|
||||
parent: foo
|
||||
scsi0: nfs:120/vm-120-disk-0.qcow2,iothread=1,size=4G
|
||||
scsihw: virtio-scsi-single
|
||||
smbios1: uuid=b3247ab1-1fe6-428e-965b-08a1b64a8746
|
||||
sockets: 1
|
||||
unused0: rbd:vm-120-disk-0
|
||||
vmgenid: 7079e97c-50e3-4079-afe7-23e67566b946
|
||||
|
||||
[PENDING]
|
||||
bios: seabios
|
||||
|
||||
[special:cloudinit]
|
||||
ipconfig0: ip=dhcp,ip6=dhcp
|
||||
name: bar
|
||||
|
||||
[foo]
|
||||
boot: order=scsi0
|
||||
cores: 2
|
||||
cpu: x86-64-v2-AES
|
||||
ide2: lvm:vm-120-cloudinit,media=cdrom
|
||||
ipconfig0: ip=dhcp,ip6=dhcp
|
||||
memory: 4096
|
||||
meta: creation-qemu=9.0.2,ctime=1725975013
|
||||
name: baz
|
||||
net0: vmxnet3=BC:24:11:2C:69:EC,bridge=vnet0,firewall=1
|
||||
numa: 0
|
||||
ostype: l26
|
||||
scsi0: nfs:120/vm-120-disk-0.qcow2,iothread=1,size=4G
|
||||
scsihw: virtio-scsi-single
|
||||
smbios1: uuid=b3247ab1-1fe6-428e-965b-08a1b64a8746
|
||||
snaptime: 1737548747
|
||||
sockets: 1
|
||||
vmgenid: 7079e97c-50e3-4079-afe7-23e67566b946
|
@ -0,0 +1 @@
|
||||
vm 8006 - unable to parse config: [special:unknown123]
|
57
test/parse-config-input/unknown-sections.conf
Normal file
57
test/parse-config-input/unknown-sections.conf
Normal file
@ -0,0 +1,57 @@
|
||||
boot: order=scsi0
|
||||
cores: 2
|
||||
cpu: x86-64-v2-AES
|
||||
ide2: lvm:vm-120-cloudinit,media=cdrom
|
||||
ipconfig0: ip6=dhcp
|
||||
memory: 4096
|
||||
meta: creation-qemu=9.0.2,ctime=1725975013
|
||||
name: deb1223
|
||||
net0: vmxnet3=BC:24:11:2C:69:EC,bridge=vnet0,firewall=1
|
||||
numa: 0
|
||||
ostype: l26
|
||||
parent: foo
|
||||
scsi0: nfs:120/vm-120-disk-0.qcow2,iothread=1,size=4G
|
||||
scsihw: virtio-scsi-single
|
||||
smbios1: uuid=b3247ab1-1fe6-428e-965b-08a1b64a8746
|
||||
sockets: 1
|
||||
unused0: rbd:vm-120-disk-0
|
||||
vmgenid: 7079e97c-50e3-4079-afe7-23e67566b946
|
||||
|
||||
[special:unknown123]
|
||||
name: foo
|
||||
|
||||
[PENDING]
|
||||
bios: ovmf
|
||||
|
||||
[special:unknown124]
|
||||
bios: seabios
|
||||
|
||||
[special:cloudinit]
|
||||
ipconfig0: ip=dhcp,ip6=dhcp
|
||||
name: deb122
|
||||
|
||||
[special:unknown125]
|
||||
name: bar
|
||||
|
||||
[foo]
|
||||
boot: order=scsi0
|
||||
cores: 2
|
||||
cpu: x86-64-v2-AES
|
||||
ide2: lvm:vm-120-cloudinit,media=cdrom
|
||||
ipconfig0: ip=dhcp,ip6=dhcp
|
||||
memory: 4096
|
||||
meta: creation-qemu=9.0.2,ctime=1725975013
|
||||
name: deb1223
|
||||
net0: vmxnet3=BC:24:11:2C:69:EC,bridge=vnet0,firewall=1
|
||||
numa: 0
|
||||
ostype: l26
|
||||
scsi0: nfs:120/vm-120-disk-0.qcow2,iothread=1,size=4G
|
||||
scsihw: virtio-scsi-single
|
||||
smbios1: uuid=b3247ab1-1fe6-428e-965b-08a1b64a8746
|
||||
snaptime: 1737548747
|
||||
sockets: 1
|
||||
vmgenid: 7079e97c-50e3-4079-afe7-23e67566b946
|
||||
|
||||
[:3]
|
||||
name: baz
|
||||
cat: nya~
|
@ -26,7 +26,7 @@ my $OUTPUT_DIR = './parse-config-output';
|
||||
my $EXPECTED_DIR = './parse-config-expected';
|
||||
|
||||
# NOTE update when you add/remove tests
|
||||
plan tests => 2 * 7;
|
||||
plan tests => 2 * 8;
|
||||
|
||||
sub run_tests {
|
||||
my ($strict) = @_;
|
||||
|
Loading…
Reference in New Issue
Block a user