]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5102] Allow retrieving host reservations by 'client-id' from SQL dbs.
authorMarcin Siodelski <marcin@isc.org>
Sat, 15 Apr 2017 13:19:00 +0000 (15:19 +0200)
committerMarcin Siodelski <marcin@isc.org>
Sat, 15 Apr 2017 13:19:00 +0000 (15:19 +0200)
src/lib/dhcpsrv/mysql_host_data_source.cc
src/lib/dhcpsrv/pgsql_host_data_source.cc
src/lib/dhcpsrv/tests/mysql_host_data_source_unittest.cc
src/lib/dhcpsrv/tests/pgsql_host_data_source_unittest.cc

index 33cbd0d49f7082ac8a3d01831fb30332772593ef..1a38e2af3dd5ac8fee3c3bd6e16b52168ede62a2 100644 (file)
@@ -73,7 +73,7 @@ const size_t BOOT_FILE_NAME_MAX_LEN = 128;
 ///
 /// This value is used to validate whether the identifier type stored in
 /// a database is within bounds. of supported identifiers.
-const uint8_t MAX_IDENTIFIER_TYPE = static_cast<uint8_t>(Host::IDENT_CIRCUIT_ID);
+const uint8_t MAX_IDENTIFIER_TYPE = static_cast<uint8_t>(Host::LAST_IDENTIFIER_TYPE);
 
 /// @brief This class provides mechanisms for sending and retrieving
 /// information from the 'hosts' table.
index a887bea21721800509dfb77f8da420b1e2b7e588..94037098595c0c9b7b0344d924eac99e00dd7894 100644 (file)
@@ -44,7 +44,7 @@ const size_t OPTION_VALUE_MAX_LEN = 4096;
 ///
 /// This value is used to validate whether the identifier type stored in
 /// a database is within bounds. of supported identifiers.
-const uint8_t MAX_IDENTIFIER_TYPE = static_cast<uint8_t>(Host::IDENT_CIRCUIT_ID);
+const uint8_t MAX_IDENTIFIER_TYPE = static_cast<uint8_t>(Host::LAST_IDENTIFIER_TYPE);
 
 /// @brief Maximum length of DHCP identifier value.
 const size_t DHCP_IDENTIFIER_MAX_LEN = 128;
index c6dbffd6849a6eb4ea73fc63a8f038b09a3b0ad7..845b9d915b59507a8bb0a535623452dc8bd5959a 100644 (file)
@@ -264,6 +264,12 @@ TEST_F(MySqlHostDataSourceTest, get4ByCircuitId) {
     testGet4ByIdentifier(Host::IDENT_CIRCUIT_ID);
 }
 
+// Test verifies if a host reservation can be added and later retrieved by
+// client-id.
+TEST_F(MySqlHostDataSourceTest, get4ByClientId) {
+    testGet4ByIdentifier(Host::IDENT_CLIENT_ID);
+}
+
 // Test verifies if hardware address and client identifier are not confused.
 TEST_F(MySqlHostDataSourceTest, hwaddrNotClientId1) {
     testHWAddrNotClientId();
index 4f7b7948877d69e7d6c11cfcd21b1b766ff9527c..4c0f7c0a8efc47e68440aed006e953d38111c182 100644 (file)
@@ -221,6 +221,12 @@ TEST_F(PgSqlHostDataSourceTest, get4ByCircuitId) {
     testGet4ByIdentifier(Host::IDENT_CIRCUIT_ID);
 }
 
+// Test verifies if a host reservation can be added and later retrieved by
+// client-id.
+TEST_F(PgSqlHostDataSourceTest, get4ByClientId) {
+    testGet4ByIdentifier(Host::IDENT_CLIENT_ID);
+}
+
 // Test verifies if hardware address and client identifier are not confused.
 TEST_F(PgSqlHostDataSourceTest, hwaddrNotClientId1) {
     testHWAddrNotClientId();