public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lou Lecrivain via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Lou Lecrivain <lou.lecrivain@wdz.de>
Subject: [pve-devel] SPAM: [PATCH pve-network v2 4/4] update tests following changes to behaviour: - allocating IPs also when prefix-only - PVE IPAM register details for every allocation strategy
Date: Mon,  9 Dec 2024 12:31:58 +0100	[thread overview]
Message-ID: <mailman.96.1733743980.332.pve-devel@lists.proxmox.com> (raw)
In-Reply-To: <20241209113158.7343-1-lou.lecrivain@wdz.de>

[-- Attachment #1: Type: message/rfc822, Size: 6406 bytes --]

From: Lou Lecrivain <lou.lecrivain@wdz.de>
To: pve-devel@lists.proxmox.com
Subject: SPAM: [PATCH pve-network v2 4/4] update tests following changes to behaviour: - allocating IPs also when prefix-only - PVE IPAM register details for every allocation strategy
Date: Mon,  9 Dec 2024 12:31:58 +0100
Message-ID: <20241209113158.7343-5-lou.lecrivain@wdz.de>

Signed-off-by: lou lecrivain <lou.lecrivain@wdz.de>
---
 src/test/run_test_subnets.pl        | 24 +++++++++++++++++++++---
 src/test/run_test_vnets_blackbox.pl |  6 ++----
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/src/test/run_test_subnets.pl b/src/test/run_test_subnets.pl
index d1af0b3..79186c2 100755
--- a/src/test/run_test_subnets.pl
+++ b/src/test/run_test_subnets.pl
@@ -237,7 +237,13 @@ foreach my $path (@plugins) {
 	. $ip
 	. '":{"gateway":1},"'
 	. $ipnextfree
-	. '":{},"'
+	. '":{"hostname":"'
+        . $hostname
+        . '","mac":"'
+	. $mac
+	. '","vmid":"'
+	. $vmid
+        . '"},"'
 	. $ip2
 	. '":{"hostname":"'
 	. $hostname
@@ -268,7 +274,13 @@ foreach my $path (@plugins) {
 	. $subnet_cidr
 	. '":{"ips":{"'
 	. $ipnextfree
-	. '":{},"'
+	. '":{"hostname":"'
+        . $hostname
+        . '","mac":"'
+	. $mac
+	. '","vmid":"'
+	. $vmid
+        . '"},"'
 	. $ip2
 	. '":{"hostname":"'
 	. $hostname
@@ -328,7 +340,13 @@ foreach my $path (@plugins) {
 	. $subnet_cidr
 	. '":{"ips":{"'
 	. $ipnextfree
-	. '":{},"'
+	. '":{"hostname":"'
+        . $hostname
+        . '","mac":"'
+	. $mac
+	. '","vmid":"'
+	. $vmid
+        . '"},"'
 	. $ip2
 	. '":{"hostname":"'
 	. $hostname
diff --git a/src/test/run_test_vnets_blackbox.pl b/src/test/run_test_vnets_blackbox.pl
index f7caca2..b79e1dc 100755
--- a/src/test/run_test_vnets_blackbox.pl
+++ b/src/test/run_test_vnets_blackbox.pl
@@ -413,7 +413,6 @@ sub test_nic_join {
     die "$test_name: we're expecting an array of subnets" if !$subnets;
     my $num_subnets = scalar $subnets->@*;
     die "$test_name: we're expecting an array of subnets. $num_subnets elements found" if ($num_subnets < 1);
-    my $num_dhcp_ranges = scalar grep { $_->{'dhcp-range'} } $subnets->@*;
 
     my $zoneid = "TESTZONE";
     my $vnetid = "testvnet";
@@ -452,7 +451,7 @@ sub test_nic_join {
 
     my @ips = get_ips_from_mac($mac);
     my $num_ips = scalar @ips;
-    is ($num_ips, $num_dhcp_ranges, "$test_name: Expecting $num_dhcp_ranges IPs, found $num_ips");
+    is ($num_ips, $num_subnets, "$test_name: Expecting $num_subnets IPs, found $num_ips");
     ok ((all { ($_->{vnet} eq $vnetid && $_->{zone} eq $zoneid) } @ips),
 	"$test_name: all IPs in correct vnet and zone"
     );
@@ -678,8 +677,7 @@ sub test_nic_start {
     die "$test_name: we're expecting an array of subnets" if !$subnets;
     my $num_subnets = scalar $subnets->@*;
     die "$test_name: we're expecting an array of subnets. $num_subnets elements found" if ($num_subnets < 1);
-
-    $num_expected_ips = scalar grep { $_->{'dhcp-range'} } $subnets->@* if !defined $num_expected_ips;
+    $num_expected_ips = $num_subnets if !defined $num_expected_ips;
 
     my $zoneid = "TESTZONE";
     my $vnetid = "testvnet";
-- 
2.39.5



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  parent reply	other threads:[~2024-12-09 11:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20241209113158.7343-1-lou.lecrivain@wdz.de>
2024-12-09 11:31 ` [pve-devel] SPAM: [PATCH pve-network v2 1/4] vnet: do not skip if no range is defined, ask for allocation inside prefix instead Lou Lecrivain via pve-devel
2024-12-12 13:58   ` Stefan Hanreich
2024-12-09 11:31 ` [pve-devel] SPAM: [PATCH pve-network v2 2/4] dhcp: always generate dhcp-range for dnsmasq Lou Lecrivain via pve-devel
2024-12-09 11:31 ` [pve-devel] SPAM: [PATCH pve-network v2 3/4] fix: register details in pve ipam db for add_next_freeip Lou Lecrivain via pve-devel
2024-12-09 11:31 ` Lou Lecrivain via pve-devel [this message]
     [not found] ` <20241209113158.7343-3-lou.lecrivain@wdz.de>
2024-12-12 13:52   ` [pve-devel] (no subject) Stefan Hanreich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.96.1733743980.332.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=lou.lecrivain@wdz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal