Browse Source

[3464] DHCPv4 unit-tests are now passing.

Tomek Mrugalski 10 years ago
parent
commit
babed71bd5

+ 54 - 54
src/bin/dhcp4/tests/config_parser_unittest.cc

@@ -185,7 +185,7 @@ public:
             "\"rebind-timer\": 2000, "
             "\"renew-timer\": 1000, "
             "\"subnet4\": [ { "
-            "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+            "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
             "    \"subnet\": \"192.0.2.0/24\", "
             "    \"option-data\": [ {";
         bool first = true;
@@ -520,7 +520,7 @@ TEST_F(Dhcp4ParserTest, unspecifiedRenewTimer) {
     string config = "{ \"interfaces\": [ \"*\" ],"
         "\"rebind-timer\": 2000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -554,7 +554,7 @@ TEST_F(Dhcp4ParserTest, unspecifiedRebindTimer) {
     string config = "{ \"interfaces\": [ \"*\" ],"
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -589,7 +589,7 @@ TEST_F(Dhcp4ParserTest, subnetGlobalDefaults) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -624,20 +624,20 @@ TEST_F(Dhcp4ParserTest, multipleSubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.3.101 - 192.0.3.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"id\": 0 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.4.101 - 192.0.4.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\" "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.5.101 - 192.0.5.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.5.101 - 192.0.5.150\" } ],"
         "    \"subnet\": \"192.0.5.0/24\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";
@@ -675,22 +675,22 @@ TEST_F(Dhcp4ParserTest, multipleSubnetsExplicitIDs) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"id\": 1024 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.3.101 - 192.0.3.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"id\": 100 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.4.101 - 192.0.4.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\", "
         "    \"id\": 1 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.5.101 - 192.0.5.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.5.101 - 192.0.5.150\" } ],"
         "    \"subnet\": \"192.0.5.0/24\", "
         "    \"id\": 34 "
         " } ],"
@@ -726,22 +726,22 @@ TEST_F(Dhcp4ParserTest, multipleSubnetsOverlapingIDs) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"id\": 1024 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.3.101 - 192.0.3.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"id\": 100 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.4.101 - 192.0.4.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\", "
         "    \"id\": 1024 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.5.101 - 192.0.5.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.5.101 - 192.0.5.150\" } ],"
         "    \"subnet\": \"192.0.5.0/24\", "
         "    \"id\": 34 "
         " } ],"
@@ -764,22 +764,22 @@ TEST_F(Dhcp4ParserTest, reconfigureRemoveSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"id\": 1 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.3.101 - 192.0.3.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"id\": 2 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.4.101 - 192.0.4.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\", "
         "    \"id\": 3 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.5.101 - 192.0.5.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.5.101 - 192.0.5.150\" } ],"
         "    \"subnet\": \"192.0.5.0/24\", "
         "    \"id\": 4 "
         " } ],"
@@ -790,17 +790,17 @@ TEST_F(Dhcp4ParserTest, reconfigureRemoveSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"id\": 1 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.3.101 - 192.0.3.150\" ],"
+        "    \"pools\": [ { \"pool\":  \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"id\": 2 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.4.101 - 192.0.4.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\", "
         "    \"id\": 3 "
         " } ],"
@@ -811,17 +811,17 @@ TEST_F(Dhcp4ParserTest, reconfigureRemoveSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"id\": 1 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.4.101 - 192.0.4.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\", "
         "    \"id\": 3 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.5.101 - 192.0.5.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.5.101 - 192.0.5.150\" } ],"
         "    \"subnet\": \"192.0.5.0/24\", "
         "    \"id\": 4 "
         " } ],"
@@ -889,7 +889,7 @@ TEST_F(Dhcp4ParserTest, nextServerGlobal) {
         "\"renew-timer\": 1000, "
         "\"next-server\": \"1.2.3.4\", "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -918,7 +918,7 @@ TEST_F(Dhcp4ParserTest, nextServerSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"next-server\": \"1.2.3.4\", "
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -949,7 +949,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"next-server\": \"a.b.c.d\", "
@@ -961,7 +961,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"next-server\": \"2001:db8::1\", "
@@ -973,7 +973,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"next-server\": \"\", "
@@ -1009,7 +1009,7 @@ TEST_F(Dhcp4ParserTest, nextServerOverride) {
         "\"renew-timer\": 1000, "
         "\"next-server\": \"192.0.0.1\", "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"next-server\": \"1.2.3.4\", "
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1039,7 +1039,7 @@ TEST_F(Dhcp4ParserTest, echoClientId) {
         "\"renew-timer\": 1000, "
         "\"echo-client-id\": false,"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -1048,7 +1048,7 @@ TEST_F(Dhcp4ParserTest, echoClientId) {
         "\"renew-timer\": 1000, "
         "\"echo-client-id\": true,"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -1080,7 +1080,7 @@ TEST_F(Dhcp4ParserTest, subnetLocal) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"renew-timer\": 1, "
         "    \"rebind-timer\": 2, "
         "    \"valid-lifetime\": 4,"
@@ -1112,7 +1112,7 @@ TEST_F(Dhcp4ParserTest, poolOutOfSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.4.0/28\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.0/28\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -1137,7 +1137,7 @@ TEST_F(Dhcp4ParserTest, poolPrefixLen) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.128/28\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.128/28\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -1714,7 +1714,7 @@ TEST_F(Dhcp4ParserTest, optionDataDefaults) {
         "    \"csv-format\": False"
         " } ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1796,7 +1796,7 @@ TEST_F(Dhcp4ParserTest, optionDataTwoSpaces) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
         "}";
@@ -1950,7 +1950,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
         "}";
@@ -2005,7 +2005,7 @@ TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) {
         "      \"csv-format\": False"
         " } ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"option-data\": [ {"
         "          \"name\": \"dhcp-message\","
@@ -2152,7 +2152,7 @@ TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"option-data\": [ {"
         "          \"name\": \"dhcp-message\","
@@ -2163,7 +2163,7 @@ TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
         "        } ]"
         " },"
         " {"
-        "    \"pool\": [ \"192.0.3.101 - 192.0.3.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"option-data\": [ {"
         "          \"name\": \"default-ip-ttl\","
@@ -2519,7 +2519,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
         "}";
@@ -2602,7 +2602,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsHex) {
         "    \"csv-format\": False"
         " } ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1-192.0.2.10\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
         "}";
@@ -2663,7 +2663,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsCsv) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" "
         " } ]"
         "}";
@@ -2747,7 +2747,7 @@ buildHooksLibrariesConfig(const std::vector<std::string>& libraries) {
         "    \"encapsulate\": \"\""
         " } ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
         "}");
@@ -2915,7 +2915,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfig) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
         "     \"enable-updates\" : true, "
@@ -2980,7 +2980,7 @@ TEST_F(Dhcp4ParserTest, invalidD2ClientConfig) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
         "     \"enable-updates\" : true, "
@@ -3026,7 +3026,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfo) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"renew-timer\": 1, "
         "    \"rebind-timer\": 2, "
         "    \"valid-lifetime\": 4,"
@@ -3057,22 +3057,22 @@ TEST_F(Dhcp4ParserTest, classifySubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"client-class\": \"alpha\" "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.3.101 - 192.0.3.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"client-class\": \"beta\" "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.4.101 - 192.0.4.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\", "
         "    \"client-class\": \"gamma\" "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.5.101 - 192.0.5.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.5.101 - 192.0.5.150\" } ],"
         "    \"subnet\": \"192.0.5.0/24\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";

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

@@ -99,7 +99,7 @@ Dhcp4SrvD2Test::configureD2(bool enable_d2, const bool exp_result,
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
         "     \"enable-updates\" : " << (enable_d2 ? "true" : "false") <<  ", "

+ 15 - 15
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc

@@ -1448,7 +1448,7 @@ TEST_F(Dhcpv4SrvTest, vendorOptionsDocsis) {
         "          \"csv-format\": True"
         "        }],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"10.254.226.0/25\" ],"
+        "    \"pools\": [ { \"pool\": \"10.254.226.0/25\" } ],"
         "    \"subnet\": \"10.254.226.0/24\", "
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -1696,7 +1696,7 @@ TEST_F(Dhcpv4SrvTest, nextServerOverride) {
         "\"renew-timer\": 1000, "
         "\"next-server\": \"192.0.0.1\", "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"next-server\": \"1.2.3.4\", "
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1741,7 +1741,7 @@ TEST_F(Dhcpv4SrvTest, nextServerGlobal) {
         "\"renew-timer\": 1000, "
         "\"next-server\": \"192.0.0.1\", "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -2733,11 +2733,11 @@ TEST_F(HooksDhcpv4SrvTest, subnet4SelectSimple) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.0/25\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"interface\": \"eth0\" "
         " }, {"
-        "    \"pool\": [ \"192.0.3.0/25\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.0/25\" } ],"
         "    \"subnet\": \"192.0.3.0/24\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2801,11 +2801,11 @@ TEST_F(HooksDhcpv4SrvTest, subnet4SelectChange) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.0/25\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"interface\": \"eth0\" "
         " }, {"
-        "    \"pool\": [ \"192.0.3.0/25\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.0/25\" } ],"
         "    \"subnet\": \"192.0.3.0/24\" "
         " } ],"
         "\"valid-lifetime\": 4000 }";
@@ -3220,7 +3220,7 @@ TEST_F(Dhcpv4SrvTest, vendorOptionsORO) {
         "          \"csv-format\": True"
         "        }],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.0/25\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -3306,7 +3306,7 @@ TEST_F(Dhcpv4SrvTest, vendorOptionsDocsisDefinitions) {
         "          \"csv-format\": True"
         "        }],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.50\" ],"
+        "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.50\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"renew-timer\": 1000, "
         "    \"rebind-timer\": 1000, "
@@ -3387,10 +3387,10 @@ TEST_F(Dhcpv4SrvTest, clientClassify2) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
-        "{   \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"client-class\": \"foo\", "
         "    \"subnet\": \"192.0.2.0/24\" }, "
-        "{   \"pool\": [ \"192.0.3.1 - 192.0.3.100\" ],"
+        "{   \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"client-class\": \"xyzzy\", "
         "    \"subnet\": \"192.0.3.0/24\" } "
         "],"
@@ -3435,12 +3435,12 @@ TEST_F(Dhcpv4SrvTest, relayOverride) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
-        "{   \"pool\": [ \"192.0.2.2 - 192.0.2.100\" ],"
+        "{   \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
         "    \"relay\": { "
         "        \"ip-address\": \"192.0.5.1\""
         "    },"
         "    \"subnet\": \"192.0.2.0/24\" }, "
-        "{   \"pool\": [ \"192.0.3.1 - 192.0.3.100\" ],"
+        "{   \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"relay\": { "
         "        \"ip-address\": \"192.0.5.2\""
         "    },"
@@ -3510,13 +3510,13 @@ TEST_F(Dhcpv4SrvTest, relayOverrideAndClientClass) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
-        "{   \"pool\": [ \"192.0.2.2 - 192.0.2.100\" ],"
+        "{   \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
         "    \"client-class\": \"foo\", "
         "    \"relay\": { "
         "        \"ip-address\": \"192.0.5.1\""
         "    },"
         "    \"subnet\": \"192.0.2.0/24\" }, "
-        "{   \"pool\": [ \"192.0.3.1 - 192.0.3.100\" ],"
+        "{   \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"relay\": { "
         "        \"ip-address\": \"192.0.5.1\""
         "    },"

+ 3 - 3
src/bin/dhcp4/tests/direct_client_unittest.cc

@@ -120,7 +120,7 @@ DirectClientTest::configureSubnet(const std::string& prefix) {
         "\"renew-timer\": 1000, "
         "\"option-data\": [ ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"" << prefix << "/24\" ],"
+        "    \"pools\": [ { \"pool\": \"" << prefix << "/24\" } ],"
         "    \"subnet\": \"" << prefix << "/24\", "
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -141,14 +141,14 @@ DirectClientTest::configureTwoSubnets(const std::string& prefix1,
         "\"renew-timer\": 1000, "
         "\"option-data\": [ ],"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"" << prefix1 << "/24\" ],"
+        "    \"pools\": [ { \"pool\": \"" << prefix1 << "/24\" } ],"
         "    \"subnet\": \"" << prefix1 << "/24\", "
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"valid-lifetime\": 4000"
         " },"
         "{ "
-        "    \"pool\": [ \"" << prefix2 << "/24\" ],"
+        "    \"pools\": [ { \"pool\": \"" << prefix2 << "/24\" } ],"
         "    \"subnet\": \"" << prefix2 << "/24\", "
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "

+ 1 - 1
src/bin/dhcp4/tests/inform_unittest.cc

@@ -52,7 +52,7 @@ const char* INFORM_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
-        "    \"pool\": [ \"10.0.0.10-10.0.0.100\" ],"
+        "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"option-data\": [ {"
         "        \"name\": \"routers\","
         "        \"code\": 3,"

+ 4 - 4
src/bin/dhcp4/tests/kea_controller_unittest.cc

@@ -89,16 +89,16 @@ TEST_F(JSONFileBackendTest, jsonFile) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.1 - 192.0.2.100\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.3.101 - 192.0.3.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"id\": 0 "
         " },"
         " {"
-        "    \"pool\": [ \"192.0.4.101 - 192.0.4.150\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\" "
         " } ],"
         "\"valid-lifetime\": 4000 }"
@@ -164,7 +164,7 @@ TEST_F(JSONFileBackendTest, comments) {
         "\"renew-timer\": 1000, \n"
         "# comments in the middle should be ignored, too\n"
         "\"subnet4\": [ { "
-        "    \"pool\": [ \"192.0.2.0/24\" ],"
+        "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
         "    \"subnet\": \"192.0.2.0/22\" "
         " } ],"
         "\"valid-lifetime\": 4000 }"

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

@@ -78,16 +78,16 @@ TEST_F(JSONFileBackendTest, jsonFile) {
         "\"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 }"
@@ -153,7 +153,7 @@ TEST_F(JSONFileBackendTest, comments) {
         "\"renew-timer\": 1000, \n"
         "# comments in the middle should be ignored, too\n"
         "\"subnet6\": [ { "
-        "    \"pool\": [ \"2001:db8:1::/80\" ],"
+        "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " } ],"
         "\"valid-lifetime\": 4000 }"