[pve-devel] [PATCH ksm-control-daemon] ksmtuned: use PSS instead of RSZ for caluculating memory usage

2024-04-08 Thread Stefan Lendl
PSS properly accounts for memory usage of shared libraries and is therefore better suited when summing up memory usage of multiple processes. Signed-off-by: Stefan Lendl --- debian/patches/series | 1 + debian/patches/use-pss-instead-of-rsz.diff | 11 +++ 2 files

Re: [pve-devel] [PATCH ksm-control-daemon] ksmtuned: fix large number processing

2024-04-08 Thread Stefan Lendl
Thomas Lamprecht writes: > Am 08/04/2024 um 14:04 schrieb Stefan Lendl: >> I agree summing up processes it would make sense to use PSS. >> Unfortunately, ps does not report the PSS. > > The `ps` from the Debian Bookworm version of the `procps` package does report > it

[pve-devel] [PATCH v2 ksm-control-daemon 1/2] ksmtuned: revert to use rsz instead of vsz to compute memory usage

2024-04-08 Thread Stefan Lendl
For summing up actual memory usage of precesses rsz is more suitable then vsz. This reverts commit cd5cf20cc8af53427dcb9b08486c68f376ce8743. Signed-off-by: Stefan Lendl --- debian/patches/series | 1 - debian/patches/use-vsz-instead-of-rsz.diff | 13 - 2 files

[pve-devel] [PATCH v2 ksm-control-daemon 2/2] ksmtuned: fix formatting when summing up large numbers

2024-04-08 Thread Stefan Lendl
awk internally uses float for every calculation, printing a large float with awk results in 1.233e+09 format which causes the script to fail afterwards. Instead I am printing the float without decimals. Signed-off-by: Stefan Lendl --- debian/patches/awk-printf.diff | 16 debian

Re: [pve-devel] [PATCH ksm-control-daemon] ksmtuned: fix large number processing

