[pve-devel] [PATCH v4 installer 31/30 follow-up] auto-installer: answer: deny unknown fields

2024-04-05 Thread Aaron Lauterer
This way, serde will throw errors if fields are not known. This can help to reduce frustration if one might think to have set an option, but for example a small type has happened. Signed-off-by: Aaron Lauterer --- Since Christoph mentioned it I tried to implement it. Tested quickly with the

Re: [pve-devel] [PATCH v2 pve-network 0/9] SDN: Testing VNets as a blackbox.

2024-04-05 Thread Stefan Lendl
sent v3 which fixes also the broken tests. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

[pve-devel] [PATCH v3 pve-network 08/12] sdn: dnsmasq: extract function that updates dnsmasq lease via dbus

2024-04-05 Thread Stefan Lendl
Extract the dbus based interactions with dnsmasq so that it can be mocked in tests. Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 22 -- 1 file

[pve-devel] [PATCH v3 pve-network 11/12] tests: test VNets functionality as a blackbox

2024-04-05 Thread Stefan Lendl
Add several tests for Vnets in test_vnets_blackbox. State setup as well as testing results is done only via the API to test on the API boundaries not not against the internal state. Internal state is mocked to avoid requiring access to system files or pmxcfs. Mocking is done by reading and

[pve-devel] [PATCH v3 pve-network 12/12] tests: remove old Vnets tests

2024-04-05 Thread Stefan Lendl
The did not work and were primarily testing against internal state. Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich --- src/test/run_test_vnets.pl | 343 - 1 file changed,

[pve-devel] [PATCH v3 pve-network 10/12] debian: blackbox tests depend on libpve-access-control at build

2024-04-05 Thread Stefan Lendl
For mocking RPCEnvironment in sbuild. Signed-off-by: Stefan Lendl Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 6f0bbeb..1f97196 100644 --- a/debian/control +++

[pve-devel] [PATCH v3 pve-network 06/12] dns: dnsmasq: extract function to systemctl command.

2024-04-05 Thread Stefan Lendl
systemctl_service() is a wrapper around PVE::Tools::run_command to allow mocking the systemctl interactions in tests. Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm |

[pve-devel] [PATCH v3 pve-network 00/12] SDN: Testing VNets as a blackbox and fixing found bugs

2024-04-05 Thread Stefan Lendl
This add several tests for SDN VNets. State setup as well as testing results is done only via the API to test on the API boundaries and not against the internal state. Internal state and config files are mocked to avoid requiring access to system files or pmxcfs. The first 4 commits fix

[pve-devel] [PATCH v3 pve-network 01/12] sdn: dhcp: get next free ip for a specific IP version

2024-04-05 Thread Stefan Lendl
Specify the IP version (4|6) for which an IP shall be requested from the IPAM. Signed-off-by: Stefan Lendl Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich --- src/PVE/Network/SDN/Subnets.pm | 2 +- src/PVE/Network/SDN/Vnets.pm | 6 +++--- 2 files changed, 4 insertions(+), 4

[pve-devel] [PATCH v3 pve-network 09/12] sdn: api: extract function that creates the sdn directory.

2024-04-05 Thread Stefan Lendl
create_etc_interfaces_sdn_dir creates the /etc/pve/sdn directory. This allows mocking in tests to prevent system fs access in tests Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich ---

[pve-devel] [PATCH v3 pve-network 05/12] sdn: zones: extract function that reads datacenter config

2024-04-05 Thread Stefan Lendl
The datacenter_config() functions in SDN::Zones::Plugin is a simple wrapper that reads datacenter.cfg via cfs. This allows mocking datacenter.cfg in tests. Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich ---

[pve-devel] [PATCH v3 pve-network 07/12] sdn: dnsmasq: extract function that generates the ethers file path

2024-04-05 Thread Stefan Lendl
Extracted to a function so it can be mocked in tests. Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[pve-devel] [PATCH v3 pve-network 04/12] sdn: dhcp: rollback allocated ips on failure

