5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2024-12-22 21:33:47 +03:00
pve-common/test
Dominik Csapak d2a6411cab SectionConfig: fix handling unknown sections
if we're parsing an unknown section, we cannot check the schema with
`is_array` to check if it's an array type or not, thus we have to
handle that separately.

fix this by handling data in unknown sections like an array similar to
"cb2646c7b4974e33f4148752deec71f0d589b0f3" in proxmox-section-config.
This way we can write unknown section out again like we parsed it.

Add a regression test for an unknown field not in the schema.

This fixes an issue, where calling `qm destroy ID --purge` removed much
of the configs ob backup jobs (since there we parse an 'unknown' section
and run into the `is_array` error)
(Reported in the forum: https://forum.proxmox.com/threads/132091)

Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-08-16 11:19:26 +02:00
..
etc_network_interfaces inotify: network: improve "allow-hotplug" & "auto" interaction 2021-09-29 09:57:59 +02:00
api_parameter_test.pl JSONSchema: add support for array parameter in api calls, cli and config 2023-06-07 13:10:50 +02:00
calendar_event_test.pl CalendarEvent: use rust implementation 2022-01-13 14:50:47 +01:00
convert_size_test.pl fix convert_size with decimal numbers and add tests 2017-12-15 11:15:50 +01:00
format_test.pl format: handle undef, 0, and decimals in render_duration 2021-02-08 14:40:38 +01:00
lock_file.pl tests: remove acquire-lock newline termination 2017-11-10 11:29:54 +01:00
Makefile JSONSchema: add support for array parameter in api calls, cli and config 2023-06-07 13:10:50 +02:00
procfs_tests.pl fix typo 2023-01-10 12:25:54 +01:00
section_config_test.pl SectionConfig: fix handling unknown sections 2023-08-16 11:19:26 +02:00