Parcourir la source

[3464] DHCPv6 unit tests updated.

Tomek Mrugalski il y a 10 ans
Parent
commit
9e00f75a5a

+ 2 - 2
src/bin/dhcp4/tests/dhcp4_process_tests.sh.in

@@ -32,7 +32,7 @@ CONFIG="{
         \"subnet4\": [
         {
             \"subnet\": \"10.0.0.0/8\",
-            \"pool\": [ \"10.0.0.10-10.0.0.100\" ]
+            \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]
         } ]
     }
 }"
@@ -53,7 +53,7 @@ CONFIG_INVALID="{
         \"subnet4\": [
         {
             \"subnet\": \"10.0.0.0/8\",
-            \"pool\": [ \"10.0.0.10-10.0.0.100\" ]
+            \"pool\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]
         } ]
     }
 }"

+ 49 - 49
src/bin/dhcp6/tests/config_parser_unittest.cc

@@ -195,7 +195,7 @@ public:
             "  \"encapsulate\": \"\""
             "} ],"
             "\"subnet6\": [ { "
-            "    \"pool\": [ \"2001:db8:1::/80\" ],"
+            "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
             "    \"subnet\": \"2001:db8:1::/64\", "
             "    \"option-data\": [ {";
         bool first = true;
@@ -537,7 +537,7 @@ TEST_F(Dhcp6ParserTest, subnetGlobalDefaults) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -571,20 +571,20 @@ TEST_F(Dhcp6ParserTest, multipleSubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"id\": 0"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:3::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\" "
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:4::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ],"
         "    \"subnet\": \"2001:db8:4::/64\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";
@@ -623,22 +623,22 @@ TEST_F(Dhcp6ParserTest, multipleSubnetsExplicitIDs) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"id\": 1024"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"id\": 100"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:3::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\", "
         "    \"id\": 1"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:4::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ],"
         "    \"subnet\": \"2001:db8:4::/64\", "
         "    \"id\": 34"
         " } ],"
@@ -676,22 +676,22 @@ TEST_F(Dhcp6ParserTest, multipleSubnetsOverlapingIDs) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"id\": 1024"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"id\": 100"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:3::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\", "
         "    \"id\": 1024"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:4::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ],"
         "    \"subnet\": \"2001:db8:4::/64\", "
         "    \"id\": 34"
         " } ],"
@@ -716,22 +716,22 @@ TEST_F(Dhcp6ParserTest, reconfigureRemoveSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"id\": 1"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"id\": 2"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:3::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\", "
         "    \"id\": 3"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:4::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ],"
         "    \"subnet\": \"2001:db8:4::/64\", "
         "    \"id\": 4"
         " } ],"
