From: Francis Dupont Date: Fri, 2 Apr 2021 11:59:56 +0000 (+0200) Subject: [#1515] Addressed known bugs X-Git-Tag: Kea-1.9.7~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63dc38deae466cc98b76cfb5bc7db807d8e0e387;p=thirdparty%2Fkea.git [#1515] Addressed known bugs --- diff --git a/src/bin/d2/tests/d2_update_mgr_unittests.cc b/src/bin/d2/tests/d2_update_mgr_unittests.cc index c78c4f4dad..a89de3e273 100644 --- a/src/bin/d2/tests/d2_update_mgr_unittests.cc +++ b/src/bin/d2/tests/d2_update_mgr_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -102,7 +102,7 @@ public: " \"use-conflict-resolution\" : true " "}"; - const char* dhcids[] = { "111111", "222222", "333333", "444444"}; + const char* dhcids[] = { "111111", "222222", "333333", "444444" }; canned_count_ = 4; for (int i = 0; i < canned_count_; i++) { dhcp_ddns::NameChangeRequestPtr ncr = NameChangeRequest:: @@ -122,27 +122,27 @@ public: "\"port\" : 88 , " "\"tsig-keys\": [] ," "\"forward-ddns\" : {" - "\"ddns-domains\": [ " - "{ \"name\": \"example.com.\" , " - " \"dns-servers\" : [ " - " { \"ip-address\": \"127.0.0.1\", \"port\" : 5301 } " - " ] }," - "{ \"name\": \"org.\" , " - " \"dns-servers\" : [ " - " { \"ip-address\": \"127.0.0.1\" } " + " \"ddns-domains\": [ " + " { \"name\": \"example.com.\" , " + " \"dns-servers\" : [ " + " { \"ip-address\": \"127.0.0.1\", \"port\" : 5301 } " + " ] }," + " { \"name\": \"org.\" , " + " \"dns-servers\" : [ " + " { \"ip-address\": \"127.0.0.1\" } " + " ] }" " ] }, " - "] }, " "\"reverse-ddns\" : { " - "\"ddns-domains\": [ " - "{ \"name\": \"1.168.192.in-addr.arpa.\" , " - " \"dns-servers\" : [ " - " { \"ip-address\": \"127.0.0.1\", \"port\" : 5301 } " - " ] }, " - "{ \"name\": \"2.0.3.0.8.B.D.0.1.0.0.2.ip6.arpa.\" , " - " \"dns-servers\" : [ " - " { \"ip-address\": \"127.0.0.1\" } " - " ] } " - "] } }"; + " \"ddns-domains\": [ " + " { \"name\": \"1.168.192.in-addr.arpa.\" , " + " \"dns-servers\" : [ " + " { \"ip-address\": \"127.0.0.1\", \"port\" : 5301 } " + " ] }, " + " { \"name\": \"2.0.3.0.8.B.D.0.1.0.0.2.ip6.arpa.\" , " + " \"dns-servers\" : [ " + " { \"ip-address\": \"127.0.0.1\" } " + " ] } " + " ] } }"; // If this configuration fails to parse most tests will fail. ASSERT_TRUE(fromJSON(canned_config_)); diff --git a/src/bin/d2/tests/testdata/d2_cfg_tests.json b/src/bin/d2/tests/testdata/d2_cfg_tests.json index 49c972dc6a..487b82dd11 100644 --- a/src/bin/d2/tests/testdata/d2_cfg_tests.json +++ b/src/bin/d2/tests/testdata/d2_cfg_tests.json @@ -363,8 +363,8 @@ "name" : "first.key", "algorithm" : "HMAC-MD5", "secret" : "LSWXnfkKZjdPJI5QxlpnfQ==" - } - ,{ + }, + { "name" : "first.key", "algorithm" : "HMAC-MD5", "secret" : "LSWXnfkKZjdPJI5QxlpnfQ==" @@ -557,7 +557,7 @@ "algorithm" : "HMAC-MD5", "digest-bits" : 72, "secret" : "LSWXnfkKZjdPJI5QxlpnfQ==" - }, + } ] } } @@ -577,7 +577,7 @@ "algorithm" : "HMAC-SHA1", "digest-bits" : 72, "secret" : "hRrp29wzUv3uzSNRLlY68w==" - }, + } ] } } @@ -597,7 +597,7 @@ "algorithm" : "HMAC-SHA224", "digest-bits" : 104, "secret" : "bZEG7Ow8OgAUPfLWV3aAUQ==" - }, + } ] } } @@ -617,7 +617,7 @@ "algorithm" : "hmac-sha256", "digest-bits" : 120, "secret" : "bjF4hYhTfQ5MX0siagelsw==" - }, + } ] } } @@ -637,7 +637,7 @@ "algorithm" : "hmac-sha384", "digest-bits" : 184, "secret" : "Gwk53fvy3CmbupoI9TgigA==" - }, + } ] } } diff --git a/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc b/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc index fbb8ad1ce7..58e5fcefa3 100644 --- a/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc +++ b/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc @@ -858,7 +858,7 @@ TEST_F(StatCmdsTest, statLease4GetValid) { " \"assigned-addresses\", \"declined-addresses\"\n" " ],\n" " \"rows\": [\n" - " [ 20, 16, 10, 3, 0 ],\n" + " [ 20, 16, 10, 3, 0 ]\n" " ],\n" " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n" "}\n" @@ -885,7 +885,7 @@ TEST_F(StatCmdsTest, statLease4GetValid) { " \"rows\": [\n" " [ 10, 256, 300, 2, 3 ],\n" " [ 20, 16, 10, 3, 0 ],\n" - " [ 30, 256, 0, 0, 0 ],\n" + " [ 30, 256, 0, 0, 0 ]\n" " ],\n" " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n" "}\n" @@ -912,7 +912,7 @@ TEST_F(StatCmdsTest, statLease4GetValid) { " \"rows\": [\n" " [ 20, 16, 10, 3, 0 ],\n" " [ 30, 256, 0, 0, 0 ],\n" - " [ 40, 16, 4, 4, 0 ],\n" + " [ 40, 16, 4, 4, 0 ]\n" " ],\n" " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n" "}\n" @@ -939,7 +939,7 @@ TEST_F(StatCmdsTest, statLease4GetValid) { " \"rows\": [\n" " [ 30, 256, 0, 0, 0 ],\n" " [ 40, 16, 4, 4, 0 ],\n" - " [ 50, 256, 2, 1, 1 ],\n" + " [ 50, 256, 2, 1, 1 ]\n" " ],\n" " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n" "}\n" @@ -965,7 +965,7 @@ TEST_F(StatCmdsTest, statLease4GetValid) { " ],\n" " \"rows\": [\n" " [ 30, 256, 0, 0, 0 ],\n" - " [ 40, 16, 4, 4, 0 ],\n" + " [ 40, 16, 4, 4, 0 ]\n" " ],\n" " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n" "}\n" @@ -1314,7 +1314,7 @@ TEST_F(StatCmdsTest, statLease6GetValid) { " \"rows\": [\n" " [ 10, 65536, 10000, 2, 3, 0, 0, 0 ],\n" " [ 20, 16777216, 10, 3, 0, 0, 0, 0 ],\n" - " [ 30, 16, 2, 1, 1, 65536, 4, 3 ],\n" + " [ 30, 16, 2, 1, 1, 65536, 4, 3 ]\n" " ],\n" " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n" "}\n" @@ -1472,10 +1472,7 @@ TEST_F(StatCmdsTest, statLease6GetSubnetsNotFound) { (*test).exp_response_, (*test).exp_result_json); } } - } - - } // end of anonymous namespace diff --git a/src/lib/cc/tests/data_unittests.cc b/src/lib/cc/tests/data_unittests.cc index 41b20d4603..fe84693e2c 100644 --- a/src/lib/cc/tests/data_unittests.cc +++ b/src/lib/cc/tests/data_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2020 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2009-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -163,7 +163,9 @@ TEST(Element, from_and_to_json) { // some json specific format tests, here the str() output is // different from the string input - EXPECT_EQ("100", Element::fromJSON("+100")->str()); + // +100 is incorrect according to the ECMA 404 JSON standard. + // Keeping it as it will be reversed. + // EXPECT_EQ("100", Element::fromJSON("+100")->str()); EXPECT_EQ("100.0", Element::fromJSON("1e2")->str()); EXPECT_EQ("100.0", Element::fromJSON("+1e2")->str()); EXPECT_EQ("-100.0", Element::fromJSON("-1e2")->str()); diff --git a/src/lib/database/tests/database_connection_unittest.cc b/src/lib/database/tests/database_connection_unittest.cc index df43a56a42..d3424f58f2 100644 --- a/src/lib/database/tests/database_connection_unittest.cc +++ b/src/lib/database/tests/database_connection_unittest.cc @@ -529,7 +529,6 @@ TEST(DatabaseConnection, toElementDbAccessStringValid) { "\"consistency\": \"quorum\", \n" "\"on-fail\": \"stop-retry-exit\", \n" "\"serial-consistency\": \"serial\", \n" - "\"host\": \"host_str\", \n" "\"keyspace\": \"keyspace_str\", \n" "\"lfc-interval\" : 100, \n" "\"host\": \"whatevah\", \n" diff --git a/src/lib/dhcpsrv/tests/srv_config_unittest.cc b/src/lib/dhcpsrv/tests/srv_config_unittest.cc index e2c9c2f5f6..915bb50540 100644 --- a/src/lib/dhcpsrv/tests/srv_config_unittest.cc +++ b/src/lib/dhcpsrv/tests/srv_config_unittest.cc @@ -529,7 +529,6 @@ TEST_F(SrvConfigTest, unparse) { std::string header6 = "{\n\"Dhcp6\": {\n"; std::string defaults = "\"decline-probation-period\": 0,\n"; - defaults += "\"dhcp4o6-port\": 0,\n"; defaults += "\"interfaces-config\": { \"interfaces\": [ ],\n"; defaults += " \"re-detect\": false },\n"; defaults += "\"option-def\": [ ],\n"; @@ -545,8 +544,7 @@ TEST_F(SrvConfigTest, unparse) { defaults += conf.getD2ClientConfig()->toElement()->str() + ",\n"; - std::string defaults4 = "\"echo-client-id\": true,\n"; - defaults4 += "\"shared-networks\": [ ],\n"; + std::string defaults4 = "\"shared-networks\": [ ],\n"; defaults4 += "\"subnet4\": [ ],\n"; defaults4 += "\"host-reservation-identifiers\": "; defaults4 += "[ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"; diff --git a/src/lib/process/tests/log_parser_unittests.cc b/src/lib/process/tests/log_parser_unittests.cc index 6985f1e1d6..14acdbd1a1 100644 --- a/src/lib/process/tests/log_parser_unittests.cc +++ b/src/lib/process/tests/log_parser_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019,2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2014-2021 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -376,6 +376,7 @@ TEST_F(LoggingTest, logRotate) { // Verifies that a valid output option,'pattern' paress correctly. TEST_F(LoggingTest, validPattern) { + // Note the backslash must be doubled in the pattern definition. const char* config_txt = "{ \"loggers\": [" " {" @@ -383,7 +384,7 @@ TEST_F(LoggingTest, validPattern) { " \"output_options\": [" " {" " \"output\": \"stdout\"," - " \"pattern\": \"mylog %m\n\"" + " \"pattern\": \"mylog %m\\n\"" " }" " ]," " \"severity\": \"INFO\""