]> git.proxmox.com Git - pve-network.git/commitdiff
sdn: fix subnets && netbox ipam tests
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 17 Nov 2023 11:39:53 +0000 (12:39 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 18 Nov 2023 14:59:50 +0000 (15:59 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/test/ipams/netbox/expected.add_ip
src/test/ipams/netbox/expected.add_ip_notgateway
src/test/ipams/netbox/expected.add_next_freeip
src/test/ipams/netbox/expected.update_ip
src/test/run_test_subnets.pl

index e9323ca75429828edd37ceb2b61925da82023ab8..cd46c53f1566954348f9a797a7f03499f29a8de9 100644 (file)
@@ -1,5 +1,5 @@
 bless( {
-                  '_content' => '{"address":"10.0.0.1/24","description":"mydescription mac:da:65:8f:18:9b:6f","dns_name":"myhostname"}',
+                  '_content' => '{"address":"10.0.0.1/24","description":"gateway","dns_name":"myhostname"}',
                   '_headers' => bless( {
                                          'authorization' => 'token 0123456789abcdef0123456789abcdef01234567',
                                          'content-type' => 'application/json; charset=UTF-8'
index e9323ca75429828edd37ceb2b61925da82023ab8..5ea43cd652966b3db06f4d3e841bfb270a589992 100644 (file)
@@ -1,5 +1,5 @@
 bless( {
-                  '_content' => '{"address":"10.0.0.1/24","description":"mydescription mac:da:65:8f:18:9b:6f","dns_name":"myhostname"}',
+                  '_content' => '{"address":"10.0.0.1/24","description":"mac:da:65:8f:18:9b:6f","dns_name":"myhostname"}',
                   '_headers' => bless( {
                                          'authorization' => 'token 0123456789abcdef0123456789abcdef01234567',
                                          'content-type' => 'application/json; charset=UTF-8'
index 86840ebc221e589e38ab0b5b3dcfa3bbf47c3951..fbbafbb965977f384cde183e57d3f30187bf3009 100644 (file)
@@ -1,5 +1,5 @@
 bless( {
-                  '_content' => '{"description":"mydescription mac:da:65:8f:18:9b:6f","dns_name":"myhostname"}',
+                  '_content' => '{"description":"mac:da:65:8f:18:9b:6f","dns_name":"myhostname"}',
                   '_headers' => bless( {
                                          'authorization' => 'token 0123456789abcdef0123456789abcdef01234567',
                                          'content-type' => 'application/json; charset=UTF-8'
index 5679e8d4ee8b4494180ec629009d31ecd8a3b82c..d3bc1addbdea377405310fdd4c9e739bb7cee3b0 100644 (file)
@@ -1,5 +1,5 @@
 bless( {
-                  '_content' => '{"address":"10.0.0.1/24","description":"mydescription mac:da:65:8f:18:9b:6f","dns_name":"myhostname"}',
+                  '_content' => '{"address":"10.0.0.1/24","description":"gateway","dns_name":"myhostname"}',
                   '_headers' => bless( {
                                          'authorization' => 'token 0123456789abcdef0123456789abcdef01234567',
                                          'content-type' => 'application/json; charset=UTF-8'
index c98359a4bcd5822d7608397853b771586f8b5bd2..578b5c158ef612101fd6cf65d969a92fc10ae871 100755 (executable)
@@ -176,7 +176,7 @@ foreach my $path (@plugins) {
     $test = "add_second_ip $ip2";
     $name = "$testid $test";
     $result = undef;
-    $expected = '{"zones":{"myzone":{"subnets":{"'.$subnet_cidr.'":{"ips":{"'.$ip.'":{"gateway":1},"'.$ip2.'":{}}}}}}}';
+    $expected = '{"zones":{"myzone":{"subnets":{"'.$subnet_cidr.'":{"ips":{"'.$ip.'":{"gateway":1},"'.$ip2.'":{"hostname":"'.$hostname.'","ip":"'.$ip2.'","mac":"'.$mac.'"}}}}}}}';
 
     eval {
        PVE::Network::SDN::Subnets::add_ip($zone, $subnetid, $subnet, $ip2, $hostname, $mac, $description);
@@ -195,7 +195,7 @@ foreach my $path (@plugins) {
     $test = "find_next_freeip ($ipnextfree)";
     $name = "$testid $test";
     $result = undef;
-    $expected = '{"zones":{"myzone":{"subnets":{"'.$subnet_cidr.'":{"ips":{"'.$ip.'":{"gateway":1},"'.$ipnextfree.'":{},"'.$ip2.'":{}}}}}}}';
+    $expected = '{"zones":{"myzone":{"subnets":{"'.$subnet_cidr.'":{"ips":{"'.$ip.'":{"gateway":1},"'.$ipnextfree.'":{},"'.$ip2.'":{"hostname":"'.$hostname.'","ip":"'.$ip2.'","mac":"'.$mac.'"}}}}}}}';
 
     eval {
        $ip3 = PVE::Network::SDN::Subnets::add_next_free_ip($zone, $subnetid, $subnet, $hostname, $mac, $description);
@@ -212,7 +212,7 @@ foreach my $path (@plugins) {
     $test = "del_ip $ip";
     $name = "$testid $test";
     $result = undef;
-    $expected = '{"zones":{"myzone":{"subnets":{"'.$subnet_cidr.'":{"ips":{"'.$ipnextfree.'":{},"'.$ip2.'":{}}}}}}}';
+    $expected = '{"zones":{"myzone":{"subnets":{"'.$subnet_cidr.'":{"ips":{"'.$ipnextfree.'":{},"'.$ip2.'":{"hostname":"'.$hostname.'","ip":"'.$ip2.'","mac":"'.$mac.'"}}}}}}}';
 
     eval {
        PVE::Network::SDN::Subnets::del_ip($zone, $subnetid, $subnet, $ip, $hostname);
@@ -264,7 +264,7 @@ foreach my $path (@plugins) {
 
     $name = "$testid $test";
     $result = undef;
-    $expected = '{"zones":{"myzone":{"subnets":{"'.$subnet_cidr.'":{"ips":{"'.$ipnextfree.'":{},"'.$ip2.'":{}}}}}}}';
+    $expected = '{"zones":{"myzone":{"subnets":{"'.$subnet_cidr.'":{"ips":{"'.$ipnextfree.'":{},"'.$ip2.'":{"hostname":"'.$hostname.'","ip":"'.$ip2.'","mac":"'.$mac.'"}}}}}}}';
 
     eval {
        PVE::Network::SDN::Subnets::add_ip($zone, $subnetid, $subnet, $ip, $hostname, $mac, $description);