]> git.puffer.fish Git - matthieu/pve-network.git/commitdiff
update tests following changes to behaviour:
authorLou Lecrivain <lou.lecrivain@wdz.de>
Fri, 13 Dec 2024 19:45:40 +0000 (20:45 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Apr 2025 15:58:20 +0000 (17:58 +0200)
- allocating IPs also when prefix-only
- PVE IPAM register details for every allocation strategy

Signed-off-by: lou lecrivain <lou.lecrivain@wdz.de>
Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
Link: https://lore.proxmox.com/mailman.185.1734119199.332.pve-devel@lists.proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/test/run_test_subnets.pl
src/test/run_test_vnets_blackbox.pl

index d1af0b3730dbf1e9709961b734b25066c15274b4..79186c2edd95b2590cc3b6871528d36ab1e3f0b9 100755 (executable)
@@ -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
index f7caca29926255898c068b39bfb4e9ac31d3ce9e..b79e1dc527bd2ef736e712291861df123cd0961f 100755 (executable)
@@ -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";