]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2815] Add more unit tests
authorSlawek Figiel <slawek@isc.org>
Mon, 17 Apr 2023 08:53:06 +0000 (10:53 +0200)
committerSlawek Figiel <slawek@isc.org>
Thu, 25 May 2023 11:29:29 +0000 (13:29 +0200)
src/lib/dhcpsrv/tests/host_mgr_unittest.cc
src/lib/dhcpsrv/tests/mysql_host_data_source_unittest.cc
src/lib/dhcpsrv/tests/pgsql_host_data_source_unittest.cc

index bec8e0951d31bb9dd4b534141508cd243dde5822..a57e357f0e806cdce32ad1f6d78b7c1961c966cd 100644 (file)
@@ -153,6 +153,29 @@ TEST_F(HostMgrTest, get6ByPrefix) {
     testGet6ByPrefix(*getCfgHosts(), *getCfgHosts());
 }
 
+// This test verifies that the reservations can be added using HostMgr.
+TEST_F(HostMgrTest, add) {
+    testAdd(*getCfgHosts(), *getCfgHosts());
+}
+
+// This test verifies that the reservations can be deleted by subnet ID and
+// address using HostMgr..
+TEST_F(HostMgrTest, del) {
+    testDeleteByIDAndAddress(*getCfgHosts(), *getCfgHosts());
+}
+
+// This test verifies that the IPv4 reservations can be deleted by subnet ID
+// and identifier using HostMgr.
+TEST_F(HostMgrTest, del4) {
+    testDelete4ByIDAndIdentifier(*getCfgHosts(), *getCfgHosts());
+}
+
+// This test verifies that the IPv6 reservations can be deleted by subnet ID
+// and identifier using HostMgr..
+TEST_F(HostMgrTest, del6) {
+    testDelete6ByIDAndIdentifier(*getCfgHosts(), *getCfgHosts());
+}
+
 // This test verifies that without a host data source an exception is thrown.
 TEST_F(HostMgrTest, noDataSource) {
     // Remove all configuration.
index ab4924a554041851edb31bf875dabfc7842afe33..eb3b9d975c257b299fe4416b060a026e1be13c5b 100644 (file)
@@ -1647,6 +1647,30 @@ TEST_F(MySQLHostMgrTest, get6ByPrefix) {
     testGet6ByPrefix(*getCfgHosts(), HostMgr::instance());
 }
 
+// This test verifies that the reservations can be added to a configuration
+// file and a database.
+TEST_F(MySQLHostMgrTest, add) {
+    testAdd(*getCfgHosts(), HostMgr::instance());
+}
+
+// This test verifies that the reservations can be deleted from a configuration
+// file and a database by subnet ID and address.
+TEST_F(MySQLHostMgrTest, del) {
+    testDeleteByIDAndAddress(*getCfgHosts(), HostMgr::instance());
+}
+
+// This test verifies that the IPv4 reservations can be deleted from a
+// configuration file and a database by subnet ID and identifier.
+TEST_F(MySQLHostMgrTest, del4) {
+    testDelete4ByIDAndIdentifier(*getCfgHosts(), HostMgr::instance());
+}
+
+// This test verifies that the IPv6 reservations can be deleted from a
+// configuration file and a database by subnet ID and identifier.
+TEST_F(MySQLHostMgrTest, del6) {
+    testDelete6ByIDAndIdentifier(*getCfgHosts(), HostMgr::instance());
+}
+
 // This test verifies that it is possible to control whether the reserved
 // IP addresses are unique or non unique via the HostMgr.
 TEST_F(MySQLHostMgrTest, setIPReservationsUnique) {
index 8f55a4459fe24ccca37d65fc6d5463e87e13e79c..681a9c648f6488d0cecb2b36417adc8c37777971 100644 (file)
@@ -1615,6 +1615,30 @@ TEST_F(PgSQLHostMgrTest, get6ByPrefix) {
     testGet6ByPrefix(*getCfgHosts(), HostMgr::instance());
 }
 
+// This test verifies that the reservations can be added to a configuration
+// file and a database.
+TEST_F(PgSQLHostMgrTest, add) {
+    testAdd(*getCfgHosts(), HostMgr::instance());
+}
+
+// This test verifies that the reservations can be deleted from a configuration
+// file and a database by subnet ID and address.
+TEST_F(PgSQLHostMgrTest, del) {
+    testDeleteByIDAndAddress(*getCfgHosts(), HostMgr::instance());
+}
+
+// This test verifies that the IPv4 reservations can be deleted from a
+// configuration file and a database by subnet ID and identifier.
+TEST_F(PgSQLHostMgrTest, del4) {
+    testDelete4ByIDAndIdentifier(*getCfgHosts(), HostMgr::instance());
+}
+
+// This test verifies that the IPv6 reservations can be deleted from a
+// configuration file and a database by subnet ID and identifier.
+TEST_F(PgSQLHostMgrTest, del6) {
+    testDelete6ByIDAndIdentifier(*getCfgHosts(), HostMgr::instance());
+}
+
 // This test verifies that it is possible to control whether the reserved
 // IP addresses are unique or non unique via the HostMgr.
 TEST_F(PgSQLHostMgrTest, setIPReservationsUnique) {