diff options
Diffstat (limited to 'src/lib/dhcpsrv/tests')
-rwxr-xr-x | src/lib/dhcpsrv/tests/Makefile.am | 2 | ||||
-rw-r--r-- | src/lib/dhcpsrv/tests/cfg_host_operations_unittest.cc (renamed from src/lib/dhcpsrv/tests/cfg_host_reservations_unittest.cc) | 22 | ||||
-rw-r--r-- | src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc | 32 |
3 files changed, 28 insertions, 28 deletions
diff --git a/src/lib/dhcpsrv/tests/Makefile.am b/src/lib/dhcpsrv/tests/Makefile.am index 517079bfab..acb916f5f0 100755 --- a/src/lib/dhcpsrv/tests/Makefile.am +++ b/src/lib/dhcpsrv/tests/Makefile.am @@ -68,7 +68,7 @@ libdhcpsrv_unittests_SOURCES += callout_handle_store_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_db_access_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_duid_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_expiration_unittest.cc -libdhcpsrv_unittests_SOURCES += cfg_host_reservations_unittest.cc +libdhcpsrv_unittests_SOURCES += cfg_host_operations_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_hosts_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_iface_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_mac_source_unittest.cc diff --git a/src/lib/dhcpsrv/tests/cfg_host_reservations_unittest.cc b/src/lib/dhcpsrv/tests/cfg_host_operations_unittest.cc index df59dcb207..0a6e718e46 100644 --- a/src/lib/dhcpsrv/tests/cfg_host_reservations_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfg_host_operations_unittest.cc @@ -6,7 +6,7 @@ #include <config.h> #include <dhcp/dhcp6.h> -#include <dhcpsrv/cfg_host_reservations.h> +#include <dhcpsrv/cfg_host_operations.h> #include <dhcpsrv/host.h> #include <gtest/gtest.h> #include <algorithm> @@ -21,21 +21,21 @@ namespace { /// @param cfg Object holding current configuration. /// @param id Identifier type which presence should be checked. bool -identifierAdded(const CfgHostReservations& cfg, const Host::IdentifierType& id) { - CfgHostReservations::IdentifierTypes types = cfg.getIdentifierTypes(); +identifierAdded(const CfgHostOperations& cfg, const Host::IdentifierType& id) { + CfgHostOperations::IdentifierTypes types = cfg.getIdentifierTypes(); return (std::find(types.begin(), types.end(), id) != types.end()); } // This test checks default configuration. -TEST(CfgHostReservationsTest, defaults) { - CfgHostReservations cfg; +TEST(CfgHostOperationsTest, defaults) { + CfgHostOperations cfg; EXPECT_TRUE(cfg.getIdentifierTypes().empty()); } // This test verifies that identifier types can be added into an // ordered collection and then removed. -TEST(CfgHostReservationsTest, addIdentifier) { - CfgHostReservations cfg; +TEST(CfgHostOperationsTest, addIdentifier) { + CfgHostOperations cfg; // Only HW address added. ASSERT_NO_THROW(cfg.addIdentifierType("hw-address")); @@ -62,8 +62,8 @@ TEST(CfgHostReservationsTest, addIdentifier) { // This test verfies that the default DHCPv4 configuration is created // as expected. -TEST(CfgHostReservationsTest, createConfig4) { - CfgHostReservationsPtr cfg = CfgHostReservations::createConfig4(); +TEST(CfgHostOperationsTest, createConfig4) { + CfgHostOperationsPtr cfg = CfgHostOperations::createConfig4(); EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_HWADDR)); EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_DUID)); @@ -72,8 +72,8 @@ TEST(CfgHostReservationsTest, createConfig4) { // This test verfies that the default DHCPv6 configuration is created // as expected. -TEST(CfgHostReservationsTest, createConfig6) { - CfgHostReservationsPtr cfg = CfgHostReservations::createConfig6(); +TEST(CfgHostOperationsTest, createConfig6) { + CfgHostOperationsPtr cfg = CfgHostOperations::createConfig6(); EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_HWADDR)); EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_DUID)); diff --git a/src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc b/src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc index 54637d355a..88d879b912 100644 --- a/src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc +++ b/src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc @@ -825,12 +825,12 @@ TEST_F(HostReservationIdsParserTest, dhcp4Identifiers) { HostReservationIdsParser4 parser; ASSERT_NO_THROW(parser.build(config_element)); - ConstCfgHostReservationsPtr cfg = CfgMgr::instance().getStagingCfg()-> - getCfgHostReservations4(); - const CfgHostReservations::IdentifierTypes& ids = cfg->getIdentifierTypes(); + ConstCfgHostOperationsPtr cfg = CfgMgr::instance().getStagingCfg()-> + getCfgHostOperations4(); + const CfgHostOperations::IdentifierTypes& ids = cfg->getIdentifierTypes(); ASSERT_EQ(3, ids.size()); - CfgHostReservations::IdentifierTypes::const_iterator id = ids.begin(); + CfgHostOperations::IdentifierTypes::const_iterator id = ids.begin(); EXPECT_EQ(*id++, Host::IDENT_CIRCUIT_ID); EXPECT_EQ(*id++, Host::IDENT_DUID); EXPECT_EQ(*id++, Host::IDENT_HWADDR); @@ -846,12 +846,12 @@ TEST_F(HostReservationIdsParserTest, dhcp6Identifiers) { HostReservationIdsParser6 parser; ASSERT_NO_THROW(parser.build(config_element)); - ConstCfgHostReservationsPtr cfg = CfgMgr::instance().getStagingCfg()-> - getCfgHostReservations6(); - const CfgHostReservations::IdentifierTypes& ids = cfg->getIdentifierTypes(); + ConstCfgHostOperationsPtr cfg = CfgMgr::instance().getStagingCfg()-> + getCfgHostOperations6(); + const CfgHostOperations::IdentifierTypes& ids = cfg->getIdentifierTypes(); ASSERT_EQ(2, ids.size()); - CfgHostReservations::IdentifierTypes::const_iterator id = ids.begin(); + CfgHostOperations::IdentifierTypes::const_iterator id = ids.begin(); EXPECT_EQ(*id++, Host::IDENT_DUID); EXPECT_EQ(*id++, Host::IDENT_HWADDR); } @@ -880,12 +880,12 @@ TEST_F(HostReservationIdsParserTest, dhcp4AutoIdentifiers) { HostReservationIdsParser4 parser; ASSERT_NO_THROW(parser.build(config_element)); - ConstCfgHostReservationsPtr cfg = CfgMgr::instance().getStagingCfg()-> - getCfgHostReservations4(); - const CfgHostReservations::IdentifierTypes& ids = cfg->getIdentifierTypes(); + ConstCfgHostOperationsPtr cfg = CfgMgr::instance().getStagingCfg()-> + getCfgHostOperations4(); + const CfgHostOperations::IdentifierTypes& ids = cfg->getIdentifierTypes(); ASSERT_EQ(3, ids.size()); - CfgHostReservations::IdentifierTypes::const_iterator id = ids.begin(); + CfgHostOperations::IdentifierTypes::const_iterator id = ids.begin(); EXPECT_EQ(*id++, Host::IDENT_HWADDR); EXPECT_EQ(*id++, Host::IDENT_DUID); EXPECT_EQ(*id++, Host::IDENT_CIRCUIT_ID); @@ -922,12 +922,12 @@ TEST_F(HostReservationIdsParserTest, dhcp6AutoIdentifiers) { HostReservationIdsParser6 parser; ASSERT_NO_THROW(parser.build(config_element)); - ConstCfgHostReservationsPtr cfg = CfgMgr::instance().getStagingCfg()-> - getCfgHostReservations6(); - const CfgHostReservations::IdentifierTypes& ids = cfg->getIdentifierTypes(); + ConstCfgHostOperationsPtr cfg = CfgMgr::instance().getStagingCfg()-> + getCfgHostOperations6(); + const CfgHostOperations::IdentifierTypes& ids = cfg->getIdentifierTypes(); ASSERT_EQ(2, ids.size()); - CfgHostReservations::IdentifierTypes::const_iterator id = ids.begin(); + CfgHostOperations::IdentifierTypes::const_iterator id = ids.begin(); EXPECT_EQ(*id++, Host::IDENT_HWADDR); EXPECT_EQ(*id++, Host::IDENT_DUID); } |