@@ -743,17 +743,17 @@ TEST_F(Dhcp6ParserTest, reconfigureRemoveSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"id\": 1"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"id\": 2"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:3::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\", "
         "    \"id\": 3"
         " } ],"
@@ -765,17 +765,17 @@ TEST_F(Dhcp6ParserTest, reconfigureRemoveSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"id\": 1"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:3::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\", "
         "    \"id\": 3"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:4::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ],"
         "    \"subnet\": \"2001:db8:4::/64\", "
         "    \"id\": 4"
         " } ],"
@@ -840,7 +840,7 @@ TEST_F(Dhcp6ParserTest, subnetLocal) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"renew-timer\": 1, "
         "    \"rebind-timer\": 2, "
         "    \"preferred-lifetime\": 3,"
@@ -877,7 +877,7 @@ TEST_F(Dhcp6ParserTest, subnetInterface) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"interface\": \"" + valid_iface_ + "\","
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -909,7 +909,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceBogus) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"interface\": \"" + bogus_iface_ + "\","
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -941,7 +941,7 @@ TEST_F(Dhcp6ParserTest, interfaceGlobal) {
         "\"renew-timer\": 1000, "
         "\"interface\": \"" + valid_iface_ + "\"," // Not valid. Can be defined in subnet only
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
     cout << config << endl;
@@ -970,7 +970,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceId) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"interface-id\": \"" + valid_interface_id + "\","
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1008,7 +1008,7 @@ TEST_F(Dhcp6ParserTest, interfaceIdGlobal) {
         "\"renew-timer\": 1000, "
         "\"interface-id\": \"foobar\"," // Not valid. Can be defined in subnet only
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -1030,7 +1030,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceAndInterfaceId) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"interface\": \"" + valid_iface_ + "\","
         "    \"interface-id\": \"foobar\","
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
@@ -1059,7 +1059,7 @@ TEST_F(Dhcp6ParserTest, poolOutOfSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"4001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"4001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -1088,7 +1088,7 @@ TEST_F(Dhcp6ParserTest, poolPrefixLen) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -1183,7 +1183,7 @@ TEST_F(Dhcp6ParserTest, pdPoolList) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1:04::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1:04::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/40\","
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:1:01::\", "
@@ -1941,7 +1941,7 @@ TEST_F(Dhcp6ParserTest, optionDataDefaults) {
         "    \"csv-format\": True"
         " } ],"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2032,7 +2032,7 @@ TEST_F(Dhcp6ParserTest, optionDataTwoSpaces) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
         "}";
@@ -2187,7 +2187,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
         "}";
@@ -2235,7 +2235,7 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"option-data\": [ {"
         "          \"name\": \"subscriber-id\","
@@ -2246,7 +2246,7 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) {
         "        } ]"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"option-data\": [ {"
         "          \"name\": \"user-class\","
@@ -2565,7 +2565,7 @@ TEST_F(Dhcp6ParserTest, vendorOptionsHex) {
         "    \"csv-format\": False"
         " } ],"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
         "}";
@@ -2627,7 +2627,7 @@ TEST_F(Dhcp6ParserTest, vendorOptionsCsv) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
         "}";
@@ -2765,7 +2765,7 @@ TEST_F(Dhcp6ParserTest, stdOptionDataEncapsulate) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
         "}";
@@ -3049,7 +3049,7 @@ TEST_F(Dhcp6ParserTest, subnetRelayInfo) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:1::abcd\""
         "    },"
@@ -3079,22 +3079,22 @@ TEST_F(Dhcp6ParserTest, classifySubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"client-class\": \"alpha\" "
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"client-class\": \"beta\" "
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:3::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\", "
         "    \"client-class\": \"gamma\" "
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:4::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ],"
         "    \"subnet\": \"2001:db8:4::/64\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";
@@ -3174,7 +3174,7 @@ TEST_F(Dhcp6ParserTest, d2ClientConfig) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ], "
         " \"dhcp-ddns\" : {"
         "     \"enable-updates\" : true, "
@@ -3239,7 +3239,7 @@ TEST_F(Dhcp6ParserTest, invalidD2ClientConfig) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ], "
         " \"dhcp-ddns\" : {"
         "     \"enable-updates\" : true, "

+ 3 - 3
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc

@@ -165,16 +165,16 @@ TEST_F(CtrlDhcpv6SrvTest, configReload) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"id\": 0"
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:3::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";

+ 1 - 1
src/bin/dhcp6/tests/d2_unittest.cc

@@ -103,7 +103,7 @@ Dhcp6SrvD2Test::configureD2(bool enable_d2, const bool exp_result,
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::1 - 2001:db8:1::ffff\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         " \"dhcp-ddns\" : {"
         "     \"enable-updates\" : " << (enable_d2 ? "true" : "false") <<  ", "

+ 2 - 2
src/bin/dhcp6/tests/dhcp6_process_tests.sh.in

@@ -33,7 +33,7 @@ CONFIG="{
         \"subnet6\": [
         {
             \"subnet\": \"2001:db8:1::/64\",
-            \"pool\": [ \"2001:db8:1::10-2001:db8:1::100\" ]
+            \"pools\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ]
         } ]
     }
 }"