2024-04-08 Thread Stefan Lendl
Thomas Lamprecht writes: > Hi, > > Am 28/02/2024 um 23:47 schrieb Roland: >> any reason why this did not get a response ?  (i do not see rejection of >> this  ,nor did it appear in >> https://git.proxmox.com/?p=ksm-control-daemon.git;a=summary ) > > No reason, but even if this looks pretty straig

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
: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara Reviewed-by: Stefan Hanreich Tested-by: Stefan Hanreich --- src/test/Makefile | 5 +- src/test/run_test_vnets_blackbox.pl | 894 2 files changed, 898 insertions(+), 1 deletion

[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 +++ b/debian

[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
sdn: dhcp: rollback allocated ips on failure Stefan Lendl (10): sdn: dhcp: get next free ip for a specific IP version sdn: dhcp: request both IPv4 and IPv6 addresses on VM start sdn: zones: extract function that reads datacenter config dns: dnsmasq: extract function to systemctl command.

[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 --- src/PVE/API2/Network

[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
Lendl Tested-by: Stefan Lendl Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Vnets.pm | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN/Vnets.pm b/src/PVE/Network/SDN/Vnets.pm index cbf0a07..45292e3 100644 --- a/src/PVE/Network/SDN/Vnets.pm

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

2024-04-05 Thread Stefan Lendl
subnet with a dhcp-range configured. Signed-off-by: Stefan Hanreich Reviewed-by: Stefan Lendl Tested-by: Stefan Lendl Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Vnets.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/Network/SDN/Vnets.pm b/src/PVE/Network/SDN/Vnets.pm

[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] [PATCH widget-toolkit/proxmox-backup v3 0/9] Fix #3115: VLAN Network Interface Configuration

2024-04-04 Thread Stefan Lendl
Stefan Lendl writes: > This patch series allows configuring a VLAN network interfaces in the PBS GUI > ... I sent the cover letter only to me and not to pve-devel ... will send the entire series again. ___ pve-devel mailing list pve

Re: [pve-devel] [PATCH pve-network 0/8] SDN Vnet blackbox testing

2024-04-02 Thread Stefan Lendl
sent v2 incorporating the changes and adding additional tests. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

[pve-devel] [PATCH v2 pve-network 7/9] api: extract function that creates the sdn directory.

2024-04-02 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 --- src/PVE/API2/Network/SDN/Zones.pm | 6 +- 1 file changed, 5 insertions(+), 1

[pve-devel] [PATCH v2 pve-network 4/9] dnsmasq: extract function that updates dnsmasq lease via dbus

2024-04-02 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 --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a

[pve-devel] [PATCH v2 pve-network 1/9] sdn: extract function that reads datacenter config

2024-04-02 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 --- src/PVE/Network/SDN/Zones/EvpnPlugin.pm | 3 ++- src

[pve-devel] [PATCH v2 pve-network 2/9] dnsmasq: extract function to systemctl command.

2024-04-02 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 --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 18 -- 1 file changed, 12 insertions

[pve-devel] [PATCH v2 pve-network 3/9] dnsmasq: extract function that generates the ethers file path

2024-04-02 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 --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm b/src/PVE

[pve-devel] [PATCH v2 pve-network 8/9] tests: test VNets functionality as a blackbox

2024-04-02 Thread Stefan Lendl
: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara --- src/test/Makefile | 5 +- src/test/run_test_vnets_blackbox.pl | 859 2 files changed, 863 insertions(+), 1 deletion(-) create mode 100755 src/test/run_test_vnets_blackbox.pl diff

[pve-devel] [PATCH v2 pve-network 9/9] tests: remove old Vnets tests

2024-04-02 Thread Stefan Lendl
The did not work and were primarily testing against internal state. Signed-off-by: Stefan Lendl --- src/test/run_test_vnets.pl | 343 - 1 file changed, 343 deletions(-) delete mode 100755 src/test/run_test_vnets.pl diff --git a/src/test/run_test_vnets.pl b

[pve-devel] [PATCH v2 pve-network 6/9] evpn: extract function that reads frr config.

2024-04-02 Thread Stefan Lendl
read_local_frr_config reads /etc/frr/frr.conf.local. This allows mocking local fs access in tests. Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 10 -- 1 file changed, 8 insertions(+), 2 deletions

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

2024-04-02 Thread Stefan Lendl
-> v2: * Add tests that expect a failure when no IP can be allocated * Removed commented out debug stuff Stefan Lendl (9): sdn: extract function that reads datacenter config dnsmasq: extract function to systemctl command. dnsmasq: extract function that generates the ethers file path dnsm

[pve-devel] [PATCH v2 pve-network 5/9] controllers: extract function that reads network intreaces config

2024-04-02 Thread Stefan Lendl
read_etc_network_interfaces reads /etc/network/interfaces. This allows mocking access to local fs. Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara --- src/PVE/Network/SDN/Controllers.pm | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff

Re: [pve-devel] [PATCH v2 pve-network 0/5] SDN tests in sbuild

2024-04-02 Thread Stefan Lendl
Thanks for the review. I rebased the commits for v3 I re-enabled DNS. I do not recall why it failed on my last rebase attempt. ___ 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 3/5] tests: mocking more functions to avoid system access

2024-04-02 Thread Stefan Lendl
previously extracted functions are now mocked in the zone tests Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara --- src/test/run_test_zones.pl | 31 +++ 1 file changed, 31 insertions(+) diff --git a/src/test/run_test_zones.pl b/src/test

[pve-devel] [PATCH v3 pve-network 5/5] gitignore: build artifacts from sbuild

2024-04-02 Thread Stefan Lendl
source package *.dsc build log *.build tarball *.tar.xz Signed-off-by: Stefan Lendl --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 60332cc..4694865 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ *.deb +/*.build /*.buildinfo

[pve-devel] [PATCH v3 pve-network 4/5] tests: run tests in sbuild

2024-04-02 Thread Stefan Lendl
Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index c9dee4c..c4056b4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,7 +10,7 @@ clean: .PHONY

[pve-devel] [PATCH v3 pve-network 1/5] controllers: extract read_etc_network_interfaces

2024-04-02 Thread Stefan Lendl
to allow mocking local fs access Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara --- src/PVE/Network/SDN/Controllers.pm | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers.pm b/src/PVE/Network/SDN

[pve-devel] [PATCH v3 pve-network 2/5] evpn: extract read_local_frr_config

2024-04-02 Thread Stefan Lendl
to allow mocking local fs access Signed-off-by: Stefan Lendl Reviewed-by: Max Carrara Tested-by: Max Carrara --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src

[pve-devel] [PATCH v3 pve-network 0/5] SDN: Add mocking to run tests in sbuild

2024-04-02 Thread Stefan Lendl
nes * Not importing Dumper in zones test * Re-Enabled DNS tests * Added .gitignore which was previously a separate patch Changes v1 -> v2: * Disabled DNS tests because they fail Stefan Lendl (5): controllers: extract read_etc_network_interfaces evpn: extract read_local_frr_config tests: m

Re: [pve-devel] [PATCH pve-network 8/8] test(vnets): add test_vnets_blackbox

2024-03-18 Thread Stefan Lendl
"Max Carrara" writes: > On Wed Jan 3, 2024 at 4:37 PM CET, Stefan Lendl wrote: >> Add several tests for Vnets. 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 sta

Re: [pve-devel] [PATCH pve-network 1/2] gitignore: build artifacts from sbuild

2024-03-07 Thread Stefan Lendl
ping, still applies! ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Re: [pve-devel] [PATCH pve-network 4/4] tests: run tests in sbuild

2024-03-07 Thread Stefan Lendl
rebased and sent v2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

[pve-devel] [PATCH v2 pve-network 3/5] tests: mocking more functions to avoid system access

2024-03-07 Thread Stefan Lendl
previously extracted functions are now mocked in the zone tests Signed-off-by: Stefan Lendl --- src/test/run_test_zones.pl | 36 +++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/test/run_test_zones.pl b/src/test/run_test_zones.pl index

[pve-devel] [PATCH v2 pve-network 5/5] tests: run tests in sbuild

2024-03-07 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index c9dee4c..c4056b4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,7 +10,7 @@ clean: .PHONY: test test: - [ -e /run/lock/sbuild

[pve-devel] [PATCH v2 pve-network 0/5] SDN tests in sbuild

2024-03-07 Thread Stefan Lendl
Extract and mock functions that otherwise access system files which is not possible in a clean sbuild environment. Namely /etc/network/interfaces as well as /etc/frr/frr.config.local Disabling DNS tests Changes v1 -> v2: * Disabled DNS tests because they fail Stefan Lendl (5): refac

[pve-devel] [PATCH v2 pve-network 4/5] tests: disable failing DNS tests

2024-03-07 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- src/test/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/Makefile b/src/test/Makefile index eb59d5f..db70c89 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -1,6 +1,6 @@ all: test -test: test_zones test_ipams

[pve-devel] [PATCH v2 pve-network 1/5] refactor(controllers): extract read_etc_network_interfaces

2024-03-07 Thread Stefan Lendl
to allow mocking local fs access Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Controllers.pm | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers.pm b/src/PVE/Network/SDN/Controllers.pm index 167d3ea..fd7ad54 100644 --- a

[pve-devel] [PATCH v2 pve-network 2/5] refactor(evpn): extract read_local_frr_config

2024-03-07 Thread Stefan Lendl
to allow mocking local fs access Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index

Re: [pve-devel] [PATCH ksm-control-daemon] ksmtuned: fix large number processing

2024-02-29 Thread Stefan Lendl
Roland writes: > Hi Stefan, > > looks good for me so far and indeed, on very large system when VMs eat > up >2TB this could hit the limit very soon. > > but shouldn't we add some newline , as the original "print sum" prints one ? > > root@s740:/usr/sbin# seq 1 10 | awk '{ sum += $1 }; END { p

Re: [pve-devel] [PATCH ksm-control-daemon] ksmtuned: fix large number processing

2024-02-29 Thread Stefan Lendl
Roland writes: > oh, and shouldn't we also add that to total and free_memory calculation, > even chances are less that the limit is hit there ? > > total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo` total does not require the printf fix because it does not do any calculation. The "print $2" ope

Re: [pve-devel] [PATCH ksm-control-daemon] ksmtuned: fix large number processing

2024-02-29 Thread Stefan Lendl
s|Cached):/ {free += $2}; END {print free}' \ >     /proc/meminfo > } > > Am 25.01.24 um 11:56 schrieb Stefan Lendl: >> diff --git a/debian/patches/awk-printf.diff b/debian/patches/awk-printf.diff >> new file mode 100644 >> index 000..11a95

Re: [pve-devel] [PATCH v1 installer 08/18] auto-installer: add answer file definition

2024-02-23 Thread Stefan Lendl
Aaron Lauterer writes: > Signed-off-by: Aaron Lauterer > --- > proxmox-auto-installer/src/answer.rs | 147 +++ > proxmox-auto-installer/src/lib.rs| 1 + > 2 files changed, 148 insertions(+) > create mode 100644 proxmox-auto-installer/src/answer.rs > > diff --git a

[pve-devel] [PATCH zfsonlinux] Fix #5101: exports with sharenfs remain after zfs mount -a

2024-01-29 Thread Stefan Lendl
When running `zfs mount -a`, prevent the exported datasets (with sharenfs) to be truncated (unexported). Adds tests to verify shares persist after mount -a Signed-off-by: Stefan Lendl --- This was merged upstream via https://github.com/openzfs/zfs/pull/15660 ...do-not-truncate-shares-not-zfs

[pve-devel] [PATCH ksm-control-daemon] ksmtuned: fix large number processing

2024-01-25 Thread Stefan Lendl
awk internally uses float for every calculation, printing a large float with awk results in 1.233e+09 format which causes the script to fail afterwards. Instead I am printing the float without decimals. Signed-off-by: Stefan Lendl --- debian/patches/awk-printf.diff | 16 debian

[pve-devel] [PATCH pve-network 5/8] refactor(controllers): extract read_etc_network_interfaces

2024-01-03 Thread Stefan Lendl
to allow mocking local fs access. Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Controllers.pm | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers.pm b/src/PVE/Network/SDN/Controllers.pm index 167d3ea..fd7ad54 100644 --- a

[pve-devel] [PATCH pve-network 4/8] refactor(dnsmasq): extract update_lease function

2024-01-03 Thread Stefan Lendl
that calls the dbus service. can be mocked. Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm index 5a227ba

[pve-devel] [PATCH pve-network 2/8] refactor(dnsmasq): extract systemctl_service function

2024-01-03 Thread Stefan Lendl
inside Dnsmasq.pm call systemctl services via a sub to allow mocking in tests. Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm b/src/PVE/Network/SDN

[pve-devel] [PATCH pve-network 8/8] test(vnets): add test_vnets_blackbox

2024-01-03 Thread Stefan Lendl
subnet configuration wiht and without a dhcp-range configured and with or without an already present IP in the IPAM. Several of the tests fail and uncovers bugs, that shall be fixed in subsequent commits. Signed-off-by: Stefan Lendl --- src/test/Makefile | 5 +- src/test

[pve-devel] [PATCH pve-network 6/8] refactor(evpn): extract read_local_frr_config

2024-01-03 Thread Stefan Lendl
to allow mocking local fs access. Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index

[pve-devel] [PATCH pve-network 7/8] refactor(api): extract create_etc_interfaces_sdn_dir

2024-01-03 Thread Stefan Lendl
can be mocked in tests to prevent system fs access in tests Signed-off-by: Stefan Lendl --- src/PVE/API2/Network/SDN/Zones.pm | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/Network/SDN/Zones.pm b/src/PVE/API2/Network/SDN/Zones.pm index b09c9ad..35e2f7f

[pve-devel] [PATCH pve-network 3/8] refactor(dnsmasq): extract ethers_file function

2024-01-03 Thread Stefan Lendl
That generates the ethers path so that it can be mocked. Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm index f9f1c39

[pve-devel] [PATCH pve-network 1/8] refactor(sdn): extract cfs_read_file(datacenter.cfg)

2024-01-03 Thread Stefan Lendl
to datacenter_config() functions in Zones::Plugin. This allows mocking the datacenter.cfg in tests. Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Zones/EvpnPlugin.pm | 3 ++- src/PVE/Network/SDN/Zones/Plugin.pm | 5 + src/PVE/Network/SDN/Zones/SimplePlugin.pm | 2 +- 3 files

[pve-devel] [PATCH pve-network 0/8] SDN Vnet blackbox testing

2024-01-03 Thread Stefan Lendl
staring on a vnet with different subnet configurations. Further descriptions in the commit. Stefan Lendl (8): refactor(sdn): extract cfs_read_file(datacenter.cfg) refactor(dnsmasq): extract systemctl_service function refactor(dnsmasq): extract ethers_file function refactor(dnsmasq): extract

Re: [pve-devel] [PATCH pve-network 3/4] tests: mocking more functions to avoid access to system files

2023-12-05 Thread Stefan Lendl
Lukas Wagner writes: > > Left-over debug code? :) Yes, I am not actually using this here. This is also included in the other tests. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

[pve-devel] [PATCH pve-network 1/2] gitignore: build artifacts from sbuild

2023-12-05 Thread Stefan Lendl
source package *.dsc build log *.build tarball *.tar.xz Signed-off-by: Stefan Lendl --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 60332cc..90aa0f8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ /*.changes /.vscode/ /libpve

[pve-devel] [PATCH pve-network 2/2] gitignore: sort gitignore

2023-12-05 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 90aa0f8..4694865 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ *.deb +/*.build /*.buildinfo /*.changes +/*.dsc /.vscode/ /libpve

[pve-devel] [PATCH pve-network 2/4] refactor(evpn): extract read_local_frr_config

2023-12-05 Thread Stefan Lendl
Allows mocking local fs access Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index

[pve-devel] [PATCH pve-network 3/4] tests: mocking more functions to avoid access to system files

2023-12-05 Thread Stefan Lendl
would require system access. Just to be sure. Added a note that mocking INotify::read_file is a HACK and not garanteed to work if anything other than /etc/network/interfaces is read. Signed-off-by: Stefan Lendl --- src/test/run_test_zones.pl | 36 +++- 1 file

[pve-devel] [PATCH pve-network 1/4] refactor(controllers): extract read_etc_network_interfaces

2023-12-05 Thread Stefan Lendl
Allows mocking local fs access Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Controllers.pm | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers.pm b/src/PVE/Network/SDN/Controllers.pm index 167d3ea..fd7ad54 100644 --- a

[pve-devel] [PATCH pve-network 4/4] tests: run tests in sbuild

2023-12-05 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index c9dee4c..c4056b4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,7 +10,7 @@ clean: .PHONY: test test: - [ -e /run/lock/sbuild

[pve-devel] [PATCH pve-network 0/4] SDN tests in sbuild

2023-12-05 Thread Stefan Lendl
Extract and mock functions that otherwise access system files which is not possible in a clean sbuild environment. Namely /etc/network/interfaces as well as /etc/frr/frr.config.local Stefan Lendl (4): refactor(controllers): extract read_etc_network_interfaces refactor(evpn): extract

[pve-devel] [PATCH pve-network 4/4] tests: run tests in sbuild

2023-12-05 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index c9dee4c..c4056b4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,7 +10,7 @@ clean: .PHONY: test test: - [ -e /run/lock/sbuild

[pve-devel] [PATCH pve-network] tests: mocking cfs_lock_file to pass subnet tests

2023-11-24 Thread Stefan Lendl
IPAM tries to lock file in clusterfs which it can't when testing as non-root. Mocking cfs_lock_file to emulate locking behavior. Signed-off-by: Stefan Lendl --- src/test/run_test_subnets.pl | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src

Re: [pve-devel] [PATCH v2 pve-network] sdn: require mac in IPAM API calls

2023-11-23 Thread Stefan Lendl
sorry, I sent this twice. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

[pve-devel] [PATCH v2 pve-network] sdn: require mac in IPAM API calls

2023-11-23 Thread Stefan Lendl
standard_option for 'mac-addr' is declared in EVPN where mac-addr is optional. The DELETE endpoint did actually delete from IPAM without a MAC but it would remain in macs.db which brings ends up in a bad state. Signed-off-by: Stefan Lendl --- Changes v2: * removed the if($mac)

Re: [pve-devel] [PATCH pve-network] sdn: require mac in IPAM API calls

2023-11-23 Thread Stefan Lendl
sent v2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

[pve-devel] [PATCH v2 pve-network] sdn: require mac in IPAM API calls

2023-11-23 Thread Stefan Lendl
standard_option for 'mac-addr' is declared in EVPN where mac-addr is optional. The DELETE endpoint did actually delete from IPAM without a MAC but it would remain in macs.db which brings ends up in a bad state. Signed-off-by: Stefan Lendl --- Changes v2: * removed the if($mac)

[pve-devel] [PATCH pve-network] sdn: require mac in IPAM API calls

2023-11-23 Thread Stefan Lendl
standard_option for 'mac-addr' is declared in EVPN where mac-addr is optional. The DELETE endpoint did actually delete from IPAM without a MAC but it would remain in macs.db which brings ends up in a bad state. Signed-off-by: Stefan Lendl --- src/PVE/API2/Network/SDN/I

[pve-devel] [PATCH pve-network] sdn: Avoid warning of uninitialized variable on VM start

2023-11-23 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Vnets.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PVE/Network/SDN/Vnets.pm b/src/PVE/Network/SDN/Vnets.pm index 0dfdfd7..4f313e3 100644 --- a/src/PVE/Network/SDN/Vnets.pm +++ b/src/PVE/Network/SDN/Vnets.pm @@ -200,6 +200,8

Re: [pve-devel] [PATCH pve-network] ipam: improve update / delete behavior

2023-11-22 Thread Stefan Lendl
I tested this with multiple Subnets: It works if MAC is 1x in IPv4 subnet and 1x in IPv6 subnet. - updating either IPv4 or IPv6 - other one persists - update IPv4 to be in another subnet - auto-selects the new subnet Encountered issues: - change IPv4 to IPv6 (and vice versa) > can't find an

Re: [pve-devel] [PATCH pve-network] fix dhcpv6 router advertisement

2023-11-22 Thread Stefan Lendl
Thank you for the update. This works now. I tested with IPv6 only and dual stack. - ping gateway - ping VM - hotplug NIC and get a new IP - migration ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/lis

Re: [pve-devel] [PATCH v4 cluster/network/manager/qemu-server/container/docs 00/33] Add support for DHCP servers to SDN

2023-11-21 Thread Stefan Lendl
"DERUMIER, Alexandre" writes: > Another example with custom dhcpv6 options + client script > > https://serverfault.com/a/528425 Thank you very much for clarifying. So the /128 is fine. I also tried to ping6 dead:beef::1 to reach the gateway or from the host to reach the VM and that did not work

[pve-devel] [PATCH pve-container 2/3] sdn: pass vmid and hostname to add_dhcp_mapping

2023-11-21 Thread Stefan Lendl
If no DHCP mapping was found in IPAM it will request a new IP. In order to register an IPAM mapping it requires these values. Signed-off-by: Stefan Lendl --- src/PVE/LXC.pm| 4 ++-- src/lxc-pve-prestart-hook | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src

[pve-devel] [PATCH qemu-server 3/3] sdn: pass vmid and hostname to add_dhcp_mapping

2023-11-21 Thread Stefan Lendl
if no DHCP mapping was found in IPAM it will request a new IP which requires these values. Signed-off-by: Stefan Lendl --- PVE/QemuServer.pm | 2 +- vm-network-scripts/pve-bridge | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE

[pve-devel] [PATCH pve-network 1/3] sdn: register MAC in IPAM if not found

2023-11-21 Thread Stefan Lendl
demand. In order to properly register the IP, the VMID and hostname is required as a parameter. Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Vnets.pm | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PVE/Network/SDN/Vnets.pm b/src/PVE/Network/SDN/Vnets.pm

[pve-devel] [PATCH network/container/qemu-server 0/3] sdn: register a new IP at VM start if missing

2023-11-21 Thread Stefan Lendl
covered: If a subnet with IPv4 exists and VMs are present, adding a new subnet with IPv6, this will not register an IPv6. And vice-versa. pve-network: Stefan Lendl (1): sdn: register MAC in IPAM if not found src/PVE/Network/SDN/Vnets.pm | 10 -- 1 file changed, 8 insertions(+), 2

Re: [pve-devel] [PATCH v4 cluster/network/manager/qemu-server/container/docs 00/33] Add support for DHCP servers to SDN

2023-11-21 Thread Stefan Lendl
"DERUMIER, Alexandre" writes: >>>  * dnsmasq and IPv6 (and DHCP in general) do not really play well >>>together, >>>    so using subnets with IPv6 configured is wonky > > I didn't have tested yet, but it's seem that dnsmasq only support old > classic duid reservation and not mac ? > I tested the

[pve-devel] [PATCH pve-docs] gitignore

2023-11-17 Thread Stefan Lendl
build output and temporary intermediate files Signed-off-by: Stefan Lendl --- .gitignore | 11 +++ 1 file changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index 36e2dd5..4f95ee9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,14 @@ *.tmp *.epub *.swp +/#*# +/.pve

[pve-devel] [PATCH pve-container] gitignore

2023-11-17 Thread Stefan Lendl
build output Signed-off-by: Stefan Lendl --- .gitignore | 4 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..e9d7353 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/pve-container-*/ +/*.deb

[pve-devel] [PATCH pve-manager] gitignore

2023-11-17 Thread Stefan Lendl
build outputs Signed-off-by: Stefan Lendl --- .gitignore | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a6ab4ea7..a4093add 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,8 @@ dest/ *.buildinfo *.changes -www/manager6

[pve-devel] [PATCH pve-network] gitignore

2023-11-17 Thread Stefan Lendl
build outputs Signed-off-by: Stefan Lendl --- .gitignore | 5 + 1 file changed, 5 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..6370dfa --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/libpve-network-perl-*/ +*.deb

[pve-devel] [PATCH qemu-server] gitignore

2023-11-17 Thread Stefan Lendl
build output and .vscode Signed-off-by: Stefan Lendl --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e48cf98..caaef23 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ sparsecp vmtar build qm.bash-completion +/.vscode/ +/qemu-server

Re: [pve-devel] [PATCH v4 pve-network 06/33] subnet: vnet: refactor IPAM related methods

2023-11-17 Thread Stefan Lendl
Stefan Hanreich writes: > @@ -230,10 +227,28 @@ sub next_free_ip { > my $plugin_config = $ipam_cfg->{ids}->{$ipamid}; > my $plugin = > PVE::Network::SDN::Ipams::Plugin->lookup($plugin_config->{type}); > eval { > - $cidr = $plugin->add_next_freeip($plugin_config, $subnet

Re: [pve-devel] [PATCH pve-docs] sdn: update documentation

2023-11-17 Thread Stefan Lendl
sent v2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

[pve-devel] [PATCH pve-network] sdn: allow deletion of empty subnet with gateway

2023-11-17 Thread Stefan Lendl
If the gateway IP is last remaining IP in the subnet (in IPAM), allow deleting the subnet. Signed-off-by: Stefan Lendl --- src/PVE/Network/SDN/Ipams/PVEPlugin.pm | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm b/src

[pve-devel] [PATCH v2 pve-docs 6/6] sdn: Examples

2023-11-17 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- pvesdn.adoc | 486 +++- 1 file changed, 180 insertions(+), 306 deletions(-) diff --git a/pvesdn.adoc b/pvesdn.adoc index 450955d..17135cc 100644 --- a/pvesdn.adoc +++ b/pvesdn.adoc @@ -508,74 +508,96 @@ key:: An API

[pve-devel] [PATCH v2 pve-docs 2/6] sdn: Zones

2023-11-17 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- pvesdn.adoc | 185 ++-- 1 file changed, 93 insertions(+), 92 deletions(-) diff --git a/pvesdn.adoc b/pvesdn.adoc index 562e081..8a71c03 100644 --- a/pvesdn.adoc +++ b/pvesdn.adoc @@ -86,189 +86,190 @@ in your SDN

[pve-devel] [PATCH v2 pve-docs 4/6] sdn: Controllers

2023-11-17 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- pvesdn.adoc | 56 + 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/pvesdn.adoc b/pvesdn.adoc index c4b77f0..73d3dee 100644 --- a/pvesdn.adoc +++ b/pvesdn.adoc @@ -336,36 +336,41 @@ DNS Zone

[pve-devel] [PATCH v2 pve-docs 1/6] sdn: installation, overview and main configuration

2023-11-17 Thread Stefan Lendl
refs only work with subsequent patches Signed-off-by: Stefan Lendl --- pvesdn.adoc | 67 + 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/pvesdn.adoc b/pvesdn.adoc index b796c5e..562e081 100644 --- a/pvesdn.adoc +++ b

[pve-devel] [PATCH v2 pve-docs 3/6] sdn: VNets and Subnets

2023-11-17 Thread Stefan Lendl
Signed-off-by: Stefan Lendl --- pvesdn.adoc | 46 -- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/pvesdn.adoc b/pvesdn.adoc index 8a71c03..c4b77f0 100644 --- a/pvesdn.adoc +++ b/pvesdn.adoc @@ -272,32 +272,40 @@ MTU:: Because VXLAN

[pve-devel] [PATCH v2 pve-docs 0/6] sdn: Documentation

2023-11-17 Thread Stefan Lendl
quot; and now the format is identical on all headings. Stefan Lendl (6): sdn: installation, overview and main configuration sdn: Zones sdn: VNets and Subnets sdn: Controllers sdn: IPAM sdn: Examples pvesdn.adoc | 906 +++- 1 file

  1   2   >