From b168addec3c2a83a3e7006ae929fce459f81377d Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Tue, 6 Jun 2023 14:13:18 +0200 Subject: [PATCH] [#2866] Updated server tests --- doc/examples/kea6/mysql-reservations.json | 2 - doc/examples/kea6/pgsql-reservations.json | 2 - src/bin/dhcp4/tests/config_parser_unittest.cc | 117 ++++++++++++++++- .../dhcp4/tests/ctrl_dhcp4_srv_unittest.cc | 16 +-- src/bin/dhcp4/tests/d2_unittest.cc | 4 + src/bin/dhcp4/tests/dhcp4_process_tests.sh.in | 6 + src/bin/dhcp4/tests/dhcp4_srv_unittest.cc | 34 +++++ src/bin/dhcp4/tests/direct_client_unittest.cc | 3 + src/bin/dhcp4/tests/dora_unittest.cc | 15 +++ src/bin/dhcp4/tests/hooks_unittest.cc | 7 + src/bin/dhcp4/tests/host_unittest.cc | 15 ++- src/bin/dhcp4/tests/inform_unittest.cc | 4 + .../dhcp4/tests/kea_controller_unittest.cc | 10 +- src/bin/dhcp4/tests/out_of_range_unittest.cc | 6 + src/bin/dhcp4/tests/parser_unittest.cc | 15 ++- .../dhcp4/tests/shared_network_unittest.cc | 4 + src/bin/dhcp4/tests/vendor_opts_unittest.cc | 29 ++++- src/bin/dhcp6/tests/classify_unittests.cc | 21 +++ src/bin/dhcp6/tests/config_parser_unittest.cc | 123 +++++++++++++++++- src/bin/dhcp6/tests/confirm_unittest.cc | 4 + .../dhcp6/tests/ctrl_dhcp6_srv_unittest.cc | 16 +-- src/bin/dhcp6/tests/d2_unittest.cc | 1 + src/bin/dhcp6/tests/decline_unittest.cc | 3 + src/bin/dhcp6/tests/dhcp6_process_tests.sh.in | 6 + src/bin/dhcp6/tests/dhcp6_srv_unittest.cc | 14 ++ src/bin/dhcp6/tests/fqdn_unittest.cc | 10 ++ src/bin/dhcp6/tests/hooks_unittest.cc | 27 ++++ src/bin/dhcp6/tests/host_unittest.cc | 9 ++ src/bin/dhcp6/tests/infrequest_unittest.cc | 3 + .../dhcp6/tests/kea_controller_unittest.cc | 9 +- src/bin/dhcp6/tests/parser_unittest.cc | 15 ++- src/bin/dhcp6/tests/rebind_unittest.cc | 16 +++ src/bin/dhcp6/tests/renew_unittest.cc | 6 + src/bin/dhcp6/tests/sarr_unittest.cc | 8 ++ .../dhcp6/tests/shared_network_unittest.cc | 4 + src/bin/dhcp6/tests/tee_times_unittest.cc | 3 + src/bin/dhcp6/tests/vendor_opts_unittest.cc | 11 +- 37 files changed, 553 insertions(+), 45 deletions(-) diff --git a/doc/examples/kea6/mysql-reservations.json b/doc/examples/kea6/mysql-reservations.json index f8a99a059f..74beb2c631 100644 --- a/doc/examples/kea6/mysql-reservations.json +++ b/doc/examples/kea6/mysql-reservations.json @@ -65,8 +65,6 @@ // id will be used to search for the reservations within the database. "subnet6": [ { - "id": 1, - "subnet": "2001:db8:1::/48", "pools": [ { "pool": "2001:db8:1::/80" } ], diff --git a/doc/examples/kea6/pgsql-reservations.json b/doc/examples/kea6/pgsql-reservations.json index 35b571e189..6c61019650 100644 --- a/doc/examples/kea6/pgsql-reservations.json +++ b/doc/examples/kea6/pgsql-reservations.json @@ -62,8 +62,6 @@ // id will be used to search for the reservations within the database. "subnet6": [ { - "id": 1, - "subnet": "2001:db8:1::/48", "pools": [ { "pool": "2001:db8:1::/80" } ], diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc index 9e30f23580..24e6bf81fa 100644 --- a/src/bin/dhcp4/tests/config_parser_unittest.cc +++ b/src/bin/dhcp4/tests/config_parser_unittest.cc @@ -74,6 +74,7 @@ const char* PARSER_CONFIGS[] = { " \"pools\": [ " " { \"pool\": \"192.0.2.0/28\" }" " ]," + " \"id\": 1," " \"subnet\": \"192.0.2.0/24\"" " } ]" "}", @@ -93,6 +94,7 @@ const char* PARSER_CONFIGS[] = { " }" " }" " ]," + " \"id\": 1," " \"subnet\": \"192.0.2.0/24\"" " } ]" "}", @@ -115,6 +117,7 @@ const char* PARSER_CONFIGS[] = { " }" " }" " ]," + " \"id\": 1," " \"subnet\": \"192.0.2.0/24\"" " } ]" "}", @@ -137,6 +140,7 @@ const char* PARSER_CONFIGS[] = { " }" " }" " ]," + " \"id\": 1," " \"subnet\": \"192.0.2.0/24\"" " } ]" "}", @@ -429,6 +433,7 @@ public: "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"option-data\": [ {"; @@ -894,6 +899,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) { string too_small = "{ " + genIfaceConfig() + "," + "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 1000, \"min-valid-lifetime\": 2000 }"; @@ -911,6 +917,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) { string too_large = "{ " + genIfaceConfig() + "," + "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 2000, \"max-valid-lifetime\": 1000 }"; @@ -925,6 +932,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) { string before = "{ " + genIfaceConfig() + "," + "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 1000, \"min-valid-lifetime\": 2000, " @@ -940,6 +948,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) { string after = "{ " + genIfaceConfig() + "," + "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 5000, \"min-valid-lifetime\": 1000, " @@ -955,6 +964,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) { string crossed = "{ " + genIfaceConfig() + "," + "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 1500, \"min-valid-lifetime\": 2000, " @@ -1041,6 +1051,7 @@ TEST_F(Dhcp4ParserTest, unspecifiedRenewTimer) { string config = "{ " + genIfaceConfig() + "," + "\"rebind-timer\": 2000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1075,6 +1086,7 @@ TEST_F(Dhcp4ParserTest, unspecifiedRebindTimer) { string config = "{ " + genIfaceConfig() + "," + "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1109,6 +1121,7 @@ TEST_F(Dhcp4ParserTest, subnetGlobalDefaults) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000," @@ -1140,6 +1153,7 @@ TEST_F(Dhcp4ParserTest, subnetGlobalDefaults) { EXPECT_EQ(1, subnet->getID()); } +#if deprecated_unnumbered // Goal of this test is to verify that multiple subnets get unique // subnet-ids. Also, test checks that it's possible to do reconfiguration // multiple times. @@ -1199,6 +1213,7 @@ TEST_F(Dhcp4ParserTest, multipleSubnets) { // a bit. } while (++cnt < 10); } +#endif // This test checks that it is possible to assign arbitrary ids for subnets. TEST_F(Dhcp4ParserTest, multipleSubnetsExplicitIDs) { @@ -1437,6 +1452,7 @@ TEST_F(Dhcp4ParserTest, nextServerGlobal) { "\"server-hostname\": \"foo\", " "\"boot-file-name\": \"bar\", " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1473,6 +1489,7 @@ TEST_F(Dhcp4ParserTest, nextServerSubnet) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"next-server\": \"1.2.3.4\", " " \"server-hostname\": \"foo\", " @@ -1510,6 +1527,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " @@ -1522,6 +1540,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " @@ -1534,6 +1553,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " @@ -1547,6 +1567,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " @@ -1560,6 +1581,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " @@ -1620,6 +1642,7 @@ TEST_F(Dhcp4ParserTest, nextServerOverride) { "\"server-hostname\": \"nohost\"," "\"boot-file-name\": \"nofile\"," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"next-server\": \"1.2.3.4\", " " \"server-hostname\": \"some-name.example.org\"," @@ -1655,6 +1678,7 @@ TEST_F(Dhcp4ParserTest, echoClientId) { "\"renew-timer\": 1000, " "\"echo-client-id\": false," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1664,6 +1688,7 @@ TEST_F(Dhcp4ParserTest, echoClientId) { "\"renew-timer\": 1000, " "\"echo-client-id\": true," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1707,6 +1732,7 @@ TEST_F(Dhcp4ParserTest, compatibility) { " \"exclude-first-last-24\": true" "}," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1741,6 +1767,7 @@ TEST_F(Dhcp4ParserTest, compatibilityUnknown) { " \"foo-bar\": true" "}," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1767,6 +1794,7 @@ TEST_F(Dhcp4ParserTest, compatibilityNotBool) { " \"lenient-option-parsing\": 1" "}," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1792,11 +1820,13 @@ TEST_F(Dhcp4ParserTest, matchClientIdNoGlobal) { "\"renew-timer\": 1000, " "\"subnet4\": [ " "{" + " \"id\": 1," " \"match-client-id\": true," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" "}," "{" + " \"id\": 2," " \"match-client-id\": false," " \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"subnet\": \"192.0.3.0/24\"" @@ -1839,11 +1869,13 @@ TEST_F(Dhcp4ParserTest, matchClientIdGlobal) { "\"match-client-id\": true," "\"subnet4\": [ " "{" + " \"id\": 1," " \"match-client-id\": false," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" "}," "{" + " \"id\": 2," " \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"subnet\": \"192.0.3.0/24\"" "} ]," @@ -1883,11 +1915,13 @@ TEST_F(Dhcp4ParserTest, authoritativeNoGlobal) { "\"renew-timer\": 1000, " "\"subnet4\": [ " "{" + " \"id\": 1," " \"authoritative\": true," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" "}," "{" + " \"id\": 2," " \"authoritative\": false," " \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"subnet\": \"192.0.3.0/24\"" @@ -1930,11 +1964,13 @@ TEST_F(Dhcp4ParserTest, authoritativeGlobal) { "\"authoritative\": true," "\"subnet4\": [ " "{" + " \"id\": 1," " \"authoritative\": false," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" "}," "{" + " \"id\": 2," " \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"subnet\": \"192.0.3.0/24\"" "} ]," @@ -1974,6 +2010,7 @@ TEST_F(Dhcp4ParserTest, subnetLocal) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"renew-timer\": 1, " " \"rebind-timer\": 2, " @@ -2014,6 +2051,7 @@ TEST_F(Dhcp4ParserTest, multiplePools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ " " { \"pool\": \"192.0.2.0/28\" }," " { \"pool\": \"192.0.2.200-192.0.2.255\" }" @@ -2021,6 +2059,7 @@ TEST_F(Dhcp4ParserTest, multiplePools) { " \"subnet\": \"192.0.2.0/24\" " " }," " {" + " \"id\": 2," " \"pools\": [ " " { \"pool\": \"192.0.3.0/25\" }," " { \"pool\": \"192.0.3.128/25\" }" @@ -2074,6 +2113,7 @@ TEST_F(Dhcp4ParserTest, poolOutOfSubnet) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.4.0/28\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2130,6 +2170,7 @@ TEST_F(Dhcp4ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"foo/28\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2139,6 +2180,7 @@ TEST_F(Dhcp4ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.128/foo\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2148,6 +2190,7 @@ TEST_F(Dhcp4ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.128/100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2157,6 +2200,7 @@ TEST_F(Dhcp4ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"foo\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2166,6 +2210,7 @@ TEST_F(Dhcp4ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"foo - bar\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2175,6 +2220,7 @@ TEST_F(Dhcp4ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.200 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2184,6 +2230,7 @@ TEST_F(Dhcp4ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.128/1052\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2256,6 +2303,7 @@ TEST_F(Dhcp4ParserTest, noPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"user-context\": { } } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2343,6 +2391,7 @@ TEST_F(Dhcp4ParserTest, unknownInterface) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ ]," " \"subnet\": \"192.0.2.0/24\"," " \"interface\": \"ethX\" } ]," @@ -2966,6 +3015,7 @@ TEST_F(Dhcp4ParserTest, optionDataDefaultsGlobal) { " \"csv-format\": false" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" " } ]," @@ -3027,6 +3077,7 @@ TEST_F(Dhcp4ParserTest, optionDataDefaultsSubnet) { "\"rebind-timer\": 2000," "\"renew-timer\": 1000," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"," " \"option-data\": [ {" @@ -3119,6 +3170,7 @@ TEST_F(Dhcp4ParserTest, optionDataTwoSpaces) { " \"space\": \"isc\"" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" " } ]" @@ -3253,6 +3305,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) { " \"space\": \"isc\"" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" " } ]" @@ -3304,6 +3357,7 @@ TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) { " \"csv-format\": false" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"option-data\": [ {" @@ -3449,6 +3503,7 @@ TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"option-data\": [ {" @@ -3458,6 +3513,7 @@ TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) { " } ]" " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ]," " \"subnet\": \"192.0.3.0/24\", " " \"option-data\": [ {" @@ -3524,6 +3580,7 @@ TEST_F(Dhcp4ParserTest, optionDataSinglePool) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { " " \"pool\": \"192.0.2.1 - 192.0.2.100\"," " \"option-data\": [ {" @@ -3595,6 +3652,7 @@ TEST_F(Dhcp4ParserTest, optionDataMultiplePools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { " " \"pool\": \"192.0.2.1 - 192.0.2.100\"," " \"option-data\": [ {" @@ -3900,6 +3958,7 @@ TEST_F(Dhcp4ParserTest, slpOptions) { " \"data\": \"false, \"" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" " } ]," @@ -4031,6 +4090,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) { " \"space\": \"vendor-encapsulated-options-space\"" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" " } ]" @@ -4110,6 +4170,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsHex) { " \"csv-format\": false" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ]," " \"subnet\": \"192.0.2.0/24\"" " } ]" @@ -4166,6 +4227,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsCsv) { " \"space\": \"vendor-4491\"" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" " " } ]" @@ -4241,6 +4303,7 @@ buildHooksLibrariesConfig(const std::vector& libraries = {}, " \"space\": \"isc\"" " } ]," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" " } ]"); @@ -4524,6 +4587,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfigValid) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," " \"dhcp-ddns\" : {" @@ -4593,6 +4657,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfigMoveToGlobal) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," " \"dhcp-ddns\" : {" @@ -4670,6 +4735,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfigBoth) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," " \"dhcp-ddns\" : {" @@ -4748,6 +4814,7 @@ TEST_F(Dhcp4ParserTest, invalidD2ClientConfig) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," " \"dhcp-ddns\" : {" @@ -4792,6 +4859,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfo) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"renew-timer\": 1, " " \"rebind-timer\": 2, " @@ -4829,6 +4897,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfoList) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"renew-timer\": 1, " " \"rebind-timer\": 2, " @@ -4868,21 +4937,25 @@ TEST_F(Dhcp4ParserTest, classifySubnets) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"client-class\": \"alpha\" " " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ]," " \"subnet\": \"192.0.3.0/24\", " " \"client-class\": \"beta\" " " }," " {" + " \"id\": 3," " \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ]," " \"subnet\": \"192.0.4.0/24\", " " \"client-class\": \"gamma\" " " }," " {" + " \"id\": 4," " \"pools\": [ { \"pool\": \"192.0.5.101 - 192.0.5.150\" } ]," " \"subnet\": \"192.0.5.0/24\" " " } ]," @@ -4960,6 +5033,7 @@ TEST_F(Dhcp4ParserTest, classifyPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { " " \"pool\": \"192.0.2.1 - 192.0.2.100\", " " \"client-class\": \"alpha\" " @@ -5423,6 +5497,7 @@ TEST_F(Dhcp4ParserTest, hostReservationPerSubnet) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.1.0/24\" } ]," " \"subnet\": \"192.0.1.0/24\", " " \"reservations-global\": false," @@ -5430,6 +5505,7 @@ TEST_F(Dhcp4ParserTest, hostReservationPerSubnet) { " \"reservations-out-of-pool\": false" " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"reservations-global\": false," @@ -5437,22 +5513,26 @@ TEST_F(Dhcp4ParserTest, hostReservationPerSubnet) { " \"reservations-out-of-pool\": true" " }," " {" + " \"id\": 3," " \"pools\": [ { \"pool\": \"192.0.3.0/24\" } ]," " \"subnet\": \"192.0.3.0/24\", " " \"reservations-global\": false," " \"reservations-in-subnet\": false" " }," " {" + " \"id\": 4," " \"pools\": [ { \"pool\": \"192.0.4.0/24\" } ]," " \"subnet\": \"192.0.4.0/24\", " " \"reservations-global\": true," " \"reservations-in-subnet\": false" " }," " {" + " \"id\": 5," " \"pools\": [ { \"pool\": \"192.0.5.0/24\" } ]," " \"subnet\": \"192.0.5.0/24\"" " }," " {" + " \"id\": 6," " \"pools\": [ { \"pool\": \"192.0.6.0/24\" } ]," " \"subnet\": \"192.0.6.0/24\", " " \"reservations-global\": true," @@ -5460,6 +5540,7 @@ TEST_F(Dhcp4ParserTest, hostReservationPerSubnet) { " \"reservations-out-of-pool\": false" " }," " {" + " \"id\": 7," " \"pools\": [ { \"pool\": \"192.0.7.0/24\" } ]," " \"subnet\": \"192.0.7.0/24\", " " \"reservations-global\": true," @@ -5553,6 +5634,7 @@ TEST_F(Dhcp4ParserTest, hostReservationGlobal) { "\"reservations-in-subnet\": true," "\"reservations-out-of-pool\": true," "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"reservations-global\": false," @@ -5560,6 +5642,7 @@ TEST_F(Dhcp4ParserTest, hostReservationGlobal) { " \"reservations-out-of-pool\": false" " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"192.0.3.0/24\" } ]," " \"subnet\": \"192.0.3.0/24\"" " } ]," @@ -5784,6 +5867,7 @@ TEST_F(Dhcp4ParserTest, 4o6default) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -5818,6 +5902,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnet) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"," " \"4o6-subnet\": \"2001:db8::123/45\" } ]," @@ -5857,6 +5942,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetBogus) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"," " \"4o6-subnet\": \"2001:db8::123\" } ]," @@ -5867,6 +5953,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetBogus) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"," " \"4o6-subnet\": \"2001:db8:bogus/45\" } ]," @@ -5877,6 +5964,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetBogus) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"," " \"4o6-subnet\": \"2001:db8::123/200\" } ]," @@ -5914,6 +6002,7 @@ TEST_F(Dhcp4ParserTest, 4o6iface) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"," " \"4o6-interface\": \"ethX\" } ]," @@ -5950,6 +6039,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetIface) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"," " \"4o6-subnet\": \"2001:db8::543/21\"," @@ -5990,6 +6080,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetInterfaceId) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"," " \"4o6-interface-id\": \"vlan123\" } ]," @@ -6040,6 +6131,7 @@ TEST_F(Dhcp4ParserTest, validClientClassDictionary) { " } \n" "], \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], \n" " \"subnet\": \"192.0.2.0/24\" \n" " } ] \n" @@ -6083,6 +6175,7 @@ TEST_F(Dhcp4ParserTest, invalidClientClassDictionary) { " } \n" "], \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], \n" " \"subnet\": \"192.0.2.0/24\" \n" " } ] \n" @@ -6107,6 +6200,7 @@ TEST_F(Dhcp4ParserTest, clientClassValidLifetime) { " } \n" "], \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], \n" " \"subnet\": \"192.0.2.0/24\" \n" " } ] \n" @@ -6164,6 +6258,7 @@ TEST_F(Dhcp4ParserTest, templateClientClassValidLifetime) { " } \n" "], \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], \n" " \"subnet\": \"192.0.2.0/24\" \n" " } ] \n" @@ -6306,13 +6401,14 @@ TEST_F(Dhcp4ParserTest, invalidPoolRange) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"192.0.2.1 - 19.2.0.200\" } ], \n" " \"subnet\": \"192.0.2.0/24\" \n" " } ] \n" "} \n"; string expected = "Failed to create pool defined by: " - "192.0.2.1-19.2.0.200 (:6:26)"; + "192.0.2.1-19.2.0.200 (:7:26)"; configure(config, CONTROL_RESULT_ERROR, expected); } @@ -6325,6 +6421,7 @@ TEST_F(Dhcp4ParserTest, outsideSubnetPool) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], \n" " \"subnet\": \"10.0.2.0/24\" \n" " } ] \n" @@ -6345,6 +6442,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksEmpty) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"10.0.2.1 - 10.0.2.100\" } ], \n" " \"subnet\": \"10.0.2.0/24\" \n" " } ],\n" @@ -6362,6 +6460,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksNoName) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"10.0.2.1 - 10.0.2.100\" } ], \n" " \"subnet\": \"10.0.2.0/24\" \n" " } ],\n" @@ -6378,6 +6477,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksEmptyName) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"10.0.2.1 - 10.0.2.100\" } ], \n" " \"subnet\": \"10.0.2.0/24\" \n" " } ],\n" @@ -6393,6 +6493,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksEmptyName) { TEST_F(Dhcp4ParserTest, sharedNetworksName) { string config = "{\n" "\"subnet4\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"10.0.2.1 - 10.0.2.100\" } ], \n" " \"subnet\": \"10.0.2.0/24\" \n" " } ],\n" @@ -6428,6 +6529,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworks1subnet) { "\"shared-networks\": [ {\n" " \"name\": \"foo\"\n," " \"subnet4\": [ { \n" + " \"id\": 1,\n" " \"subnet\": \"192.0.2.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ]\n" " } ]\n" @@ -6484,10 +6586,12 @@ TEST_F(Dhcp4ParserTest, sharedNetworks3subnets) { " \"name\": \"foo\"\n," " \"subnet4\": [\n" " { \n" + " \"id\": 1,\n" " \"subnet\": \"192.0.1.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.1.1-192.0.1.10\" } ]\n" " },\n" " { \n" + " \"id\": 2,\n" " \"subnet\": \"192.0.2.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ],\n" " \"renew-timer\": 2,\n" @@ -6497,6 +6601,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworks3subnets) { " \"max-valid-lifetime\": 333\n" " },\n" " { \n" + " \"id\": 3,\n" " \"subnet\": \"192.0.3.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.3.1-192.0.3.10\" } ]\n" " }\n" @@ -6583,10 +6688,12 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) { " \"max-valid-lifetime\": 50,\n" " \"subnet4\": [\n" " { \n" + " \"id\": 1,\n" " \"subnet\": \"192.0.1.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.1.1-192.0.1.10\" } ]\n" " },\n" " { \n" + " \"id\": 2,\n" " \"subnet\": \"192.0.2.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ],\n" " \"renew-timer\": 100,\n" @@ -6611,6 +6718,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) { " \"name\": \"bar\",\n" " \"subnet4\": [\n" " {\n" + " \"id\": 3,\n" " \"subnet\": \"192.0.3.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.3.1-192.0.3.10\" } ]\n" " }\n" @@ -6716,10 +6824,12 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDeriveClientClass) { " \"client-class\": \"alpha\",\n" " \"subnet4\": [\n" " { \n" + " \"id\": 1,\n" " \"subnet\": \"192.0.1.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.1.1-192.0.1.10\" } ]\n" " },\n" " { \n" + " \"id\": 2,\n" " \"subnet\": \"192.0.2.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ],\n" " \"client-class\": \"beta\"\n" @@ -6730,6 +6840,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDeriveClientClass) { " \"name\": \"bar\",\n" " \"subnet4\": [\n" " {\n" + " \"id\": 3,\n" " \"subnet\": \"192.0.3.0/24\",\n" " \"pools\": [ { \"pool\": \"192.0.3.1-192.0.3.10\" } ]\n" " }\n" @@ -7506,11 +7617,13 @@ TEST_F(Dhcp4ParserTest, storeExtendedInfoNoGlobal) { "\"renew-timer\": 1000, " "\"subnet4\": [ " "{" + " \"id\": 1," " \"store-extended-info\": true," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" "}," "{" + " \"id\": 2," " \"store-extended-info\": false," " \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"subnet\": \"192.0.3.0/24\"" @@ -7553,11 +7666,13 @@ TEST_F(Dhcp4ParserTest, storeExtendedInfoGlobal) { "\"store-extended-info\": true," "\"subnet4\": [ " "{" + " \"id\": 1," " \"store-extended-info\": false," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" "}," "{" + " \"id\": 2," " \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"subnet\": \"192.0.3.0/24\"" "} ]," diff --git a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc index 5cf130618f..88d685f3e6 100644 --- a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc @@ -748,13 +748,13 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configSet) { " }," " \"subnet4\": [ \n"; string subnet1 = - " {\"subnet\": \"192.2.0.0/24\", \n" + " {\"subnet\": \"192.2.0.0/24\", \"id\": 1, \n" " \"pools\": [{ \"pool\": \"192.2.0.1-192.2.0.50\" }]}\n"; string subnet2 = - " {\"subnet\": \"192.2.1.0/24\", \n" + " {\"subnet\": \"192.2.1.0/24\", \"id\": 2, \n" " \"pools\": [{ \"pool\": \"192.2.1.1-192.2.1.50\" }]}\n"; string bad_subnet = - " {\"comment\": \"192.2.2.0/24\", \n" + " {\"comment\": \"192.2.2.0/24\", \"id\": 10, \n" " \"pools\": [{ \"pool\": \"192.2.2.1-192.2.2.50\" }]}\n"; string subnet_footer = " ] \n"; @@ -985,13 +985,13 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configTest) { " }," " \"subnet4\": [ \n"; string subnet1 = - " {\"subnet\": \"192.2.0.0/24\", \n" + " {\"subnet\": \"192.2.0.0/24\", \"id\": 1, \n" " \"pools\": [{ \"pool\": \"192.2.0.1-192.2.0.50\" }]}\n"; string subnet2 = - " {\"subnet\": \"192.2.1.0/24\", \n" + " {\"subnet\": \"192.2.1.0/24\", \"id\": 2, \n" " \"pools\": [{ \"pool\": \"192.2.1.1-192.2.1.50\" }]}\n"; string bad_subnet = - " {\"comment\": \"192.2.2.0/24\", \n" + " {\"comment\": \"192.2.2.0/24\", \"id\": 10, \n" " \"pools\": [{ \"pool\": \"192.2.2.1-192.2.2.50\" }]}\n"; string subnet_footer = " ] \n"; @@ -1578,8 +1578,8 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configReloadValid) { " \"interfaces\": [ \"*\" ]" " }," " \"subnet4\": [" - " { \"subnet\": \"192.0.2.0/24\" }," - " { \"subnet\": \"192.0.3.0/24\" }" + " { \"id\": 1, \"subnet\": \"192.0.2.0/24\" }," + " { \"id\": 2, \"subnet\": \"192.0.3.0/24\" }" " ]," " \"valid-lifetime\": 4000," " \"lease-database\": {" diff --git a/src/bin/dhcp4/tests/d2_unittest.cc b/src/bin/dhcp4/tests/d2_unittest.cc index 0a11144fd4..a5114d8392 100644 --- a/src/bin/dhcp4/tests/d2_unittest.cc +++ b/src/bin/dhcp4/tests/d2_unittest.cc @@ -100,6 +100,7 @@ Dhcp4SrvD2Test::configureD2(bool enable_d2, const bool exp_result, "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," " \"dhcp-ddns\" : {" @@ -411,6 +412,7 @@ TEST_F(Dhcp4SrvD2Test, badTCP) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," " \"dhcp-ddns\" : {" @@ -450,6 +452,7 @@ TEST_F(Dhcp4SrvD2Test, badFamily) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," " \"dhcp-ddns\" : {" @@ -489,6 +492,7 @@ TEST_F(Dhcp4SrvD2Test, senderEqServer) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," " \"dhcp-ddns\" : {" diff --git a/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in b/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in index 663df46a17..76e7177094 100644 --- a/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in +++ b/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in @@ -45,6 +45,7 @@ CONFIG="{ }, \"subnet4\": [ { + \"id\": 1, \"subnet\": \"10.0.0.0/8\", \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ] } ], @@ -84,6 +85,7 @@ CONFIG_BAD_SYNTAX="{ }, \"subnet4\": [ { + \"id\": 1, \"subnet\": \"10.0.0.0/8\", \"pool\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ] } ], @@ -119,6 +121,7 @@ CONFIG_BAD_VALUES="{ }, \"subnet4\": [ { + \"id\": 1, \"subnet\": \"10.0.0.0/8\", \"pools\": [ { \"pool\": \"192.168.0.10-192.168.0.100\" } ] } ], @@ -154,6 +157,7 @@ CONFIG_INVALID="{ }, \"subnet4\": [ { + \"id\": 1, \"subnet\": \"10.0.0.0/8\", \"pool\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ] } ], @@ -194,6 +198,7 @@ INVALID_CONFIG_HOOKS_LOAD="{ }, \"subnet4\": [ { + \"id\": 1, \"subnet\": \"10.0.0.0/8\", \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ] } ], @@ -245,6 +250,7 @@ INVALID_CONFIG_HOOKS_CALLOUT_FAIL="{ }, \"subnet4\": [ { + \"id\": 1, \"subnet\": \"10.0.0.0/8\", \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ] } ], diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index 648bd83556..c47c06f250 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -75,6 +75,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"10.254.226.0/25\" } ]," " \"subnet\": \"10.254.226.0/24\", " " \"rebind-timer\": 2000, " @@ -99,6 +100,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"rebind-timer\": 2000, " @@ -117,6 +119,7 @@ const char* CONFIGS[] = { " \"renew-timer\": 1000, " " \"valid-lifetime\": 4000, " " \"subnet4\": [ {" + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " " \"subnet\": \"192.0.2.0/24\"" " } ], " @@ -144,6 +147,7 @@ const char* CONFIGS[] = { " \"renew-timer\": 1000, " " \"valid-lifetime\": 4000, " " \"subnet4\": [ {" + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " " \"subnet\": \"192.0.2.0/24\"," " \"option-data\": [" @@ -172,6 +176,7 @@ const char* CONFIGS[] = { // - user-contexts defined in both subnet and pool "{" " \"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"10.254.226.0/25\"," " \"user-context\": { \"value\": 42 } } ]," " \"subnet\": \"10.254.226.0/24\", " @@ -3134,6 +3139,7 @@ TEST_F(Dhcpv4SrvTest, nextServerOverride) { "\"server-hostname\": \"nohost\", " "\"boot-file-name\": \"nofile\", " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"next-server\": \"1.2.3.4\", " " \"server-hostname\": \"some-name.example.org\", " @@ -3199,6 +3205,7 @@ TEST_F(Dhcpv4SrvTest, nextServerGlobal) { "\"server-hostname\": \"some-name.example.org\", " "\"boot-file-name\": \"bootfile.efi\", " "\"subnet4\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -3256,6 +3263,7 @@ TEST_F(Dhcpv4SrvTest, matchClassification) { "\"valid-lifetime\": 4000, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" } ], " "\"client-classes\": [ " "{ \"name\": \"router\", " @@ -3378,6 +3386,7 @@ TEST_F(Dhcpv4SrvTest, matchClassificationOptionName) { "\"valid-lifetime\": 4000, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" } ], " "\"client-classes\": [ " "{ \"name\": \"router\", " @@ -3425,6 +3434,7 @@ TEST_F(Dhcpv4SrvTest, matchClassificationOptionDef) { "\"valid-lifetime\": 4000, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" } ], " "\"client-classes\": [ " "{ \"name\": \"router\", " @@ -3479,6 +3489,7 @@ TEST_F(Dhcpv4SrvTest, subnetClassPriority) { "\"valid-lifetime\": 4000, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\", " " \"option-data\": [" " { \"name\": \"ip-forwarding\", " @@ -3556,6 +3567,7 @@ TEST_F(Dhcpv4SrvTest, subnetGlobalPriority) { "\"valid-lifetime\": 4000, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\", " " \"option-data\": [" " { \"name\": \"ip-forwarding\", " @@ -3626,6 +3638,7 @@ TEST_F(Dhcpv4SrvTest, classGlobalPriority) { "\"valid-lifetime\": 4000, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" } ], " "\"option-data\": [" " { \"name\": \"ip-forwarding\", " @@ -3707,6 +3720,7 @@ TEST_F(Dhcpv4SrvTest, classGlobalPersistency) { "\"valid-lifetime\": 4000, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" } ], " "\"option-data\": [" " { \"name\": \"ip-forwarding\", " @@ -3790,9 +3804,11 @@ TEST_F(Dhcpv4SrvTest, clientClassify) { "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"client-class\": \"foo\", " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"client-class\": \"xyzzy\", " + " \"id\": 2, " " \"subnet\": \"192.0.3.0/24\" } " "]," "\"valid-lifetime\": 4000 }"; @@ -3851,6 +3867,7 @@ TEST_F(Dhcpv4SrvTest, clientPoolClassify) { " \"client-class\": \"foo\" }, " " { \"pool\": \"192.0.3.1 - 192.0.3.100\", " " \"client-class\": \"xyzzy\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.0.0/16\" } " "]," "\"valid-lifetime\": 4000 }"; @@ -3919,6 +3936,7 @@ TEST_F(Dhcpv4SrvTest, clientPoolClassifyKnown) { " \"client-class\": \"KNOWN\" }, " " { \"pool\": \"192.0.3.1 - 192.0.3.100\", " " \"client-class\": \"UNKNOWN\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.0.0/16\" } " "]," "\"valid-lifetime\": 4000 }"; @@ -3972,6 +3990,7 @@ TEST_F(Dhcpv4SrvTest, clientPoolClassifyUnknown) { " \"client-class\": \"UNKNOWN\" }, " " { \"pool\": \"192.0.3.1 - 192.0.3.100\", " " \"client-class\": \"KNOWN\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.0.0/16\", " " \"reservations\": [ { " " \"hw-address\": \"00:00:00:11:22:33\", " @@ -4028,6 +4047,7 @@ TEST_F(Dhcpv4SrvTest, privateOption) { "\"valid-lifetime\": 4000, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" } ]," "\"client-classes\": [ " "{ \"name\": \"private\", " @@ -4239,11 +4259,13 @@ TEST_F(Dhcpv4SrvTest, relayOverride) { " \"relay\": { " " \"ip-address\": \"192.0.5.1\"" " }," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"relay\": { " " \"ip-address\": \"192.0.5.2\"" " }," + " \"id\": 2, " " \"subnet\": \"192.0.3.0/24\" } " "]," "\"valid-lifetime\": 4000 }"; @@ -4326,11 +4348,13 @@ TEST_F(Dhcpv4SrvTest, relayOverrideAndClientClass) { " \"relay\": { " " \"ip-address\": \"192.0.5.1\"" " }," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"relay\": { " " \"ip-address\": \"192.0.5.1\"" " }," + " \"id\": 2, " " \"subnet\": \"192.0.3.0/24\" } " "]," "\"valid-lifetime\": 4000 }"; @@ -4387,11 +4411,14 @@ TEST_F(Dhcpv4SrvTest, relayLinkSelect) { " \"relay\": { " " \"ip-address\": \"192.0.5.1\"" " }," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," + " \"id\": 2, " " \"subnet\": \"192.0.3.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.4.1 - 192.0.4.100\" } ]," " \"client-class\": \"foo\", " + " \"id\": 3, " " \"subnet\": \"192.0.4.0/24\" } " "]," "\"valid-lifetime\": 4000 }"; @@ -4519,11 +4546,14 @@ TEST_F(Dhcpv4SrvTest, relayIgnoreLinkSelect) { " \"relay\": { " " \"ip-address\": \"192.0.5.1\"" " }," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," + " \"id\": 2, " " \"subnet\": \"192.0.3.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.4.1 - 192.0.4.100\" } ]," " \"client-class\": \"foo\", " + " \"id\": 3, " " \"subnet\": \"192.0.4.0/24\" } " "]," "\"valid-lifetime\": 4000 }"; @@ -4652,11 +4682,14 @@ TEST_F(Dhcpv4SrvTest, subnetSelect) { " \"relay\": { " " \"ip-address\": \"192.0.5.1\"" " }," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," + " \"id\": 2, " " \"subnet\": \"192.0.3.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.4.1 - 192.0.4.100\" } ]," " \"client-class\": \"foo\", " + " \"id\": 3, " " \"subnet\": \"192.0.4.0/24\" } " "]," "\"valid-lifetime\": 4000 }"; @@ -5074,6 +5107,7 @@ TEST_F(Dhcpv4SrvTest, fixedFieldsInClassOrder) { "subnet4": [ { + "id": 1, "subnet": "192.0.2.0/24", "pools": [ { "pool": "192.0.2.1 - 192.0.2.100" } ], "reservations": [ diff --git a/src/bin/dhcp4/tests/direct_client_unittest.cc b/src/bin/dhcp4/tests/direct_client_unittest.cc index c861a0f8b6..27439e2baa 100644 --- a/src/bin/dhcp4/tests/direct_client_unittest.cc +++ b/src/bin/dhcp4/tests/direct_client_unittest.cc @@ -153,6 +153,7 @@ DirectClientTest::configureSubnet(const std::string& prefix) { "\"renew-timer\": 1000, " "\"option-data\": [ ]," "\"subnet4\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"" << prefix << "/24\" } ]," " \"subnet\": \"" << prefix << "/24\", " " \"rebind-timer\": 2000, " @@ -175,6 +176,7 @@ DirectClientTest::configureTwoSubnets(const std::string& prefix1, "\"renew-timer\": 1000, " "\"option-data\": [ ]," "\"subnet4\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"" << prefix1 << "/24\" } ]," " \"subnet\": \"" << prefix1 << "/24\", " " \"rebind-timer\": 2000, " @@ -182,6 +184,7 @@ DirectClientTest::configureTwoSubnets(const std::string& prefix1, " \"valid-lifetime\": 4000" " }," "{ " + " \"id\": 2, " " \"pools\": [ { \"pool\": \"" << prefix2 << "/24\" } ]," " \"subnet\": \"" << prefix2 << "/24\", " " \"rebind-timer\": 2000, " diff --git a/src/bin/dhcp4/tests/dora_unittest.cc b/src/bin/dhcp4/tests/dora_unittest.cc index bedf20d9bd..be2c7cf25a 100644 --- a/src/bin/dhcp4/tests/dora_unittest.cc +++ b/src/bin/dhcp4/tests/dora_unittest.cc @@ -204,6 +204,7 @@ const char* DORA_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1," " \"option-data\": [ {" " \"name\": \"routers\"," " \"data\": \"192.0.2.200,192.0.2.201\"" @@ -230,6 +231,7 @@ const char* DORA_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1," " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations\": [ " " {" @@ -278,6 +280,7 @@ const char* DORA_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1," " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations\": [ " " {" @@ -309,6 +312,7 @@ const char* DORA_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1," " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations\": [ " " {" @@ -341,6 +345,7 @@ const char* DORA_CONFIGS[] = { "\"boot-file-name\": \"nofile\"," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1," " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations\": [ " " {" @@ -367,6 +372,7 @@ const char* DORA_CONFIGS[] = { "\"subnet4\": [" " {" " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"interface\": \"eth0\"," " \"option-data\": [" @@ -378,6 +384,7 @@ const char* DORA_CONFIGS[] = { " }," " {" " \"subnet\": \"192.0.2.0/26\", " + " \"id\": 2, " " \"pools\": [ { \"pool\": \"192.0.2.10-192.0.2.63\" } ]," " \"interface\": \"eth1\"," " \"option-data\": [" @@ -389,6 +396,7 @@ const char* DORA_CONFIGS[] = { " }," " {" " \"subnet\": \"192.0.2.64/26\", " + " \"id\": 3, " " \"pools\": [ { \"pool\": \"192.0.2.65-192.0.2.100\" } ]," " \"relay\": {" " \"ip-address\": \"10.2.3.4\"" @@ -441,6 +449,7 @@ const char* DORA_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.5-10.0.0.100\" } ]," " \"reservations\": [ " " {" @@ -458,6 +467,7 @@ const char* DORA_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\"," + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations-global\": false," " \"reservations-in-subnet\": true," @@ -478,6 +488,7 @@ const char* DORA_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\"," + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations-global\": false," " \"reservations-in-subnet\": false," @@ -497,6 +508,7 @@ const char* DORA_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\"," + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations-global\": false," " \"reservations-in-subnet\": true," @@ -556,12 +568,14 @@ const char* DORA_CONFIGS[] = { "\"subnet4\": [" " {" " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"store-extended-info\": true," " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"interface\": \"eth0\"" " }," " {" " \"subnet\": \"192.0.2.0/26\", " + " \"id\": 2, " " \"store-extended-info\": false," " \"pools\": [ { \"pool\": \"192.0.2.10-192.0.2.63\" } ]," " \"interface\": \"eth1\"" @@ -578,6 +592,7 @@ const char* DORA_CONFIGS[] = { "\"subnet4\": [" " {" " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"pools\": [" " {" " \"pool\": \"10.0.0.10-10.0.0.20\"" diff --git a/src/bin/dhcp4/tests/hooks_unittest.cc b/src/bin/dhcp4/tests/hooks_unittest.cc index 6622995dfa..5d60a75096 100644 --- a/src/bin/dhcp4/tests/hooks_unittest.cc +++ b/src/bin/dhcp4/tests/hooks_unittest.cc @@ -1696,10 +1696,12 @@ TEST_F(HooksDhcpv4SrvTest, subnet4SelectSimple) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\" " " }, {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"192.0.3.0/25\" } ]," " \"subnet\": \"192.0.3.0/24\" " " } ]," @@ -1779,10 +1781,12 @@ TEST_F(HooksDhcpv4SrvTest, subnet4SelectChange) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet4\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\" " " }, {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"192.0.3.0/25\" } ]," " \"subnet\": \"192.0.3.0/24\" " " } ]," @@ -3004,6 +3008,7 @@ TEST_F(HooksDhcpv4SrvTest, host4Identifier) { "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ]," " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1, " " \"interface\": \"eth0\", " " \"reservations\": [" " {" @@ -3075,6 +3080,7 @@ TEST_F(HooksDhcpv4SrvTest, host4IdentifierHWAddr) { "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ]," " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1, " " \"interface\": \"eth0\", " " \"reservations\": [" " {" @@ -3315,6 +3321,7 @@ TEST_F(HooksDhcpv4SrvTest, leases4ParkedPacketLimit) { "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ]," " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1, " " \"interface\": \"eth1\" " " } ]," "\"valid-lifetime\": 4000" diff --git a/src/bin/dhcp4/tests/host_unittest.cc b/src/bin/dhcp4/tests/host_unittest.cc index da59968e9a..74aace18ba 100644 --- a/src/bin/dhcp4/tests/host_unittest.cc +++ b/src/bin/dhcp4/tests/host_unittest.cc @@ -74,6 +74,7 @@ const char* CONFIGS[] = { "\"valid-lifetime\": 600,\n" "\"subnet4\": [ { \n" " \"subnet\": \"10.0.0.0/24\",\n" + " \"id\": 10,\n" " \"reservations-global\": true,\n" " \"reservations-in-subnet\": false,\n" " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]\n" @@ -97,7 +98,7 @@ const char* CONFIGS[] = { "\"subnet4\": [\n" " {\n" " \"subnet\": \"10.0.0.0/24\", \n" - " \"id\": 10," + " \"id\": 10, \n" " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n" " \"interface\": \"eth0\",\n" " \"reservations\": [ \n" @@ -136,7 +137,7 @@ const char* CONFIGS[] = { "\"subnet4\": [\n" " {\n" " \"subnet\": \"10.0.0.0/24\", \n" - " \"id\": 10," + " \"id\": 10, \n" " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n" " \"interface\": \"eth0\",\n" " \"reservations-global\": false,\n" @@ -166,7 +167,7 @@ const char* CONFIGS[] = { "\"subnet4\": [\n" " {\n" " \"subnet\": \"10.0.0.0/24\", \n" - " \"id\": 10," + " \"id\": 10, \n" " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n" " \"interface\": \"eth0\",\n" " \"reservations-global\": false,\n" @@ -211,7 +212,7 @@ const char* CONFIGS[] = { " \"subnet4\": [\n" " {\n" " \"subnet\": \"10.0.0.0/24\", \n" - " \"id\": 10," + " \"id\": 10, \n" " \"pools\": [" " {" " \"pool\": \"10.0.0.10-10.0.0.11\"," @@ -263,7 +264,7 @@ const char* CONFIGS[] = { " \"subnet4\": [\n" " {\n" " \"subnet\": \"10.0.0.0/24\", \n" - " \"id\": 10," + " \"id\": 10, \n" " \"client-class\": \"reserved_class\"," " \"pools\": [" " {" @@ -304,7 +305,7 @@ const char* CONFIGS[] = { "\"subnet4\": [\n" " {\n" " \"subnet\": \"10.0.0.0/24\", \n" - " \"id\": 10," + " \"id\": 10, \n" " \"reservations\": [{ \n" " \"hw-address\": \"aa:bb:cc:dd:ee:fe\",\n" " \"client-classes\": [ \"reserved_class\" ]\n" @@ -372,7 +373,7 @@ const char* CONFIGS[] = { "\"subnet4\": [\n" " {\n" " \"subnet\": \"10.0.0.0/24\", \n" - " \"id\": 10," + " \"id\": 10, \n" " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n" " \"interface\": \"eth0\",\n" " \"reservations\": [ \n" diff --git a/src/bin/dhcp4/tests/inform_unittest.cc b/src/bin/dhcp4/tests/inform_unittest.cc index 07bd35d604..2482110f72 100644 --- a/src/bin/dhcp4/tests/inform_unittest.cc +++ b/src/bin/dhcp4/tests/inform_unittest.cc @@ -70,6 +70,7 @@ const char* INFORM_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"option-data\": [ {" " \"name\": \"routers\"," @@ -97,6 +98,7 @@ const char* INFORM_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1, " " \"option-data\": [ {" " \"name\": \"routers\"," " \"data\": \"192.0.2.200,192.0.2.201\"" @@ -126,6 +128,7 @@ const char* INFORM_CONFIGS[] = { "\"boot-file-name\": \"nofile\"," "\"subnet4\": [ { " " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1, " " \"reservations\": [ " " {" " \"hw-address\": \"aa:bb:cc:dd:ee:ff\"," @@ -157,6 +160,7 @@ const char* INFORM_CONFIGS[] = { "]," "\"subnet4\": [ { " " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1, " " \"reservations\": [ " " {" " \"hw-address\": \"aa:bb:cc:dd:ee:ff\"," diff --git a/src/bin/dhcp4/tests/kea_controller_unittest.cc b/src/bin/dhcp4/tests/kea_controller_unittest.cc index b1ade98c25..ea5149fdb9 100644 --- a/src/bin/dhcp4/tests/kea_controller_unittest.cc +++ b/src/bin/dhcp4/tests/kea_controller_unittest.cc @@ -398,15 +398,17 @@ TEST_F(JSONFileBackendTest, jsonFile) { "\"renew-timer\": 1000, " "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" " " }," " {" " \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ]," " \"subnet\": \"192.0.3.0/24\", " - " \"id\": 0 " + " \"id\": 2 " " }," " {" " \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ]," + " \"id\": 3, " " \"subnet\": \"192.0.4.0/24\" " " } ]," "\"valid-lifetime\": 4000 }" @@ -483,6 +485,7 @@ TEST_F(JSONFileBackendTest, hashComments) { "# comments in the middle should be ignored, too\n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/22\" " " } ]," "\"valid-lifetime\": 4000 }" @@ -534,6 +537,7 @@ TEST_F(JSONFileBackendTest, cppLineComments) { "// comments in the middle should be ignored, too\n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/22\" " " } ]," "\"valid-lifetime\": 4000 }" @@ -585,6 +589,7 @@ TEST_F(JSONFileBackendTest, cBlockComments) { "/* comments in the middle should be ignored, too*/\n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/22\" " " } ]," "\"valid-lifetime\": 4000 }" @@ -637,6 +642,7 @@ TEST_F(JSONFileBackendTest, include) { string include = "\n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/22\" " " } ]\n"; @@ -683,6 +689,7 @@ TEST_F(JSONFileBackendTest, recursiveInclude) { "\"renew-timer\": 1000, \n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/22\" " " } ]," "\"valid-lifetime\": 4000 }" @@ -727,6 +734,7 @@ TEST_F(JSONFileBackendTest, configBroken) { "\"renew-timer\": 1000, " "\"subnet4\": [ { " " \"pool\": [ \"2001:db8::/80\" ]," + " \"id\": 1, " " \"subnet\": \"2001:db8::/64\" " " } ]}"; diff --git a/src/bin/dhcp4/tests/out_of_range_unittest.cc b/src/bin/dhcp4/tests/out_of_range_unittest.cc index d5dc1f159a..c4758742e9 100644 --- a/src/bin/dhcp4/tests/out_of_range_unittest.cc +++ b/src/bin/dhcp4/tests/out_of_range_unittest.cc @@ -48,6 +48,7 @@ const char* OOR_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations\": [ " " {" @@ -73,6 +74,7 @@ const char* OOR_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.101-10.0.0.200\" } ]," " \"reservations\": [ " " {" @@ -98,6 +100,7 @@ const char* OOR_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.101-10.0.0.200\" } ]," "} ]," "\"dhcp-ddns\": {" @@ -113,6 +116,7 @@ const char* OOR_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"192.0.2.101-192.0.2.200\" } ]," " \"reservations\": [ " " {" @@ -138,6 +142,7 @@ const char* OOR_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"192.0.2.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"192.0.2.101-192.0.2.200\" } ]" "} ]," "\"dhcp-ddns\": {" @@ -153,6 +158,7 @@ const char* OOR_CONFIGS[] = { "\"valid-lifetime\": 600," "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]" "} ]," "\"dhcp-ddns\": {" diff --git a/src/bin/dhcp4/tests/parser_unittest.cc b/src/bin/dhcp4/tests/parser_unittest.cc index 706365d085..426cf8e724 100644 --- a/src/bin/dhcp4/tests/parser_unittest.cc +++ b/src/bin/dhcp4/tests/parser_unittest.cc @@ -140,6 +140,7 @@ TEST(ParserTest, keywordDhcp4) { "\"renew-timer\": 1000, \n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"test\" } ],\n" "\"valid-lifetime\": 4000 } }"; @@ -159,6 +160,7 @@ TEST(ParserTest, bashComments) { "\"renew-timer\": 1000, \n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\"" " } ]," @@ -175,6 +177,7 @@ TEST(ParserTest, cppComments) { "\"renew-timer\": 1000, // this will be ignored, too\n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\"" " } ]," @@ -191,6 +194,7 @@ TEST(ParserTest, bashCommentsInline) { "\"renew-timer\": 1000, # this will be ignored, too\n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\"" " } ]," @@ -209,6 +213,7 @@ TEST(ParserTest, multilineComments) { "\"renew-timer\": 1000, \n" "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\"" " } ]," @@ -227,6 +232,7 @@ TEST(ParserTest, embbededComments) { "\"subnet4\": [ { " " \"user-context\": { \"comment\": \"indirect\" }," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," + " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\"" " } ]," @@ -948,6 +954,7 @@ TEST_F(TrailingCommasTest, tests) { "pool": "192.168.0.0/24", }, ], + "id": 1, "subnet": "192.168.0.0/24", }, ], @@ -967,10 +974,10 @@ TEST_F(TrailingCommasTest, tests) { addLog(":32.8"); addLog(":43.37"); addLog(":44.12"); - addLog(":46.35"); - addLog(":47.8"); - addLog(":48.6"); - addLog(":49.4"); + addLog(":47.35"); + addLog(":48.8"); + addLog(":49.6"); + addLog(":50.4"); EXPECT_TRUE(checkFile()); // Test with many consecutive commas. diff --git a/src/bin/dhcp4/tests/shared_network_unittest.cc b/src/bin/dhcp4/tests/shared_network_unittest.cc index 4377f4590f..a5cefbe90a 100644 --- a/src/bin/dhcp4/tests/shared_network_unittest.cc +++ b/src/bin/dhcp4/tests/shared_network_unittest.cc @@ -1073,6 +1073,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet4\": [" " {" " \"subnet\": \"192.0.2.0/24\"," + " \"id\": 100," " \"allocator\": \"flq\"," " \"pools\": [" " {" @@ -1082,6 +1083,7 @@ const char* NETWORKS_CONFIG[] = { " }," " {" " \"subnet\": \"192.0.3.0/24\"," + " \"id\": 10," " \"allocator\": \"random\"," " \"pools\": [" " {" @@ -1111,6 +1113,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet4\": [" " {" " \"subnet\": \"192.0.2.0/24\"," + " \"id\": 100," " \"allocator\": \"random\"," " \"pools\": [" " {" @@ -1120,6 +1123,7 @@ const char* NETWORKS_CONFIG[] = { " }," " {" " \"subnet\": \"192.0.3.0/24\"," + " \"id\": 10," " \"allocator\": \"flq\"," " \"pools\": [" " {" diff --git a/src/bin/dhcp4/tests/vendor_opts_unittest.cc b/src/bin/dhcp4/tests/vendor_opts_unittest.cc index 327f67a335..cf38afcf70 100644 --- a/src/bin/dhcp4/tests/vendor_opts_unittest.cc +++ b/src/bin/dhcp4/tests/vendor_opts_unittest.cc @@ -165,7 +165,8 @@ public: "pool": "192.0.2.0/25" } ], - "subnet": "192.0.2.0/24" + "subnet": "192.0.2.0/24", + "id": 10 } ] } @@ -433,7 +434,8 @@ public: "pool": "192.0.2.0/25" } ], - "subnet": "192.0.2.0/24" + "subnet": "192.0.2.0/24", + "id": 10 } ] } @@ -691,7 +693,8 @@ public: "pool": "192.0.2.0/25" } ], - "subnet": "192.0.2.0/24" + "subnet": "192.0.2.0/24", + "id": 10 } ] } @@ -852,7 +855,8 @@ TEST_F(VendorOptsTest, vendorOptionsDocsis) { "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"10.254.226.0/25\" } ]," " \"subnet\": \"10.254.226.0/24\", " - " \"interface\": \"eth0\" " + " \"interface\": \"eth0\", " + " \"id\": 10" " } ]," "\"valid-lifetime\": 4000 }"; @@ -1357,6 +1361,7 @@ TEST_F(VendorOptsTest, vendorCancelledOptions) { " \"data\": \"bar\"" " } ]," "\"subnet4\": [ { " + " \"id\": 10," " \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\", " @@ -1457,6 +1462,7 @@ TEST_F(VendorOptsTest, vendorOptionsDocsisDefinitions) { " \"csv-format\": true" " }]," "\"subnet4\": [ { " + " \"id\": 10," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.50\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"\"" @@ -1564,6 +1570,7 @@ TEST_F(VendorOptsTest, vivsoInResponseOnly) { " } ]" " } ]," "\"subnet4\": [ { " + " \"id\": 10," " \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ]," " \"subnet\": \"192.0.2.0/24\", " " \"interface\": \"eth0\" " @@ -1625,6 +1632,7 @@ TEST_F(VendorOptsTest, option43LastResort) { " \"interfaces\": [ \"*\" ] }, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 10," " \"subnet\": \"192.0.2.0/24\" } ]," "\"option-def\": [ " "{ \"code\": 1, " @@ -1703,6 +1711,7 @@ TEST_F(VendorOptsTest, option43BadRaw) { " \"interfaces\": [ \"*\" ] }, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 10," " \"subnet\": \"192.0.2.0/24\" } ]," "\"option-data\": [ " "{ \"name\": \"vendor-class-identifier\", " @@ -1786,6 +1795,7 @@ TEST_F(VendorOptsTest, option43FailRaw) { " \"interfaces\": [ \"*\" ] }, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 10," " \"subnet\": \"192.0.2.0/24\" } ]," "\"option-def\": [ " "{ \"code\": 1, " @@ -1855,6 +1865,7 @@ TEST_F(VendorOptsTest, option43RawGlobal) { " \"interfaces\": [ \"*\" ] }, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 10," " \"subnet\": \"192.0.2.0/24\" } ]," "\"option-def\": [ " "{ \"code\": 43, " @@ -1942,6 +1953,7 @@ TEST_F(VendorOptsTest, option43RawClass) { " \"interfaces\": [ \"*\" ] }, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 10," " \"subnet\": \"192.0.2.0/24\" } ]," "\"client-classes\": [ " "{ \"name\": \"vendor\", " @@ -2037,6 +2049,7 @@ TEST_F(VendorOptsTest, option43Class) { " \"type\": \"uint32\" } ]," "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 10," " \"subnet\": \"192.0.2.0/24\" } ]," "\"client-classes\": [ " "{ \"name\": \"alpha\", " @@ -2166,6 +2179,7 @@ TEST_F(VendorOptsTest, option43ClassPriority) { " \"data\": \"33\" } ]," "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 10," " \"subnet\": \"192.0.2.0/24\" } ]," "\"client-classes\": [ " "{ \"name\": \"alpha\", " @@ -2287,6 +2301,7 @@ TEST_F(VendorOptsTest, option43Classes) { " \"type\": \"uint8\" } ]," "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], " + " \"id\": 10," " \"subnet\": \"192.0.2.0/24\" } ]," "\"client-classes\": [ " "{ \"name\": \"alpha\", " @@ -2414,6 +2429,7 @@ TEST_F(VendorOptsTest, clientOption43FailRaw) { " \"interfaces\": [ \"*\" ] }, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], " + " \"id\": 10," " \"subnet\": \"10.0.0.0/24\" } ]," "\"option-def\": [ " "{ \"code\": 1, " @@ -2449,6 +2465,7 @@ TEST_F(VendorOptsTest, clientOption43RawGlobal) { " \"interfaces\": [ \"*\" ] }, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], " + " \"id\": 10," " \"subnet\": \"10.0.0.0/24\" } ]," "\"option-def\": [ " "{ \"code\": 1, " @@ -2492,6 +2509,7 @@ TEST_F(VendorOptsTest, clientOption43RawClass) { " \"interfaces\": [ \"*\" ] }, " "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], " + " \"id\": 10," " \"subnet\": \"10.0.0.0/24\" } ]," "\"option-def\": [ " "{ \"code\": 1, " @@ -2539,6 +2557,7 @@ TEST_F(Dhcpv4SrvTest, truncatedVIVSOOption) { "}," "\"subnet4\": [ { " " \"pools\": [ { \"pool\": \"10.206.80.0/25\" } ]," + " \"id\": 10," " \"subnet\": \"10.206.80.0/24\", " " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " @@ -2645,6 +2664,7 @@ TEST_F(VendorOptsTest, vendorOpsSubOption0) { " }" " ]," "\"subnet4\": [ { " + " \"id\": 10," " \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ]," " \"subnet\": \"192.0.2.0/24\"" " } ]" @@ -2731,6 +2751,7 @@ TEST_F(VendorOptsTest, twoVivcos) { " }" " ]," "\"subnet4\": [ { " + " \"id\": 10," " \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ]," " \"subnet\": \"10.0.0.0/24\", " " \"interface\": \"eth0\" " diff --git a/src/bin/dhcp6/tests/classify_unittests.cc b/src/bin/dhcp6/tests/classify_unittests.cc index e2a1aaf713..fdc82cab8d 100644 --- a/src/bin/dhcp6/tests/classify_unittests.cc +++ b/src/bin/dhcp6/tests/classify_unittests.cc @@ -158,6 +158,7 @@ const char* CONFIGS[] = { "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " " \"subnet\": \"2001:db8:1::/48\", " + " \"id\": 1, " " \"interface\": \"eth1\"," " \"reservations\": [" " {" @@ -214,6 +215,7 @@ const char* CONFIGS[] = { "]," "\"subnet6\": [ " "{ \"subnet\": \"2001:db8:1::/48\", " + " \"id\": 1, " " \"interface\": \"eth1\"," " \"pools\": [ " " { \"pool\": \"2001:db8:1:1::/64\"," @@ -274,6 +276,7 @@ const char* CONFIGS[] = { "]," "\"subnet6\": [ " "{ \"subnet\": \"2001:db8::/32\", " + " \"id\": 1, " " \"interface\": \"eth1\"," " \"pd-pools\": [ " " { \"prefix\": \"2001:db8:1::\"," @@ -317,6 +320,7 @@ const char* CONFIGS[] = { "]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\"" " } ]," @@ -337,6 +341,7 @@ const char* CONFIGS[] = { "]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\"," " \"reservations\": [" @@ -369,6 +374,7 @@ const char* CONFIGS[] = { "]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\"," " \"reservations\": [" @@ -578,6 +584,7 @@ TEST_F(ClassifyTest, matchClassification) { " \"type\": \"boolean\" }]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" } ]," "\"client-classes\": [ " @@ -702,6 +709,7 @@ TEST_F(ClassifyTest, required) { " \"type\": \"boolean\" }]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" } ]," "\"client-classes\": [ " @@ -809,6 +817,7 @@ TEST_F(ClassifyTest, requiredClassification) { " \"type\": \"boolean\" }]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"require-client-classes\": [ \"router\" ], " " \"interface\": \"eth1\" } ]," @@ -922,6 +931,7 @@ TEST_F(ClassifyTest, subnetClassPriority) { " \"type\": \"boolean\" }]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\", " " \"option-data\": [" @@ -1000,6 +1010,7 @@ TEST_F(ClassifyTest, subnetGlobalPriority) { " \"data\": \"false\" } ], " "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\", " " \"option-data\": [" @@ -1063,6 +1074,7 @@ TEST_F(ClassifyTest, classGlobalPriority) { " \"type\": \"boolean\" }]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" } ]," "\"option-data\": [" @@ -1145,6 +1157,7 @@ TEST_F(ClassifyTest, classGlobalPersistency) { " \"never-send\": false } ], " "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\", " " \"option-data\": [" @@ -1215,6 +1228,7 @@ TEST_F(ClassifyTest, classNeverSend) { " \"never-send\": false } ], " "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\", " " \"option-data\": [" @@ -1270,10 +1284,12 @@ TEST_F(ClassifyTest, clientClassifySubnet) { "\"renew-timer\": 1000, " "\"subnet6\": [ " " { \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"client-class\": \"foo\" " " }, " " { \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," + " \"id\": 2, " " \"subnet\": \"2001:db8:2::/48\", " " \"client-class\": \"xyzzy\" " " } " @@ -1340,6 +1356,7 @@ TEST_F(ClassifyTest, clientClassifyPool) { " \"client-class\": \"xyzzy\" " " } " " ], " + " \"id\": 1, " " \"subnet\": \"2001:db8::/40\" " " } " "], " @@ -1424,6 +1441,7 @@ TEST_F(ClassifyTest, clientClassifyPoolKnown) { " \"client-class\": \"UNKNOWN\" " " } " " ], " + " \"id\": 1, " " \"subnet\": \"2001:db8::/40\", " " \"reservations\": [ " " { \"duid\": \"01:02:03:04\", \"hostname\": \"foo\" } ] " @@ -1535,6 +1553,7 @@ TEST_F(ClassifyTest, relayOverrideAndClientClass) { "\"renew-timer\": 1000, " "\"subnet6\": [ " " { \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"client-class\": \"foo\", " " \"relay\": { " @@ -1542,6 +1561,7 @@ TEST_F(ClassifyTest, relayOverrideAndClientClass) { " }" " }, " " { \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," + " \"id\": 2, " " \"subnet\": \"2001:db8:2::/48\", " " \"relay\": { " " \"ip-address\": \"2001:db8:3::1\"" @@ -1683,6 +1703,7 @@ TEST_F(ClassifyTest, member) { " \"type\": \"boolean\" }]," "\"subnet6\": [ " "{ \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" } ]," "\"client-classes\": [ " diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc index 7eb5186d3c..9ba9e35224 100644 --- a/src/bin/dhcp6/tests/config_parser_unittest.cc +++ b/src/bin/dhcp6/tests/config_parser_unittest.cc @@ -78,6 +78,7 @@ const char* PARSER_CONFIGS[] = { " \"pools\": [ " " { \"pool\": \"2001:db8::/64\" }" " ]," + " \"id\": 1," " \"subnet\": \"2001:db8::/32\"" " } ]" "}", @@ -98,6 +99,7 @@ const char* PARSER_CONFIGS[] = { " }" " }" " ]," + " \"id\": 1," " \"subnet\": \"2001:db8::/32\"" " } ]" "}", @@ -122,6 +124,7 @@ const char* PARSER_CONFIGS[] = { " }" " }" " ]," + " \"id\": 1," " \"subnet\": \"2001:db8::/32\"" " } ]" "}", @@ -146,6 +149,7 @@ const char* PARSER_CONFIGS[] = { " }" " }" " ]," + " \"id\": 1," " \"subnet\": \"2001:db8::/32\"" " } ]" "}", @@ -165,6 +169,7 @@ const char* PARSER_CONFIGS[] = { " \"prefix-len\": 56," " \"delegated-len\": 64 }" " ]," + " \"id\": 1," " \"subnet\": \"2001:db8::/32\"" " } ]" "}", @@ -186,6 +191,7 @@ const char* PARSER_CONFIGS[] = { " \"user-context\": { }" " }" " ]," + " \"id\": 1," " \"subnet\": \"2001:db8::/32\"" " } ]" "}", @@ -212,6 +218,7 @@ const char* PARSER_CONFIGS[] = { " }" " }" " ]," + " \"id\": 1," " \"subnet\": \"2001:db8::/32\"" " } ]" "}", @@ -583,6 +590,7 @@ public: " \"space\": \"dhcp6\"" "} ]," "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\", " " \"option-data\": [ {"; @@ -1043,6 +1051,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) { string too_small = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"valid-lifetime\": 1000, \"min-valid-lifetime\": 2000 }"; @@ -1060,6 +1069,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) { string too_large = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"valid-lifetime\": 2000, \"max-valid-lifetime\": 1000 }"; @@ -1074,6 +1084,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) { string before = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"valid-lifetime\": 1000, \"min-valid-lifetime\": 2000, " @@ -1089,6 +1100,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) { string after = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"valid-lifetime\": 5000, \"min-valid-lifetime\": 1000, " @@ -1104,6 +1116,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) { string crossed = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"valid-lifetime\": 1500, \"min-valid-lifetime\": 2000, " @@ -1190,6 +1203,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) { string too_small = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"preferred-lifetime\": 1000, \"min-preferred-lifetime\": 2000 }"; @@ -1207,6 +1221,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) { string too_large = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"preferred-lifetime\": 2000, \"max-preferred-lifetime\": 1000 }"; @@ -1221,6 +1236,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) { string before = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"preferred-lifetime\": 1000, \"min-preferred-lifetime\": 2000, " @@ -1236,6 +1252,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) { string after = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"preferred-lifetime\": 5000, \"min-preferred-lifetime\": 1000, " @@ -1251,6 +1268,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) { string crossed = "{ " + genIfaceConfig() + "," + "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/32\" } ]," "\"preferred-lifetime\": 1500, \"min-preferred-lifetime\": 2000, " @@ -1363,6 +1381,7 @@ TEST_F(Dhcp6ParserTest, subnetGlobalDefaults) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000," @@ -1407,19 +1426,22 @@ TEST_F(Dhcp6ParserTest, multipleSubnets) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" " " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ]," " \"subnet\": \"2001:db8:2::/64\", " - " \"id\": 0" " }," " {" + " \"id\": 3," " \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ]," " \"subnet\": \"2001:db8:3::/64\" " " }," " {" + " \"id\": 4," " \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ]," " \"subnet\": \"2001:db8:4::/64\" " " } ]," @@ -1699,6 +1721,7 @@ TEST_F(Dhcp6ParserTest, compatibility) { " \"lenient-option-parsing\": true" "}," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1728,6 +1751,7 @@ TEST_F(Dhcp6ParserTest, compatibilityUnknown) { " \"foo-bar\": true" "}," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1755,6 +1779,7 @@ TEST_F(Dhcp6ParserTest, compatibilityNotBool) { " \"lenient-option-parsing\": 1" "}," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1783,6 +1808,7 @@ TEST_F(Dhcp6ParserTest, subnetLocal) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"renew-timer\": 1, " " \"rebind-timer\": 2, " @@ -1832,6 +1858,7 @@ TEST_F(Dhcp6ParserTest, subnetInterface) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { " " \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"interface\": \"" + iface + "\"," @@ -1866,6 +1893,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceBogus) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"interface\": \"" + bogus_iface_ + "\"," " \"subnet\": \"2001:db8:1::/64\" } ]," @@ -1897,6 +1925,7 @@ TEST_F(Dhcp6ParserTest, interfaceGlobal) { "\"renew-timer\": 1000, " "\"interface\": \"" + valid_iface_ + "\"," // Not valid. Can be defined in subnet only "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1928,6 +1957,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceId) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"interface-id\": \"" + valid_interface_id + "\"," " \"subnet\": \"2001:db8:1::/64\" } ]," @@ -1971,6 +2001,7 @@ TEST_F(Dhcp6ParserTest, interfaceIdGlobal) { "\"renew-timer\": 1000, " "\"interface-id\": \"foobar\"," // Not valid. Can be defined in subnet only "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -1995,6 +2026,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceAndInterfaceId) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"interface\": \"" + valid_iface_ + "\"," " \"interface-id\": \"foobar\"," @@ -2089,6 +2121,7 @@ TEST_F(Dhcp6ParserTest, subnetRapidCommit) { "\"subnet6\": [ { " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - " "2001:db8:1::ffff\" } ]," + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }", false); @@ -2104,6 +2137,7 @@ TEST_F(Dhcp6ParserTest, subnetRapidCommit) { " \"pools\": [ { \"pool\": \"2001:db8:1::1 - " "2001:db8:1::ffff\" } ]," " \"rapid-commit\": true," + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }", true); @@ -2119,6 +2153,7 @@ TEST_F(Dhcp6ParserTest, subnetRapidCommit) { " \"pools\": [ { \"pool\": \"2001:db8:1::1 - " "2001:db8:1::ffff\" } ]," " \"rapid-commit\": false," + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }", false); @@ -2134,6 +2169,7 @@ TEST_F(Dhcp6ParserTest, multiplePools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ " " { \"pool\": \"2001:db8:1::/96\" }," " { \"pool\": \"2001:db8:1:0:abcd::/112\" }" @@ -2141,6 +2177,7 @@ TEST_F(Dhcp6ParserTest, multiplePools) { " \"subnet\": \"2001:db8:1::/64\" " " }," " {" + " \"id\": 2," " \"pools\": [ " " { \"pool\": \"2001:db8:2::1 - 2001:db8:2::ff\" }," " { \"pool\": \"2001:db8:2::300 - 2001:db8:2::3ff\" }" @@ -2195,6 +2232,7 @@ TEST_F(Dhcp6ParserTest, poolOutOfSubnet) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"4001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2225,6 +2263,7 @@ TEST_F(Dhcp6ParserTest, poolPrefixLen) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2257,6 +2296,7 @@ TEST_F(Dhcp6ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"foo/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2267,6 +2307,7 @@ TEST_F(Dhcp6ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/foo\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2277,6 +2318,7 @@ TEST_F(Dhcp6ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/200\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2287,6 +2329,7 @@ TEST_F(Dhcp6ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"foo\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2297,6 +2340,7 @@ TEST_F(Dhcp6ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"foo - bar\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2307,6 +2351,7 @@ TEST_F(Dhcp6ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::ffff - 2001:db8:1::\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2317,6 +2362,7 @@ TEST_F(Dhcp6ParserTest, badPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/1104\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"valid-lifetime\": 4000 }"; @@ -2393,6 +2439,7 @@ TEST_F(Dhcp6ParserTest, pdPoolBasics) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\"," " \"pd-pools\": [" " { \"prefix\": \"2001:db8:1::\", " @@ -2450,6 +2497,7 @@ TEST_F(Dhcp6ParserTest, pdPoolPrefixExclude) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\"," " \"pd-pools\": [" " { \"prefix\": \"3000::\", " @@ -2523,6 +2571,7 @@ TEST_F(Dhcp6ParserTest, pdPoolList) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1:04::/80\" } ]," " \"subnet\": \"2001:db8:1::/40\"," " \"pd-pools\": [" @@ -2590,6 +2639,7 @@ TEST_F(Dhcp6ParserTest, subnetAndPrefixDelegated) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\"," " \"pd-pools\": [" " { \"prefix\": \"2001:db8:1::\", " @@ -2649,6 +2699,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\"," " \"pd-pools\": [" " { " @@ -2663,6 +2714,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\"," " \"pd-pools\": [" " { \"prefix\": \"2001:db8:1::\", " @@ -2676,6 +2728,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\"," " \"pd-pools\": [" " { \"prefix\": \"2001:db8:1::\", " @@ -2689,6 +2742,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"subnet\": \"2001:db8:1::/64\"," " \"pd-pools\": [" " { \"prefix\": \"2001:db8:1::\", " @@ -3327,6 +3381,7 @@ TEST_F(Dhcp6ParserTest, optionDataDefaultsGlobal) { " \"data\": \"01\"" " } ]," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\"" " } ]," @@ -3391,6 +3446,7 @@ TEST_F(Dhcp6ParserTest, optionDataDefaultsSubnet) { "\"rebind-timer\": 2000," "\"renew-timer\": 1000," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\"," " \"option-data\": [ {" @@ -3491,6 +3547,7 @@ TEST_F(Dhcp6ParserTest, optionDataTwoSpaces) { " \"space\": \"isc\"" " } ]," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\"" " } ]" @@ -3627,6 +3684,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) { " \"space\": \"isc\"" " } ]," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\"" " } ]" @@ -3672,6 +3730,7 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\", " " \"option-data\": [ {" @@ -3681,6 +3740,7 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) { " } ]" " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ]," " \"subnet\": \"2001:db8:2::/64\", " " \"option-data\": [ {" @@ -3752,6 +3812,7 @@ TEST_F(Dhcp6ParserTest, optionDataMultiplePools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { " " \"pool\": \"2001:db8:1::10 - 2001:db8:1::100\"," " \"option-data\": [ {" @@ -4218,6 +4279,7 @@ TEST_F(Dhcp6ParserTest, vendorOptionsHex) { " \"csv-format\": false" " } ]," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\"" " } ]" @@ -4276,6 +4338,7 @@ TEST_F(Dhcp6ParserTest, vendorOptionsCsv) { " \"space\": \"vendor-4491\"" " } ]," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\"" " } ]" @@ -4398,6 +4461,7 @@ TEST_F(Dhcp6ParserTest, DISABLED_stdOptionDataEncapsulate) { " \"space\": \"vendor-1234\"" " } ]," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\"" " } ]" @@ -4732,6 +4796,7 @@ TEST_F(Dhcp6ParserTest, subnetRelayInfo) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"relay\": { " " \"ip-address\": \"2001:db8:1::abcd\"" @@ -4765,6 +4830,7 @@ TEST_F(Dhcp6ParserTest, subnetRelayInfoList) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"relay\": { " " \"ip-addresses\": [ \"2001:db9::abcd\", \"2001:db9::abce\" ]" @@ -4801,21 +4867,25 @@ TEST_F(Dhcp6ParserTest, classifySubnets) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\", " " \"client-class\": \"alpha\" " " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ]," " \"subnet\": \"2001:db8:2::/64\", " " \"client-class\": \"beta\" " " }," " {" + " \"id\": 3," " \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ]," " \"subnet\": \"2001:db8:3::/64\", " " \"client-class\": \"gamma\" " " }," " {" + " \"id\": 4," " \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ]," " \"subnet\": \"2001:db8:4::/64\" " " } ]," @@ -4894,6 +4964,7 @@ TEST_F(Dhcp6ParserTest, classifyPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { " " \"pool\": \"2001:db8:1::/80\", " " \"client-class\": \"alpha\" " @@ -4984,6 +5055,7 @@ TEST_F(Dhcp6ParserTest, classifyPdPools) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pd-pools\": [ { " " \"prefix-len\": 48, " " \"delegated-len\": 64, " @@ -5087,6 +5159,7 @@ TEST_F(Dhcp6ParserTest, d2ClientConfigValid) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ], " " \"dhcp-ddns\" : {" @@ -5156,6 +5229,7 @@ TEST_F(Dhcp6ParserTest, d2ClientConfigMoveToGlobal) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ], " " \"dhcp-ddns\" : {" @@ -5233,6 +5307,7 @@ TEST_F(Dhcp6ParserTest, d2ClientConfigBoth) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ], " " \"dhcp-ddns\" : {" @@ -5310,6 +5385,7 @@ TEST_F(Dhcp6ParserTest, invalidD2ClientConfig) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ], " " \"dhcp-ddns\" : {" @@ -5849,6 +5925,7 @@ TEST_F(Dhcp6ParserTest, hostReservationPerSubnet) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"reservations-global\": false," @@ -5856,6 +5933,7 @@ TEST_F(Dhcp6ParserTest, hostReservationPerSubnet) { " \"reservations-out-of-pool\": false" " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"subnet\": \"2001:db8:2::/48\", " " \"reservations-global\": false," @@ -5863,22 +5941,26 @@ TEST_F(Dhcp6ParserTest, hostReservationPerSubnet) { " \"reservations-out-of-pool\": true" " }," " {" + " \"id\": 3," " \"pools\": [ { \"pool\": \"2001:db8:3::/64\" } ]," " \"subnet\": \"2001:db8:3::/48\", " " \"reservations-global\": false," " \"reservations-in-subnet\": false" " }," " {" + " \"id\": 4," " \"pools\": [ { \"pool\": \"2001:db8:4::/64\" } ]," " \"subnet\": \"2001:db8:4::/48\", " " \"reservations-global\": true," " \"reservations-in-subnet\": false" " }," " {" + " \"id\": 5," " \"pools\": [ { \"pool\": \"2001:db8:5::/64\" } ]," " \"subnet\": \"2001:db8:5::/48\" " " }," " {" + " \"id\": 6," " \"pools\": [ { \"pool\": \"2001:db8:6::/64\" } ]," " \"subnet\": \"2001:db8:6::/48\", " " \"reservations-global\": true," @@ -5886,6 +5968,7 @@ TEST_F(Dhcp6ParserTest, hostReservationPerSubnet) { " \"reservations-out-of-pool\": false" " }," " {" + " \"id\": 7," " \"pools\": [ { \"pool\": \"2001:db8:7::/64\" } ]," " \"subnet\": \"2001:db8:7::/48\", " " \"reservations-global\": true," @@ -5983,6 +6066,7 @@ TEST_F(Dhcp6ParserTest, hostReservationGlobal) { "\"reservations-in-subnet\": true," "\"reservations-out-of-pool\": true," "\"subnet6\": [ { " + " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"reservations-global\": false," @@ -5990,6 +6074,7 @@ TEST_F(Dhcp6ParserTest, hostReservationGlobal) { " \"reservations-out-of-pool\": false" " }," " {" + " \"id\": 2," " \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"subnet\": \"2001:db8:2::/48\" " " } ]," @@ -6406,6 +6491,7 @@ TEST_F(Dhcp6ParserTest, validClientClassDictionary) { " } \n" "], \n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ], \n" " \"subnet\": \"2001:db8:1::/64\" } ], \n" "\"valid-lifetime\": 4000 } \n"; @@ -6448,6 +6534,7 @@ TEST_F(Dhcp6ParserTest, invalidClientClassDictionary) { " } \n" "], \n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8::1 - 2001:db8::ffff\" } ], \n" " \"subnet\": \"2001:db8::/64\" \n" " } ] \n" @@ -6635,6 +6722,7 @@ TEST_F(Dhcp6ParserTest, invalidPoolRange) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8:: - 200:1db8::ffff\" } ], \n" " \"subnet\": \"2001:db8::/32\" \n" " } ] \n" @@ -6653,7 +6741,7 @@ TEST_F(Dhcp6ParserTest, invalidPoolRange) { EXPECT_EQ(1, rcode); string expected = "Failed to create pool defined by: " - "2001:db8::-200:1db8::ffff (:7:26)"; + "2001:db8::-200:1db8::ffff (:8:26)"; EXPECT_EQ(expected, text); } @@ -6666,6 +6754,7 @@ TEST_F(Dhcp6ParserTest, outsideSubnetPool) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8:: - 2001:db8::ffff\" } ], \n" " \"subnet\": \"2001:dc8::/32\" \n" " } ] \n" @@ -6697,6 +6786,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksEmpty) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db8::/48\" \n" " } ],\n" "\"shared-networks\": [ ]\n" @@ -6713,6 +6803,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksNoName) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db8::/48\" \n" " } ],\n" "\"shared-networks\": [ { } ]\n" @@ -6728,6 +6819,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksEmptyName) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db8::/48\" \n" " } ],\n" "\"shared-networks\": [ { \"name\": \"\" } ]\n" @@ -6742,6 +6834,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksEmptyName) { TEST_F(Dhcp6ParserTest, sharedNetworksName) { string config = "{\n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db8::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db8::1 - 2001:db8::ffff\" } ]\n" " } ],\n" @@ -6775,6 +6868,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworks1subnet) { "\"shared-networks\": [ {\n" " \"name\": \"foo\"\n," " \"subnet6\": [ { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db8::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db8::1 - 2001:db8::ffff\" } ]\n" " } ]\n" @@ -6834,10 +6928,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworks3subnets) { " \"name\": \"foo\"\n," " \"subnet6\": [\n" " { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db1::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n" " },\n" " { \n" + " \"id\": 2, \n" " \"subnet\": \"2001:db2::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n" " \"renew-timer\": 2,\n" @@ -6850,6 +6946,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworks3subnets) { " \"max-valid-lifetime\": 3333\n" " },\n" " { \n" + " \"id\": 3, \n" " \"subnet\": \"2001:db3::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n" " }\n" @@ -6953,10 +7050,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDerive) { " \"reservations-in-subnet\": false,\n" " \"subnet6\": [\n" " { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db1::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n" " },\n" " { \n" + " \"id\": 2, \n" " \"subnet\": \"2001:db2::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n" " \"renew-timer\": 100\n," @@ -6982,6 +7081,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDerive) { " \"name\": \"bar\",\n" " \"subnet6\": [\n" " {\n" + " \"id\": 3, \n" " \"subnet\": \"2001:db3::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n" " }\n" @@ -7077,10 +7177,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDeriveInterfaces) { " \"rebind-timer\": 10, \n" " \"subnet6\": [\n" " { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db1::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n" " },\n" " { \n" + " \"id\": 2, \n" " \"subnet\": \"2001:db2::/48\",\n" " \"rebind-timer\": 100, \n" " \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n" @@ -7092,6 +7194,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDeriveInterfaces) { " \"name\": \"bar\",\n" " \"subnet6\": [\n" " {\n" + " \"id\": 3, \n" " \"subnet\": \"2001:db3::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n" " }\n" @@ -7162,10 +7265,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksInterfacesMixed) { " \"name\": \"foo\"\n," " \"subnet6\": [\n" " { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db1::/48\",\n" " \"interface\": \"eth0\"\n" " },\n" " { \n" + " \"id\": 2, \n" " \"subnet\": \"2001:db2::/48\",\n" " \"interface\": \"eth1\"\n" " }\n" @@ -7187,10 +7292,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDeriveClientClass) { " \"client-class\": \"alpha\",\n" " \"subnet6\": [\n" " { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db1::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n" " },\n" " { \n" + " \"id\": 2, \n" " \"subnet\": \"2001:db2::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n" " \"client-class\": \"beta\"\n" @@ -7201,6 +7308,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDeriveClientClass) { " \"name\": \"bar\",\n" " \"subnet6\": [\n" " {\n" + " \"id\": 3, \n" " \"subnet\": \"2001:db3::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n" " }\n" @@ -7265,10 +7373,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksRapidCommit) { " \"rapid-commit\": true,\n" " \"subnet6\": [\n" " { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db1::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n" " },\n" " { \n" + " \"id\": 2, \n" " \"subnet\": \"2001:db2::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n" " \"client-class\": \"beta\"\n" @@ -7280,6 +7390,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksRapidCommit) { " \"rapid-commit\": false,\n" " \"subnet6\": [\n" " {\n" + " \"id\": 3, \n" " \"subnet\": \"2001:db3::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n" " }\n" @@ -7334,11 +7445,13 @@ TEST_F(Dhcp6ParserTest, sharedNetworksRapidCommitMix) { " \"name\": \"frog\"\n," " \"subnet6\": [\n" " { \n" + " \"id\": 1, \n" " \"subnet\": \"2001:db1::/48\",\n" " \"rapid-commit\": true,\n" " \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n" " },\n" " { \n" + " \"id\": 2, \n" " \"subnet\": \"2001:db2::/48\",\n" " \"rapid-commit\": false,\n" " \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n" @@ -8018,11 +8131,13 @@ TEST_F(Dhcp6ParserTest, storeExtendedInfoGlobal) { "\"store-extended-info\": true," "\"subnet6\": [ " "{ " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\"," " \"store-extended-info\": false" "}," "{" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::ffff\" } ]," " \"subnet\": \"2001:db8:2::/64\" " "} ]," @@ -8054,10 +8169,12 @@ TEST_F(Dhcp6ParserTest, storeExtendedInfoNoGlobal) { "\"renew-timer\": 1000, " "\"subnet6\": [ " "{ " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\"" "}," "{" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::ffff\" } ]," " \"subnet\": \"2001:db8:2::/64\"," " \"store-extended-info\": true" @@ -8189,6 +8306,7 @@ TEST_F(Dhcp6ParserTest, clientClassValidPreferredLifetime) { " } \n" "], \n" "\"subnet6\": [ { \n" + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\"" " } ] \n" @@ -8253,6 +8371,7 @@ TEST_F(Dhcp6ParserTest, templateClientClassValidPreferredLifetime) { " } \n" "], \n" "\"subnet6\": [ { \n" + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\"" " } ] \n" diff --git a/src/bin/dhcp6/tests/confirm_unittest.cc b/src/bin/dhcp6/tests/confirm_unittest.cc index c61873667c..7aefeea48d 100644 --- a/src/bin/dhcp6/tests/confirm_unittest.cc +++ b/src/bin/dhcp6/tests/confirm_unittest.cc @@ -41,12 +41,14 @@ const char* CONFIRM_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface-id\": \"\"," " \"interface\": \"eth0\"" " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"subnet\": \"2001:db8:2::/48\", " " \"interface-id\": \"\"," @@ -62,12 +64,14 @@ const char* CONFIRM_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"3000:1::/64\" } ]," " \"subnet\": \"3000:1::/48\", " " \"interface-id\": \"\"," " \"interface\": \"eth0\"" " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"3000:2::/64\" } ]," " \"subnet\": \"3000:2::/48\", " " \"interface-id\": \"\"," diff --git a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc index ee36a7c297..f39062b949 100644 --- a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc @@ -661,13 +661,13 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configSet) { " }," " \"subnet6\": [ \n"; string subnet1 = - " {\"subnet\": \"3002::/64\", \n" + " {\"subnet\": \"3002::/64\", \"id\": 1, \n" " \"pools\": [{ \"pool\": \"3002::100-3002::200\" }]}\n"; string subnet2 = - " {\"subnet\": \"3003::/64\", \n" + " {\"subnet\": \"3003::/64\", \"id\": 2, \n" " \"pools\": [{ \"pool\": \"3003::100-3003::200\" }]}\n"; string bad_subnet = - " {\"comment\": \"3005::/64\", \n" + " {\"comment\": \"3005::/64\", \"id\": 10, \n" " \"pools\": [{ \"pool\": \"3005::100-3005::200\" }]}\n"; string subnet_footer = " ] \n"; @@ -899,13 +899,13 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configTest) { " }," " \"subnet6\": [ \n"; string subnet1 = - " {\"subnet\": \"3002::/64\", \n" + " {\"subnet\": \"3002::/64\", \"id\": 1, \n" " \"pools\": [{ \"pool\": \"3002::100-3002::200\" }]}\n"; string subnet2 = - " {\"subnet\": \"3003::/64\", \n" + " {\"subnet\": \"3003::/64\", \"id\": 2, \n" " \"pools\": [{ \"pool\": \"3003::100-3003::200\" }]}\n"; string bad_subnet = - " {\"comment\": \"3005::/64\", \n" + " {\"comment\": \"3005::/64\", \"id\": 10, \n" " \"pools\": [{ \"pool\": \"3005::100-3005::200\" }]}\n"; string subnet_footer = " ] \n"; @@ -1607,8 +1607,8 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configReloadValid) { " \"interfaces\": [ \"*\" ]" " }," " \"subnet6\": [" - " { \"subnet\": \"2001:db8:1::/64\" }," - " { \"subnet\": \"2001:db8:2::/64\" }" + " { \"subnet\": \"2001:db8:1::/64\", \"id\": 1 }," + " { \"subnet\": \"2001:db8:2::/64\", \"id\": 2 }" " ]," " \"lease-database\": {" " \"type\": \"memfile\", \"persist\": false }" diff --git a/src/bin/dhcp6/tests/d2_unittest.cc b/src/bin/dhcp6/tests/d2_unittest.cc index ef58d21d5a..98157d275f 100644 --- a/src/bin/dhcp6/tests/d2_unittest.cc +++ b/src/bin/dhcp6/tests/d2_unittest.cc @@ -105,6 +105,7 @@ Dhcp6SrvD2Test::configureD2(bool enable_d2, const bool exp_result, "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"subnet\": \"2001:db8:1::/64\" } ]," " \"dhcp-ddns\" : {" diff --git a/src/bin/dhcp6/tests/decline_unittest.cc b/src/bin/dhcp6/tests/decline_unittest.cc index 7ae1701c38..b3db3adbcd 100644 --- a/src/bin/dhcp6/tests/decline_unittest.cc +++ b/src/bin/dhcp6/tests/decline_unittest.cc @@ -36,6 +36,7 @@ const char* DECLINE_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface-id\": \"\"," @@ -56,6 +57,7 @@ const char* DECLINE_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface-id\": \"\"," @@ -76,6 +78,7 @@ const char* DECLINE_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface-id\": \"\"," diff --git a/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in b/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in index 8fd9b35867..0857287937 100644 --- a/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in +++ b/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in @@ -51,6 +51,7 @@ CONFIG="{ \"subnet6\": [ { \"subnet\": \"2001:db8:1::/64\", + \"id\": 1, \"pools\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ] } ], \"dhcp-ddns\": { @@ -91,6 +92,7 @@ CONFIG_BAD_SYNTAX="{ \"subnet6\": [ { \"subnet\": \"2001:db8:1::/64\", + \"id\": 1, \"pool\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ] } ], \"loggers\": [ @@ -127,6 +129,7 @@ CONFIG_INVALID="{ \"subnet6\": [ { \"subnet\": \"2001:db8:1::/64\", + \"id\": 1, \"pool\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ] } ], \"loggers\": [ @@ -169,6 +172,7 @@ CONFIG_BAD_VALUES="{ \"subnet6\": [ { \"subnet\": \"2001:db8::/64\", + \"id\": 1, \"pools\": [ { \"pool\": \"3000::-3000::ffff\" } ] } ], \"dhcp-ddns\": { @@ -207,6 +211,7 @@ INVALID_CONFIG_HOOKS_LOAD="{ \"subnet6\": [ { \"subnet\": \"2001:db8:1::/64\", + \"id\": 1, \"pools\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ] } ], \"dhcp-ddns\": { @@ -263,6 +268,7 @@ INVALID_CONFIG_HOOKS_CALLOUT_FAIL="{ \"subnet6\": [ { \"subnet\": \"2001:db8:1::/64\", + \"id\": 1, \"pools\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ] } ], \"dhcp-ddns\": { diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index ee4eb465e1..5a618d1d1b 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -77,6 +77,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth0\", " @@ -108,6 +109,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\" " " } ]," @@ -123,6 +125,7 @@ const char* CONFIGS[] = { " \"renew-timer\": 1000, " " \"valid-lifetime\": 4000, " " \"subnet6\": [ {" + " \"id\": 1, " " \"interface\": \"eth0\", " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " " \"subnet\": \"2001:db8:1::/48\"" @@ -150,6 +153,7 @@ const char* CONFIGS[] = { " \"renew-timer\": 1000, " " \"valid-lifetime\": 4000, " " \"subnet6\": [ {" + " \"id\": 1, " " \"interface\": \"eth0\", " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], " " \"subnet\": \"2001:db8:1::/48\", " @@ -177,6 +181,7 @@ const char* CONFIGS[] = { // - user-contexts defined in subnet and each pool "{" " \"subnet6\": [ {" + " \"id\": 1, " " \"pools\": [ {" " \"pool\": \"2001:db8:1::/64\"," " \"user-context\": { \"value\": 42 }" @@ -2842,6 +2847,7 @@ TEST_F(Dhcpv6SrvTest, relaySourcePort) { " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " " \"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/48\" " " } ]," @@ -3127,12 +3133,14 @@ TEST_F(Dhcpv6SrvTest, relayOverride) { "\"renew-timer\": 1000, " "\"subnet6\": [ " " { \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"relay\": { " " \"ip-address\": \"2001:db8:3::1\"" " }" " }, " " { \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," + " \"id\": 2, " " \"subnet\": \"2001:db8:2::/48\", " " \"relay\": { " " \"ip-address\": \"2001:db8:3::2\"" @@ -3237,6 +3245,7 @@ TEST_F(Dhcpv6SrvTest, rsoo) { " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " " \"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/48\" " " } ]," @@ -3288,6 +3297,7 @@ TEST_F(Dhcpv6SrvTest, rsoo2relays) { " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " " \"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/48\" " " } ]," @@ -3405,6 +3415,7 @@ TEST_F(Dhcpv6SrvTest, rsooOverride) { " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " " \"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/48\" " " } ]," @@ -3559,6 +3570,7 @@ TEST_F(Dhcpv6SrvTest, emptyClientId) { " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " " \"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/48\" " " } ]," @@ -3596,6 +3608,7 @@ TEST_F(Dhcpv6SrvTest, emptyServerId) { " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " " \"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/48\" " " } ]," @@ -3629,6 +3642,7 @@ TEST_F(Dhcpv6SrvTest, tooLongServerId) { " \"rebind-timer\": 2000, " " \"renew-timer\": 1000, " " \"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/48\" " " } ]," diff --git a/src/bin/dhcp6/tests/fqdn_unittest.cc b/src/bin/dhcp6/tests/fqdn_unittest.cc index 9deabdd6a0..31d3d37469 100644 --- a/src/bin/dhcp6/tests/fqdn_unittest.cc +++ b/src/bin/dhcp6/tests/fqdn_unittest.cc @@ -427,6 +427,7 @@ public: "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], \n" " \"subnet\": \"2001:db8:1::/48\", \n" " \"interface\": \"eth0\" \n" @@ -1462,6 +1463,7 @@ TEST_F(FqdnDhcpv6SrvTest, hostnameReservationSuffix) { "\"renew-timer\": 1000, " "\"subnet6\": [ " " { " + " \"id\": 1, \n" " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1:1::/64\" } ]," " \"interface\" : \"eth0\" , " @@ -1516,6 +1518,7 @@ TEST_F(FqdnDhcpv6SrvTest, hostnameReservationNoSuffix) { "\"renew-timer\": 1000, " "\"subnet6\": [ " " { " + " \"id\": 1, \n" " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1:1::/64\" } ]," " \"interface\" : \"eth0\" , " @@ -1565,6 +1568,7 @@ TEST_F(FqdnDhcpv6SrvTest, hostnameReservationDdnsDisabled) { "\"renew-timer\": 1000, " "\"subnet6\": [ " " { " + " \"id\": 1, \n" " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1:1::/64\" } ]," " \"interface\" : \"eth0\" , " @@ -1667,11 +1671,13 @@ TEST_F(FqdnDhcpv6SrvTest, ddnsScopeTest) { "\"renew-timer\": 1000,\n" "\"ddns-send-updates\": false,\n" "\"subnet6\": [ {\n" + " \"id\": 1, \n" " \"subnet\": \"2001:db8:1::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::10\" } ],\n" " \"interface\": \"eth0\"\n" " },\n" " {\n" + " \"id\": 2, \n" " \"subnet\": \"2001:db8:2::/48\",\n" " \"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::10\" } ],\n" " \"interface\": \"eth1\",\n" @@ -1764,12 +1770,14 @@ TEST_F(FqdnDhcpv6SrvTest, ddnsSharedNetworkTest) { "\"name\": \"frog\", \n" "\"interface\": \"eth0\", \n" "\"subnet6\": [ { \n" + "\"id\": 1, \n" "\"subnet\": \"2001:db8:1::/64\", \n" "\"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::1\" } ], \n" "\"interface\": \"eth0\", \n" "\"ddns-qualifying-suffix\": \"one.example.com.\" \n" " }, \n" " { \n" + "\"id\": 2, \n" "\"subnet\": \"2001:db8:2::/64\", \n" "\"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::1\" } ], \n" "\"interface\": \"eth0\", \n" @@ -1918,6 +1926,7 @@ TEST_F(FqdnDhcpv6SrvTest, ddnsSharedNetworkTest2) { "\"name\": \"frog\", \n" "\"interface\": \"eth0\", \n" "\"subnet6\": [ { \n" + "\"id\": 1, \n" "\"subnet\": \"2001:db8:1::/64\", \n" "\"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::1\" } ], \n" "\"interface\": \"eth0\", \n" @@ -1925,6 +1934,7 @@ TEST_F(FqdnDhcpv6SrvTest, ddnsSharedNetworkTest2) { "\"ddns-send-updates\": true \n" " }, \n" " { \n" + "\"id\": 2, \n" "\"subnet\": \"2001:db8:2::/64\", \n" "\"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::1\" } ], \n" "\"interface\": \"eth0\", \n" diff --git a/src/bin/dhcp6/tests/hooks_unittest.cc b/src/bin/dhcp6/tests/hooks_unittest.cc index d5246d0ea2..06a5d21c17 100644 --- a/src/bin/dhcp6/tests/hooks_unittest.cc +++ b/src/bin/dhcp6/tests/hooks_unittest.cc @@ -1704,10 +1704,12 @@ TEST_F(HooksDhcpv6SrvTest, subnet6SelectSimple) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"" + valid_iface_ + "\" " " }, {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"subnet\": \"2001:db8:2::/48\" " " } ]," @@ -1792,10 +1794,12 @@ TEST_F(HooksDhcpv6SrvTest, subnet6SelectChange) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"" + valid_iface_ + "\" " " }, {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"subnet\": \"2001:db8:2::/48\" " " } ]," @@ -1902,6 +1906,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedSolicit) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -1941,6 +1946,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedConfirm) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -1984,6 +1990,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedInfRequest) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -2023,6 +2030,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRapidCommit) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"rapid-commit\": true, " @@ -2088,6 +2096,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedParkRapidCommitPrefixes) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [ {" " \"prefix\": \"2001:db8:1::\", " " \"prefix-len\": 56, " @@ -2201,6 +2210,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRequest) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -2375,6 +2385,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRequestPrefix) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [ {" " \"prefix\": \"2001:db8:1::\", " " \"prefix-len\": 56, " @@ -2556,6 +2567,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRenew) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -2727,6 +2739,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRenewPrefix) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [ {" " \"prefix\": \"2001:db8:1::\", " " \"prefix-len\": 56, " @@ -2905,6 +2918,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRebind) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -3079,6 +3093,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRebindPrefix) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [ {" " \"prefix\": \"2001:db8:1::\", " " \"prefix-len\": 56, " @@ -3260,6 +3275,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedDecline) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -3324,6 +3340,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedDeclineTwoNAs) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -3391,6 +3408,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRelease) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -3455,6 +3473,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedReleasePrefix) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [ {" " \"prefix\": \"2001:db8:1::\", " " \"prefix-len\": 56, " @@ -3524,6 +3543,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedReleaseMultiple) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"pd-pools\": [ {" " \"prefix\": \"2001:db8:2::\", " @@ -3594,6 +3614,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedCache) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\", " @@ -3683,6 +3704,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedCachePrefix) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [ {" " \"prefix\": \"2001:db8:1::\", " " \"prefix-len\": 56, " @@ -3775,6 +3797,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedParkRequests) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " @@ -3880,6 +3903,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedParkRequestsPrefixes) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [ {" " \"prefix\": \"2001:db8:1::\", " " \"prefix-len\": 56, " @@ -5355,6 +5379,7 @@ TEST_F(HooksDhcpv6SrvTest, host6Identifier) { "\"renew-timer\": 1000,\n" "\"host-reservation-identifiers\": [ \"flex-id\" ],\n" "\"subnet6\": [ {\n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],\n" " \"subnet\": \"2001:db8::/48\", \n" " \"interface\": \"" + valid_iface_ + "\",\n" @@ -5438,6 +5463,7 @@ TEST_F(HooksDhcpv6SrvTest, host6IdentifierHWAddr) { "\"renew-timer\": 1000,\n" "\"host-reservation-identifiers\": [ \"flex-id\" ],\n" "\"subnet6\": [ {\n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],\n" " \"subnet\": \"2001:db8::/48\", \n" " \"interface\": \"" + valid_iface_ + "\",\n" @@ -5696,6 +5722,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6ParkedPacketLimit) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth1\" " diff --git a/src/bin/dhcp6/tests/host_unittest.cc b/src/bin/dhcp6/tests/host_unittest.cc index 1424826cb3..efc3f463d0 100644 --- a/src/bin/dhcp6/tests/host_unittest.cc +++ b/src/bin/dhcp6/tests/host_unittest.cc @@ -70,6 +70,7 @@ const char* CONFIGS[] = { "\"renew-timer\": 1000, " "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1:1::/64\" } ]," " \"interface\" : \"eth0\" , " @@ -98,6 +99,7 @@ const char* CONFIGS[] = { "\"mac-sources\": [ \"ipv6-link-local\" ], " "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"interface\" : \"eth0\" , " @@ -126,6 +128,7 @@ const char* CONFIGS[] = { "\"mac-sources\": [ \"ipv6-link-local\" ], " "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"interface\" : \"eth0\" , " @@ -157,6 +160,7 @@ const char* CONFIGS[] = { "} ]," "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ {" " \"pool\": \"2001:db8:1::/64\"," @@ -206,6 +210,7 @@ const char* CONFIGS[] = { "\"renew-timer\": 1000, " "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"interface\" : \"eth0\"," @@ -246,6 +251,7 @@ const char* CONFIGS[] = { "} ]," "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"interface\" : \"eth0\"," @@ -278,6 +284,7 @@ const char* CONFIGS[] = { "\"renew-timer\": 10, " "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::2\" } ]," " \"pd-pools\": [" @@ -303,6 +310,7 @@ const char* CONFIGS[] = { "\"renew-timer\": 10, " "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::2\" } ]," " \"pd-pools\": [" @@ -1298,6 +1306,7 @@ HostTest::configString(const DUID& duid, "\"renew-timer\": 1000, " "\"subnet6\": [ " " { " + " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::10\" } ]," " \"pd-pools\": [ { \"prefix\": \"3001::\", \"prefix-len\": 32," diff --git a/src/bin/dhcp6/tests/infrequest_unittest.cc b/src/bin/dhcp6/tests/infrequest_unittest.cc index a264b09c2f..154af2bf25 100644 --- a/src/bin/dhcp6/tests/infrequest_unittest.cc +++ b/src/bin/dhcp6/tests/infrequest_unittest.cc @@ -44,6 +44,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"pd-pools\": [" " { \"prefix\": \"2001:db8:3::\", " @@ -67,6 +68,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"option-data\": [ {" " \"name\": \"sip-server-addr\"," " \"data\": \"2001:db8::abcd\"" @@ -88,6 +90,7 @@ const char* CONFIGS[] = { " \"data\": \"2001:db8::1\"" " } ]," "\"subnet6\": [ { " + " \"id\": 1, " " \"subnet\": \"2001:db8::/32\", " " \"interface\": \"eth0\"," " \"option-data\": [ {" diff --git a/src/bin/dhcp6/tests/kea_controller_unittest.cc b/src/bin/dhcp6/tests/kea_controller_unittest.cc index c7677397db..eb06f34707 100644 --- a/src/bin/dhcp6/tests/kea_controller_unittest.cc +++ b/src/bin/dhcp6/tests/kea_controller_unittest.cc @@ -384,15 +384,17 @@ TEST_F(JSONFileBackendTest, jsonFile) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" " " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ]," " \"subnet\": \"2001:db8:2::/64\", " - " \"id\": 0" " }," " {" + " \"id\": 3, " " \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ]," " \"subnet\": \"2001:db8:3::/64\" " " } ]," @@ -470,6 +472,7 @@ TEST_F(JSONFileBackendTest, hashComments) { "\"renew-timer\": 1000, \n" "# comments in the middle should be ignored, too\n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" " " } ]," @@ -522,6 +525,7 @@ TEST_F(JSONFileBackendTest, cppLineComments) { "\"renew-timer\": 1000, \n" "// comments in the middle should be ignored, too\n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" " " } ]," @@ -574,6 +578,7 @@ TEST_F(JSONFileBackendTest, cBlockComments) { "\"renew-timer\": 1000, \n" "/* comments in the middle should be ignored, too*/\n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" " " } ]," @@ -627,6 +632,7 @@ TEST_F(JSONFileBackendTest, include) { "}"; string include = "\n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" " " } ]\n"; @@ -674,6 +680,7 @@ TEST_F(JSONFileBackendTest, recursiveInclude) { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, \n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ]," " \"subnet\": \"2001:db8:1::/64\" " " } ]," diff --git a/src/bin/dhcp6/tests/parser_unittest.cc b/src/bin/dhcp6/tests/parser_unittest.cc index 50ec6566bc..4ea7a282c0 100644 --- a/src/bin/dhcp6/tests/parser_unittest.cc +++ b/src/bin/dhcp6/tests/parser_unittest.cc @@ -140,6 +140,7 @@ TEST(ParserTest, keywordDhcp6) { "\"rebind-timer\": 2000, \n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"test\" } ],\n" @@ -160,6 +161,7 @@ TEST(ParserTest, bashComments) { "# and here\n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth0\"" @@ -177,6 +179,7 @@ TEST(ParserTest, cppComments) { "\"rebind-timer\": 2000, // everything after // is ignored\n" "\"renew-timer\": 1000, // this will be ignored, too\n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth0\"" @@ -194,6 +197,7 @@ TEST(ParserTest, bashCommentsInline) { "\"rebind-timer\": 2000, # everything after # is ignored\n" "\"renew-timer\": 1000, # this will be ignored, too\n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth0\"" @@ -212,6 +216,7 @@ TEST(ParserTest, multilineComments) { "\"rebind-timer\": 2000,\n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth0\"" @@ -230,6 +235,7 @@ TEST(ParserTest, embbededComments) { "\"rebind-timer\": 2000,\n" "\"renew-timer\": 1000, \n" "\"subnet6\": [ { " + " \"id\": 1, " " \"user-context\": { \"comment\": \"indirect\" }," " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " @@ -939,6 +945,7 @@ TEST_F(TrailingCommasTest, tests) { }, ], "subnet": "2001:db8:1::/64", + "id": 1, }, ], }, @@ -957,10 +964,10 @@ TEST_F(TrailingCommasTest, tests) { addLog(":32.8"); addLog(":43.38"); addLog(":44.12"); - addLog(":46.36"); - addLog(":47.8"); - addLog(":48.6"); - addLog(":49.4"); + addLog(":47.16"); + addLog(":48.8"); + addLog(":49.6"); + addLog(":50.4"); EXPECT_TRUE(checkFile()); // Test with many consecutive commas. diff --git a/src/bin/dhcp6/tests/rebind_unittest.cc b/src/bin/dhcp6/tests/rebind_unittest.cc index 9e0298e424..48801e6d96 100644 --- a/src/bin/dhcp6/tests/rebind_unittest.cc +++ b/src/bin/dhcp6/tests/rebind_unittest.cc @@ -87,12 +87,14 @@ const char* REBIND_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface-id\": \"\"," " \"interface\": \"eth0\"" " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"subnet\": \"2001:db8:2::/48\", " " \"interface-id\": \"\"," @@ -108,12 +110,14 @@ const char* REBIND_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:3::/64\" } ]," " \"subnet\": \"2001:db8:3::/48\", " " \"interface-id\": \"\"," " \"interface\": \"eth1\"" " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:4::/64\" } ]," " \"subnet\": \"2001:db8:4::/48\", " " \"interface-id\": \"\"," @@ -129,12 +133,14 @@ const char* REBIND_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"3000:1::/64\" } ]," " \"subnet\": \"3000:1::/48\", " " \"interface-id\": \"\"," " \"interface\": \"eth0\"" " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"3000:2::/64\" } ]," " \"subnet\": \"3000:2::/48\", " " \"interface-id\": \"\"," @@ -150,12 +156,14 @@ const char* REBIND_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"3000:3::/64\" } ]," " \"subnet\": \"3000:3::/48\", " " \"interface-id\": \"\"," " \"interface\": \"eth1\"" " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"3000:4::/64\" } ]," " \"subnet\": \"3000:4::/48\", " " \"interface-id\": \"\"," @@ -171,6 +179,7 @@ const char* REBIND_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [" " { \"prefix\": \"3000::\", " " \"prefix-len\": 72, " @@ -181,6 +190,7 @@ const char* REBIND_CONFIGS[] = { " \"interface\": \"eth0\"" " }," " {" + " \"id\": 2, " " \"pd-pools\": [" " { \"prefix\": \"2001:db8:2::\", " " \"prefix-len\": 72, " @@ -200,6 +210,7 @@ const char* REBIND_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [" " { \"prefix\": \"2001:db8:3:01::\", " " \"prefix-len\": 72, " @@ -210,6 +221,7 @@ const char* REBIND_CONFIGS[] = { " \"interface\": \"eth1\"" " }," " {" + " \"id\": 2, " " \"pd-pools\": [" " { \"prefix\": \"2001:db8:4:01::\", " " \"prefix-len\": 72, " @@ -229,6 +241,7 @@ const char* REBIND_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"pd-pools\": [" " { \"prefix\": \"3000::\", " @@ -254,12 +267,14 @@ const char* REBIND_CONFIGS[] = { " \"data\": \"normal_erouter_v6.cm\"" "}]," "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface-id\": \"\"," " \"interface\": \"eth0\"" " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"subnet\": \"2001:db8:2::/48\", " " \"interface-id\": \"\"," @@ -323,6 +338,7 @@ const char* REBIND_CONFIGS[] = { " \"data\": \"3000:1::789\"" " } ]" " } ]," + " \"id\": 1, " " \"subnet\": \"3000::/32\", " " \"interface\": \"eth0\"" " } ]," diff --git a/src/bin/dhcp6/tests/renew_unittest.cc b/src/bin/dhcp6/tests/renew_unittest.cc index ef93342653..644bc970b7 100644 --- a/src/bin/dhcp6/tests/renew_unittest.cc +++ b/src/bin/dhcp6/tests/renew_unittest.cc @@ -70,6 +70,7 @@ const char* RENEW_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface-id\": \"\"," @@ -85,6 +86,7 @@ const char* RENEW_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [" " { \"prefix\": \"3000::\", " " \"prefix-len\": 72, " @@ -104,6 +106,7 @@ const char* RENEW_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"pd-pools\": [" " { \"prefix\": \"3000::\", " @@ -129,6 +132,7 @@ const char* RENEW_CONFIGS[] = { " \"data\": \"normal_erouter_v6.cm\"" "}]," "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface-id\": \"\"," @@ -152,6 +156,7 @@ const char* RENEW_CONFIGS[] = { " \"data\": \"3000:2::1\"" "} ]," "\"subnet6\": [ { " + " \"id\": 1, " " \"option-data\": [ {" " \"name\": \"dns-servers\"," " \"data\": \"3000:1::567\"" @@ -206,6 +211,7 @@ const char* RENEW_CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"pd-pools\": [" " { \"prefix\": \"3000::\", " diff --git a/src/bin/dhcp6/tests/sarr_unittest.cc b/src/bin/dhcp6/tests/sarr_unittest.cc index 00be27b4c7..2d379bedfc 100644 --- a/src/bin/dhcp6/tests/sarr_unittest.cc +++ b/src/bin/dhcp6/tests/sarr_unittest.cc @@ -83,6 +83,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [" " { \"prefix\": \"2001:db8:3::\", " " \"prefix-len\": 48, " @@ -102,12 +103,14 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::10\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth0\"," " \"rapid-commit\": true" " }," " {" + " \"id\": 2, " " \"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::10\" } ]," " \"subnet\": \"2001:db8:2::/48\", " " \"interface\": \"eth1\"," @@ -135,6 +138,7 @@ const char* CONFIGS[] = { " \"data\": \"3000:2::1\"" "} ]," "\"subnet6\": [ { " + " \"id\": 1, " " \"option-data\": [ {" " \"name\": \"dns-servers\"," " \"data\": \"3000:1::567\"" @@ -189,6 +193,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pd-pools\": [" " { \"prefix\": \"2001:db8:3::\", " " \"prefix-len\": 48, " @@ -211,6 +216,7 @@ const char* CONFIGS[] = { "\"rebind-timer\": 2000, " "\"renew-timer\": 1000, " "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::10\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"interface\": \"eth0\", " @@ -253,6 +259,7 @@ const char* CONFIGS[] = { " \"delegated-len\": 64" " }" " ]," + " \"id\": 1, " " \"subnet\": \"3000::/32\", " " \"interface\": \"eth0\"" " }" @@ -282,6 +289,7 @@ const char* CONFIGS[] = { " \"delegated-len\": 64" " }" " ]," + " \"id\": 1, " " \"subnet\": \"3000::/32\", " " \"interface\": \"eth0\"" " }" diff --git a/src/bin/dhcp6/tests/shared_network_unittest.cc b/src/bin/dhcp6/tests/shared_network_unittest.cc index cade57fd71..aaa7ff10f5 100644 --- a/src/bin/dhcp6/tests/shared_network_unittest.cc +++ b/src/bin/dhcp6/tests/shared_network_unittest.cc @@ -1114,6 +1114,7 @@ const char* NETWORKS_CONFIG[] = { " \"interface\": \"eth1\"," " \"subnet6\": [" " {" + " \"id\": 100, " " \"subnet\": \"2001:db8:1::/64\"," " \"pd-allocator\": \"flq\"," " \"pd-pools\": [" @@ -1125,6 +1126,7 @@ const char* NETWORKS_CONFIG[] = { " ]" " }," " {" + " \"id\": 10, " " \"subnet\": \"2001:db8:2::/64\"," " \"pd-allocator\": \"random\"," " \"pd-pools\": [" @@ -1150,6 +1152,7 @@ const char* NETWORKS_CONFIG[] = { " \"interface\": \"eth1\"," " \"subnet6\": [" " {" + " \"id\": 100, " " \"subnet\": \"2001:db8:1::/64\"," " \"pd-allocator\": \"random\"," " \"pd-pools\": [" @@ -1161,6 +1164,7 @@ const char* NETWORKS_CONFIG[] = { " ]" " }," " {" + " \"id\": 10, " " \"subnet\": \"2001:db8:2::/64\"," " \"pd-allocator\": \"flq\"," " \"pd-pools\": [" diff --git a/src/bin/dhcp6/tests/tee_times_unittest.cc b/src/bin/dhcp6/tests/tee_times_unittest.cc index c91818b56d..530f04fc7c 100644 --- a/src/bin/dhcp6/tests/tee_times_unittest.cc +++ b/src/bin/dhcp6/tests/tee_times_unittest.cc @@ -38,6 +38,7 @@ const char* TEE_CONFIGS[] = { " \"subnet6\": [ { \n" " \"interface\": \"eth0\", \n" " \"subnet\": \"2001:db8:1::/48\", \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], \n" " \"pd-pools\": [ \n" " { \n" @@ -54,6 +55,7 @@ const char* TEE_CONFIGS[] = { " \"subnet6\": [ { \n" " \"interface\": \"eth0\", \n" " \"subnet\": \"2001:db8:1::/48\", \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], \n" " \"pd-pools\": [ \n" " { \n" @@ -72,6 +74,7 @@ const char* TEE_CONFIGS[] = { " \"subnet6\": [ { \n" " \"interface\": \"eth0\", \n" " \"subnet\": \"2001:db8:1::/48\", \n" + " \"id\": 1, \n" " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], \n" " \"pd-pools\": [ \n" " { \n" diff --git a/src/bin/dhcp6/tests/vendor_opts_unittest.cc b/src/bin/dhcp6/tests/vendor_opts_unittest.cc index f179e2ff00..db613e15f4 100644 --- a/src/bin/dhcp6/tests/vendor_opts_unittest.cc +++ b/src/bin/dhcp6/tests/vendor_opts_unittest.cc @@ -157,6 +157,7 @@ public: } ], "subnet": "2001:db8:1::/48", + "id": 1, "interface-id": "" } ] @@ -413,6 +414,7 @@ public: } ], "subnet": "2001:db8:1::/48", + "id": 1, "interface-id": "" } ] @@ -644,6 +646,7 @@ public: } ], "subnet": "2001:db8:1::/48", + "id": 1, "interface-id": "" } ] @@ -851,7 +854,8 @@ private: "pool": "2001:db8::/64" } ], - "subnet": "2001:db8::/64" + "subnet": "2001:db8::/64", + "id": 1 } ] } @@ -1344,6 +1348,7 @@ TEST_F(VendorOptsTest, vendorNeverSend) { " \"data\": \"ISC\"" " }]," "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"renew-timer\": 1000, " @@ -1444,6 +1449,7 @@ TEST_F(VendorOptsTest, vendorOptionsDocsisDefinitions) { " \"csv-format\": true" " }]," "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ]," " \"subnet\": \"2001:db8:1::/48\", " " \"renew-timer\": 1000, " @@ -1551,6 +1557,7 @@ TEST_F(VendorOptsTest, vendorOpsInResponseOnly) { " } ]" " } ]," "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/64\", " " \"interface\": \"eth0\" " @@ -1666,6 +1673,7 @@ TEST_F(VendorOptsTest, twoVendors) { " }" " ]," "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/64\", " " \"interface\": \"eth0\" " @@ -1819,6 +1827,7 @@ TEST_F(VendorOptsTest, threeVendors) { " }" " ]," "\"subnet6\": [ { " + " \"id\": 1, " " \"pools\": [ { \"pool\": \"2001:db8::/64\" } ]," " \"subnet\": \"2001:db8::/64\", " " \"interface\": \"eth0\" " -- 2.47.2