2024-04-05 Thread Stefan Lendl
From: Stefan Hanreich If DHCP is configured for IPv4 and IPv6, failing to obtain an IPv6 IP does not roll back the allocation made for IPv4. This patch rolls back any changes made in case of failure, so that IP allocation is actually atomic. Signed-off-by: Stefan Hanreich Reviewed-by: Stefan

[pve-devel] [PATCH v3 pve-network 03/12] sdn: dhcp: only consider subnets that have dhcp-range configured

2024-04-05 Thread Stefan Lendl
From: Stefan Hanreich If DHCP is enabled on a zone with subnets, but no subnet has a dhcp-range configured, then starting a VM will fail because no IP can be allocated. This patch fixes this by only considering subnets that have a dhcp-range configured and only failing if there is at least one

[pve-devel] [PATCH v3 pve-network 02/12] sdn: dhcp: request both IPv4 and IPv6 addresses on VM start

2024-04-05 Thread Stefan Lendl
If previously an IP was allocated in the IPAM, but a new subnet added for the other IP version, we need to allocate an IP in the new subnet. Signed-off-by: Stefan Lendl Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich --- src/PVE/Network/SDN/Vnets.pm | 10 -- 1 file changed, 4

Re: [pve-devel] applied: [PATCH container v2 2/6] api: status: move config locking from API handler into worker

2024-04-05 Thread Friedrich Weber
On 04/04/2024 17:26, Thomas Lamprecht wrote: > Oh, and it might be worth mentioning explicitly in the next release notes, > as it's a change in behavior that could theoretically throw up some > tooling that depends on the $action not failing due to locking if the > adapted endpoints returned –

Re: [pve-devel] [PATCH guest-common v2 1/6] guest helpers: add helper to overrule active tasks of a specific type

2024-04-05 Thread Friedrich Weber
Thanks for the review! On 04/04/2024 17:20, Thomas Lamprecht wrote: > Am 30/01/2024 um 18:10 schrieb Friedrich Weber: > > Maybe start of with "Add a helper to abort all tasks from a specific > (type, user, vmid) tuple. It will be used ... Will do. >> This helper is used to abort any active

Re: [pve-devel] [PATCH installer v4 00/30] add automated/unattended installation

2024-04-05 Thread Christoph Heiss
I've tested mostly the same things as for v3 [0], to confirm nothing broke since that: - Using a few different values for `global` options - Install on ext4, xfs, Btrfs RAID1 and ZFS RAID10 (with different values in multiple runs) - Using DHCP and static IP - Fetching answer from a partition -

[pve-devel] applied: [PATCH pve-kernel] revert 2 changes in thermal driver causing an early kernel Oops.

2024-04-05 Thread Thomas Lamprecht
Am 05/04/2024 um 11:27 schrieb Stoiko Ivanov: > The second patch, that is reverted (first): > `thermal: trip: Drop lockdep assertion from thermal_zone_trip_id()` > only touches code introduced by the first patch. > The first patch causes the following Oops (reproduced on an old > HP DL380 G8): >

[pve-devel] [PATCH installer v4 13/30] auto-installer: add tests for answer file parsing

2024-04-05 Thread Aaron Lauterer
By matching the resulting json to be passed to the low level installer against known good ones. The environment info was gathered from one of our AMD Epyc Rome test servers to have a realistic starting point. Signed-off-by: Aaron Lauterer --- proxmox-auto-installer/tests/parse-answer.rs | 106

[pve-devel] [PATCH pve-kernel] revert 2 changes in thermal driver causing an early kernel Oops.

2024-04-05 Thread Stoiko Ivanov
The second patch, that is reverted (first): `thermal: trip: Drop lockdep assertion from thermal_zone_trip_id()` only touches code introduced by the first patch. The first patch causes the following Oops (reproduced on an old HP DL380 G8): ``` [2.960519] ACPI: button: Power Button [PWRF] [