@@ -55,7 +55,7 @@ CONFIG_INVALID="{
         \"subnet6\": [
         {
             \"subnet\": \"2001:db8:1::/64\",
-            \"pool\": [ \"2001:db8:1::10-2001:db8:1::100\" ]
+            \"pool\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ]
         } ]
     }
 }"

+ 9 - 9
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc

@@ -294,7 +294,7 @@ TEST_F(Dhcpv6SrvTest, advertiseOptions) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth0\", "
         "    \"option-data\": [ {"
@@ -1578,7 +1578,7 @@ TEST_F(Dhcpv6SrvTest, vendorOptionsORO) {
         "          \"csv-format\": True"
         "        }],"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"renew-timer\": 1000, "
         "    \"rebind-timer\": 1000, "
@@ -1655,7 +1655,7 @@ TEST_F(Dhcpv6SrvTest, vendorOptionsDocsisDefinitions) {
         "          \"csv-format\": True"
         "        }],"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"renew-timer\": 1000, "
         "    \"rebind-timer\": 1000, "
@@ -1811,11 +1811,11 @@ TEST_F(Dhcpv6SrvTest, clientClassify2) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
-        " {  \"pool\": [ \"2001:db8:1::/64\" ],"
+        " {  \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"client-class\": \"foo\" "
         " }, "
-        " {  \"pool\": [ \"2001:db8:2::/64\" ],"
+        " {  \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"client-class\": \"xyzzy\" "
         " } "
@@ -1885,13 +1885,13 @@ TEST_F(Dhcpv6SrvTest, relayOverride) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
-        " {  \"pool\": [ \"2001:db8:1::/64\" ],"
+        " {  \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:3::1\""
         "    }"
         " }, "
-        " {  \"pool\": [ \"2001:db8:2::/64\" ],"
+        " {  \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:3::2\""
@@ -1960,14 +1960,14 @@ TEST_F(Dhcpv6SrvTest, relayOverrideAndClientClass) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
-        " {  \"pool\": [ \"2001:db8:1::/64\" ],"
+        " {  \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"client-class\": \"foo\", "
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:3::1\""
         "    }"
         " }, "
-        " {  \"pool\": [ \"2001:db8:2::/64\" ],"
+        " {  \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:3::1\""

+ 4 - 4
src/bin/dhcp6/tests/hooks_unittest.cc

@@ -904,11 +904,11 @@ TEST_F(HooksDhcpv6SrvTest, subnet6_select) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"" + valid_iface_ + "\" "
         " }, {"
-        "    \"pool\": [ \"2001:db8:2::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";
@@ -972,11 +972,11 @@ TEST_F(HooksDhcpv6SrvTest, subnet_select_change) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"" + valid_iface_ + "\" "
         " }, {"
-        "    \"pool\": [ \"2001:db8:2::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";

+ 8 - 8
src/bin/dhcp6/tests/rebind_unittest.cc

@@ -70,13 +70,13 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:2::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth1\""
@@ -89,13 +89,13 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:3::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:3::/64\" } ],"
         "    \"subnet\": \"2001:db8:3::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth1\""
         " },"
         " {"
-        "    \"pool\": [ \"2001:db8:4::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:4::/64\" } ],"
         "    \"subnet\": \"2001:db8:4::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""
@@ -108,13 +108,13 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"3000:1::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"3000:1::/64\" } ],"
         "    \"subnet\": \"3000:1::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""
         " },"
         " {"
-        "    \"pool\": [ \"3000:2::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"3000:2::/64\" } ],"
         "    \"subnet\": \"3000:2::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth1\""
@@ -127,13 +127,13 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"3000:3::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"3000:3::/64\" } ],"
         "    \"subnet\": \"3000:3::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth1\""
         " },"
         " {"
-        "    \"pool\": [ \"3000:4::/64\" ],"
+        "    \"pools\": [ { \"pool\": \"3000:4::/64\" } ],"
         "    \"subnet\": \"3000:4::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""