Commit 9a34bbb5 authored by Marcin Siodelski's avatar Marcin Siodelski

[4303] Renamed CfgHostReservations to CfgHostOperations.

This change was suggested during a ticket review.
parent 440fd061
...@@ -90,7 +90,7 @@ libkea_dhcpsrv_la_SOURCES += cfg_duid.cc cfg_duid.h ...@@ -90,7 +90,7 @@ libkea_dhcpsrv_la_SOURCES += cfg_duid.cc cfg_duid.h
libkea_dhcpsrv_la_SOURCES += cfg_hosts.cc cfg_hosts.h libkea_dhcpsrv_la_SOURCES += cfg_hosts.cc cfg_hosts.h
libkea_dhcpsrv_la_SOURCES += cfg_iface.cc cfg_iface.h libkea_dhcpsrv_la_SOURCES += cfg_iface.cc cfg_iface.h
libkea_dhcpsrv_la_SOURCES += cfg_expiration.cc cfg_expiration.h libkea_dhcpsrv_la_SOURCES += cfg_expiration.cc cfg_expiration.h
libkea_dhcpsrv_la_SOURCES += cfg_host_reservations.cc cfg_host_reservations.h libkea_dhcpsrv_la_SOURCES += cfg_host_operations.cc cfg_host_operations.h
libkea_dhcpsrv_la_SOURCES += cfg_option.cc cfg_option.h libkea_dhcpsrv_la_SOURCES += cfg_option.cc cfg_option.h
libkea_dhcpsrv_la_SOURCES += cfg_option_def.cc cfg_option_def.h libkea_dhcpsrv_la_SOURCES += cfg_option_def.cc cfg_option_def.h
libkea_dhcpsrv_la_SOURCES += cfg_rsoo.cc cfg_rsoo.h libkea_dhcpsrv_la_SOURCES += cfg_rsoo.cc cfg_rsoo.h
......
...@@ -306,7 +306,7 @@ AllocEngine::AllocatorPtr AllocEngine::getAllocator(Lease::Type type) { ...@@ -306,7 +306,7 @@ AllocEngine::AllocatorPtr AllocEngine::getAllocator(Lease::Type type) {
template<typename ContextType> template<typename ContextType>
void void
AllocEngine::findReservationInternal(ContextType& ctx, AllocEngine::findReservationInternal(ContextType& ctx,
const ConstCfgHostReservationsPtr& cfg, const ConstCfgHostOperationsPtr& cfg,
const AllocEngine::HostGetFunc& host_get) { const AllocEngine::HostGetFunc& host_get) {
ctx.host_.reset(); ctx.host_.reset();
...@@ -376,8 +376,8 @@ AllocEngine::ClientContext6::ClientContext6(const Subnet6Ptr& subnet, const Duid ...@@ -376,8 +376,8 @@ AllocEngine::ClientContext6::ClientContext6(const Subnet6Ptr& subnet, const Duid
void AllocEngine::findReservation(ClientContext6& ctx) { void AllocEngine::findReservation(ClientContext6& ctx) {
ConstCfgHostReservationsPtr cfg = ConstCfgHostOperationsPtr cfg =
CfgMgr::instance().getCurrentCfg()->getCfgHostReservations6(); CfgMgr::instance().getCurrentCfg()->getCfgHostOperations6();
findReservationInternal(ctx, cfg, boost::bind(&HostMgr::get6, findReservationInternal(ctx, cfg, boost::bind(&HostMgr::get6,
&HostMgr::instance(), &HostMgr::instance(),
_1, _2, _3, _4)); _1, _2, _3, _4));
...@@ -2135,8 +2135,8 @@ AllocEngine::allocateLease4(ClientContext4& ctx) { ...@@ -2135,8 +2135,8 @@ AllocEngine::allocateLease4(ClientContext4& ctx) {
void void
AllocEngine::findReservation(ClientContext4& ctx) { AllocEngine::findReservation(ClientContext4& ctx) {
ConstCfgHostReservationsPtr cfg = ConstCfgHostOperationsPtr cfg =
CfgMgr::instance().getCurrentCfg()->getCfgHostReservations4(); CfgMgr::instance().getCurrentCfg()->getCfgHostOperations4();
findReservationInternal(ctx, cfg, boost::bind(&HostMgr::get4, findReservationInternal(ctx, cfg, boost::bind(&HostMgr::get4,
&HostMgr::instance(), &HostMgr::instance(),
_1, _2, _3, _4)); _1, _2, _3, _4));
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <dhcp/pkt4.h> #include <dhcp/pkt4.h>
#include <dhcp/pkt6.h> #include <dhcp/pkt6.h>
#include <dhcp/option6_ia.h> #include <dhcp/option6_ia.h>
#include <dhcpsrv/cfg_host_reservations.h> #include <dhcpsrv/cfg_host_operations.h>
#include <dhcpsrv/host.h> #include <dhcpsrv/host.h>
#include <dhcpsrv/subnet.h> #include <dhcpsrv/subnet.h>
#include <dhcpsrv/lease_mgr.h> #include <dhcpsrv/lease_mgr.h>
...@@ -642,7 +642,7 @@ private: ...@@ -642,7 +642,7 @@ private:
/// @tparam ContextType Either @ref ClientContext6 or @ref ClientContext4. /// @tparam ContextType Either @ref ClientContext6 or @ref ClientContext4.
template<typename ContextType> template<typename ContextType>
static void findReservationInternal(ContextType& ctx, static void findReservationInternal(ContextType& ctx,
const ConstCfgHostReservationsPtr& cfg, const ConstCfgHostOperationsPtr& cfg,
const HostGetFunc& host_get); const HostGetFunc& host_get);
/// @brief creates a lease and inserts it in LeaseMgr if necessary /// @brief creates a lease and inserts it in LeaseMgr if necessary
......
...@@ -5,35 +5,35 @@ ...@@ -5,35 +5,35 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
#include <dhcpsrv/cfg_host_reservations.h> #include <dhcpsrv/cfg_host_operations.h>
#include <algorithm> #include <algorithm>
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
CfgHostReservations::CfgHostReservations() CfgHostOperations::CfgHostOperations()
: identifier_types_() { : identifier_types_() {
} }
CfgHostReservationsPtr CfgHostOperationsPtr
CfgHostReservations::createConfig4() { CfgHostOperations::createConfig4() {
CfgHostReservationsPtr cfg(new CfgHostReservations()); CfgHostOperationsPtr cfg(new CfgHostOperations());
cfg->addIdentifierType("hw-address"); cfg->addIdentifierType("hw-address");
cfg->addIdentifierType("duid"); cfg->addIdentifierType("duid");
cfg->addIdentifierType("circuit-id"); cfg->addIdentifierType("circuit-id");
return (cfg); return (cfg);
} }
CfgHostReservationsPtr CfgHostOperationsPtr
CfgHostReservations::createConfig6() { CfgHostOperations::createConfig6() {
CfgHostReservationsPtr cfg(new CfgHostReservations()); CfgHostOperationsPtr cfg(new CfgHostOperations());
cfg->addIdentifierType("hw-address"); cfg->addIdentifierType("hw-address");
cfg->addIdentifierType("duid"); cfg->addIdentifierType("duid");
return (cfg); return (cfg);
} }
void void
CfgHostReservations::addIdentifierType(const std::string& identifier_name) { CfgHostOperations::addIdentifierType(const std::string& identifier_name) {
Host::IdentifierType identifier_type = Host::getIdentifierType(identifier_name); Host::IdentifierType identifier_type = Host::getIdentifierType(identifier_name);
if (std::find(identifier_types_.begin(), identifier_types_.end(), if (std::find(identifier_types_.begin(), identifier_types_.end(),
identifier_type) != identifier_types_.end()) { identifier_type) != identifier_types_.end()) {
...@@ -44,7 +44,7 @@ CfgHostReservations::addIdentifierType(const std::string& identifier_name) { ...@@ -44,7 +44,7 @@ CfgHostReservations::addIdentifierType(const std::string& identifier_name) {
} }
void void
CfgHostReservations::clear() { CfgHostOperations::clear() {
identifier_types_.clear(); identifier_types_.clear();
} }
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef CFG_HOST_RESERVATIONS_H #ifndef CFG_HOST_OPERATIONS_H
#define CFG_HOST_RESERVATIONS_H #define CFG_HOST_OPERATIONS_H
#include <dhcpsrv/host.h> #include <dhcpsrv/host.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
...@@ -15,17 +15,17 @@ ...@@ -15,17 +15,17 @@
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
/// @brief Forward declaration of the @ref CfgHostReservations. /// @brief Forward declaration of the @ref CfgHostOperations.
class CfgHostReservations; class CfgHostOperations;
/// @name Pointers to the @ref CfgHostReservations objects. /// @name Pointers to the @ref CfgHostOperations objects.
//@{ //@{
/// @brief Pointer to the Non-const object. /// @brief Pointer to the Non-const object.
typedef boost::shared_ptr<CfgHostReservations> CfgHostReservationsPtr; typedef boost::shared_ptr<CfgHostOperations> CfgHostOperationsPtr;
/// @brief Pointer to the const object. /// @brief Pointer to the const object.
typedef boost::shared_ptr<const CfgHostReservations> typedef boost::shared_ptr<const CfgHostOperations>
ConstCfgHostReservationsPtr; ConstCfgHostOperationsPtr;
//@} //@}
...@@ -39,7 +39,7 @@ ConstCfgHostReservationsPtr; ...@@ -39,7 +39,7 @@ ConstCfgHostReservationsPtr;
/// An administrator selects which identifiers the server should /// An administrator selects which identifiers the server should
/// use and in which order to search for host reservations to /// use and in which order to search for host reservations to
/// optimize performance of the server. /// optimize performance of the server.
class CfgHostReservations { class CfgHostOperations {
public: public:
/// @brief Type of the container holding ordered list of identifiers. /// @brief Type of the container holding ordered list of identifiers.
...@@ -49,15 +49,15 @@ public: ...@@ -49,15 +49,15 @@ public:
/// ///
/// The default confguration: /// The default confguration:
/// - no identifiers selected for host reservations searches. /// - no identifiers selected for host reservations searches.
CfgHostReservations(); CfgHostOperations();
/// @name Factory functions for creating default configurations. /// @name Factory functions for creating default configurations.
//@{ //@{
/// @brief Factory function for DHCPv4. /// @brief Factory function for DHCPv4.
static CfgHostReservationsPtr createConfig4(); static CfgHostOperationsPtr createConfig4();
/// @brief Factory function for DHCPv6. /// @brief Factory function for DHCPv6.
static CfgHostReservationsPtr createConfig6(); static CfgHostOperationsPtr createConfig6();
//@} //@}
/// @brief Adds new identifier type to a collection of identifiers /// @brief Adds new identifier type to a collection of identifiers
...@@ -88,4 +88,4 @@ private: ...@@ -88,4 +88,4 @@ private:
} }
} }
#endif // CFG_HOST_RESERVATIONS_H #endif // CFG_HOST_OPERATIONS_H
...@@ -377,7 +377,7 @@ HostReservationIdsParser::build(isc::data::ConstElementPtr ids_list) { ...@@ -377,7 +377,7 @@ HostReservationIdsParser::build(isc::data::ConstElementPtr ids_list) {
HostReservationIdsParser4::HostReservationIdsParser4() HostReservationIdsParser4::HostReservationIdsParser4()
: HostReservationIdsParser() { : HostReservationIdsParser() {
staging_cfg_ = CfgMgr::instance().getStagingCfg()->getCfgHostReservations4(); staging_cfg_ = CfgMgr::instance().getStagingCfg()->getCfgHostOperations4();
} }
bool bool
...@@ -387,7 +387,7 @@ HostReservationIdsParser4::isSupportedIdentifier(const std::string& id_name) con ...@@ -387,7 +387,7 @@ HostReservationIdsParser4::isSupportedIdentifier(const std::string& id_name) con
HostReservationIdsParser6::HostReservationIdsParser6() HostReservationIdsParser6::HostReservationIdsParser6()
: HostReservationIdsParser() { : HostReservationIdsParser() {
staging_cfg_ = CfgMgr::instance().getStagingCfg()->getCfgHostReservations6(); staging_cfg_ = CfgMgr::instance().getStagingCfg()->getCfgHostOperations6();
} }
bool bool
......
...@@ -182,7 +182,7 @@ protected: ...@@ -182,7 +182,7 @@ protected:
virtual bool isSupportedIdentifier(const std::string& id_name) const = 0; virtual bool isSupportedIdentifier(const std::string& id_name) const = 0;
/// @brief Pointer to the object holding configuration. /// @brief Pointer to the object holding configuration.
CfgHostReservationsPtr staging_cfg_; CfgHostOperationsPtr staging_cfg_;
}; };
......
...@@ -25,8 +25,8 @@ SrvConfig::SrvConfig() ...@@ -25,8 +25,8 @@ SrvConfig::SrvConfig()
cfg_hosts_(new CfgHosts()), cfg_rsoo_(new CfgRSOO()), cfg_hosts_(new CfgHosts()), cfg_rsoo_(new CfgRSOO()),
cfg_expiration_(new CfgExpiration()), cfg_duid_(new CfgDUID()), cfg_expiration_(new CfgExpiration()), cfg_duid_(new CfgDUID()),
cfg_db_access_(new CfgDbAccess()), cfg_db_access_(new CfgDbAccess()),
cfg_host_reservations4_(CfgHostReservations::createConfig4()), cfg_host_operations4_(CfgHostOperations::createConfig4()),
cfg_host_reservations6_(CfgHostReservations::createConfig6()), cfg_host_operations6_(CfgHostOperations::createConfig6()),
class_dictionary_(new ClientClassDictionary()), class_dictionary_(new ClientClassDictionary()),
decline_timer_(0) { decline_timer_(0) {
} }
...@@ -38,8 +38,8 @@ SrvConfig::SrvConfig(const uint32_t sequence) ...@@ -38,8 +38,8 @@ SrvConfig::SrvConfig(const uint32_t sequence)
cfg_hosts_(new CfgHosts()), cfg_rsoo_(new CfgRSOO()), cfg_hosts_(new CfgHosts()), cfg_rsoo_(new CfgRSOO()),
cfg_expiration_(new CfgExpiration()), cfg_duid_(new CfgDUID()), cfg_expiration_(new CfgExpiration()), cfg_duid_(new CfgDUID()),
cfg_db_access_(new CfgDbAccess()), cfg_db_access_(new CfgDbAccess()),
cfg_host_reservations4_(CfgHostReservations::createConfig4()), cfg_host_operations4_(CfgHostOperations::createConfig4()),
cfg_host_reservations6_(CfgHostReservations::createConfig6()), cfg_host_operations6_(CfgHostOperations::createConfig6()),
class_dictionary_(new ClientClassDictionary()), class_dictionary_(new ClientClassDictionary()),
decline_timer_(0) { decline_timer_(0) {
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <dhcpsrv/cfg_db_access.h> #include <dhcpsrv/cfg_db_access.h>
#include <dhcpsrv/cfg_duid.h> #include <dhcpsrv/cfg_duid.h>
#include <dhcpsrv/cfg_expiration.h> #include <dhcpsrv/cfg_expiration.h>
#include <dhcpsrv/cfg_host_reservations.h> #include <dhcpsrv/cfg_host_operations.h>
#include <dhcpsrv/cfg_hosts.h> #include <dhcpsrv/cfg_hosts.h>
#include <dhcpsrv/cfg_iface.h> #include <dhcpsrv/cfg_iface.h>
#include <dhcpsrv/cfg_option.h> #include <dhcpsrv/cfg_option.h>
...@@ -294,26 +294,26 @@ public: ...@@ -294,26 +294,26 @@ public:
/// @brief Returns pointer to the object holding general configuration /// @brief Returns pointer to the object holding general configuration
/// for host reservations in DHCPv4. /// for host reservations in DHCPv4.
CfgHostReservationsPtr getCfgHostReservations4() { CfgHostOperationsPtr getCfgHostOperations4() {
return (cfg_host_reservations4_); return (cfg_host_operations4_);
} }
/// @brief Returns const pointer to the object holding general /// @brief Returns const pointer to the object holding general
/// configuration for host reservations in DHCPv4 /// configuration for host reservations in DHCPv4
ConstCfgHostReservationsPtr getCfgHostReservations4() const { ConstCfgHostOperationsPtr getCfgHostOperations4() const {
return (cfg_host_reservations4_); return (cfg_host_operations4_);
} }
/// @brief Returns pointer to the object holding general configuration /// @brief Returns pointer to the object holding general configuration
/// for host reservations in DHCPv6. /// for host reservations in DHCPv6.
CfgHostReservationsPtr getCfgHostReservations6() { CfgHostOperationsPtr getCfgHostOperations6() {
return (cfg_host_reservations6_); return (cfg_host_operations6_);
} }
/// @brief Returns const pointer to the object holding general /// @brief Returns const pointer to the object holding general
/// configuration for host reservations in DHCPv6 /// configuration for host reservations in DHCPv6
ConstCfgHostReservationsPtr getCfgHostReservations6() const { ConstCfgHostOperationsPtr getCfgHostOperations6() const {
return (cfg_host_reservations6_); return (cfg_host_operations6_);
} }
//@} //@}
...@@ -529,11 +529,11 @@ private: ...@@ -529,11 +529,11 @@ private:
/// @brief Pointer to the general configuration for host reservations in /// @brief Pointer to the general configuration for host reservations in
/// DHCPv4. /// DHCPv4.
CfgHostReservationsPtr cfg_host_reservations4_; CfgHostOperationsPtr cfg_host_operations4_;
/// @brief Pointer to the general configuration for host reservations in /// @brief Pointer to the general configuration for host reservations in
/// DHCPv6. /// DHCPv6.
CfgHostReservationsPtr cfg_host_reservations6_; CfgHostOperationsPtr cfg_host_operations6_;
/// @brief Pointer to the control-socket information /// @brief Pointer to the control-socket information
isc::data::ConstElementPtr control_socket_; isc::data::ConstElementPtr control_socket_;
......
...@@ -68,7 +68,7 @@ libdhcpsrv_unittests_SOURCES += callout_handle_store_unittest.cc ...@@ -68,7 +68,7 @@ libdhcpsrv_unittests_SOURCES += callout_handle_store_unittest.cc
libdhcpsrv_unittests_SOURCES += cfg_db_access_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_db_access_unittest.cc
libdhcpsrv_unittests_SOURCES += cfg_duid_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_duid_unittest.cc
libdhcpsrv_unittests_SOURCES += cfg_expiration_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_hosts_unittest.cc
libdhcpsrv_unittests_SOURCES += cfg_iface_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_iface_unittest.cc
libdhcpsrv_unittests_SOURCES += cfg_mac_source_unittest.cc libdhcpsrv_unittests_SOURCES += cfg_mac_source_unittest.cc
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <config.h> #include <config.h>
#include <dhcp/dhcp6.h> #include <dhcp/dhcp6.h>
#include <dhcpsrv/cfg_host_reservations.h> #include <dhcpsrv/cfg_host_operations.h>
#include <dhcpsrv/host.h> #include <dhcpsrv/host.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <algorithm> #include <algorithm>
...@@ -21,21 +21,21 @@ namespace { ...@@ -21,21 +21,21 @@ namespace {
/// @param cfg Object holding current configuration. /// @param cfg Object holding current configuration.
/// @param id Identifier type which presence should be checked. /// @param id Identifier type which presence should be checked.
bool bool
identifierAdded(const CfgHostReservations& cfg, const Host::IdentifierType& id) { identifierAdded(const CfgHostOperations& cfg, const Host::IdentifierType& id) {
CfgHostReservations::IdentifierTypes types = cfg.getIdentifierTypes(); CfgHostOperations::IdentifierTypes types = cfg.getIdentifierTypes();
return (std::find(types.begin(), types.end(), id) != types.end()); return (std::find(types.begin(), types.end(), id) != types.end());
} }
// This test checks default configuration. // This test checks default configuration.
TEST(CfgHostReservationsTest, defaults) { TEST(CfgHostOperationsTest, defaults) {
CfgHostReservations cfg; CfgHostOperations cfg;
EXPECT_TRUE(cfg.getIdentifierTypes().empty()); EXPECT_TRUE(cfg.getIdentifierTypes().empty());
} }
// This test verifies that identifier types can be added into an // This test verifies that identifier types can be added into an
// ordered collection and then removed. // ordered collection and then removed.
TEST(CfgHostReservationsTest, addIdentifier) { TEST(CfgHostOperationsTest, addIdentifier) {
CfgHostReservations cfg; CfgHostOperations cfg;
// Only HW address added. // Only HW address added.
ASSERT_NO_THROW(cfg.addIdentifierType("hw-address")); ASSERT_NO_THROW(cfg.addIdentifierType("hw-address"));
...@@ -62,8 +62,8 @@ TEST(CfgHostReservationsTest, addIdentifier) { ...@@ -62,8 +62,8 @@ TEST(CfgHostReservationsTest, addIdentifier) {
// This test verfies that the default DHCPv4 configuration is created // This test verfies that the default DHCPv4 configuration is created
// as expected. // as expected.
TEST(CfgHostReservationsTest, createConfig4) { TEST(CfgHostOperationsTest, createConfig4) {
CfgHostReservationsPtr cfg = CfgHostReservations::createConfig4(); CfgHostOperationsPtr cfg = CfgHostOperations::createConfig4();
EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_HWADDR)); EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_HWADDR));
EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_DUID)); EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_DUID));
...@@ -72,8 +72,8 @@ TEST(CfgHostReservationsTest, createConfig4) { ...@@ -72,8 +72,8 @@ TEST(CfgHostReservationsTest, createConfig4) {
// This test verfies that the default DHCPv6 configuration is created // This test verfies that the default DHCPv6 configuration is created
// as expected. // as expected.
TEST(CfgHostReservationsTest, createConfig6) { TEST(CfgHostOperationsTest, createConfig6) {
CfgHostReservationsPtr cfg = CfgHostReservations::createConfig6(); CfgHostOperationsPtr cfg = CfgHostOperations::createConfig6();
EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_HWADDR)); EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_HWADDR));
EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_DUID)); EXPECT_TRUE(identifierAdded(*cfg, Host::IDENT_DUID));
......
...@@ -825,12 +825,12 @@ TEST_F(HostReservationIdsParserTest, dhcp4Identifiers) { ...@@ -825,12 +825,12 @@ TEST_F(HostReservationIdsParserTest, dhcp4Identifiers) {
HostReservationIdsParser4 parser; HostReservationIdsParser4 parser;
ASSERT_NO_THROW(parser.build(config_element)); ASSERT_NO_THROW(parser.build(config_element));
ConstCfgHostReservationsPtr cfg = CfgMgr::instance().getStagingCfg()-> ConstCfgHostOperationsPtr cfg = CfgMgr::instance().getStagingCfg()->
getCfgHostReservations4(); getCfgHostOperations4();
const CfgHostReservations::IdentifierTypes& ids = cfg->getIdentifierTypes(); const CfgHostOperations::IdentifierTypes& ids = cfg->getIdentifierTypes();
ASSERT_EQ(3, ids.size()); 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_CIRCUIT_ID);
EXPECT_EQ(*id++, Host::IDENT_DUID); EXPECT_EQ(*id++, Host::IDENT_DUID);
EXPECT_EQ(*id++, Host::IDENT_HWADDR); EXPECT_EQ(*id++, Host::IDENT_HWADDR);
...@@ -846,12 +846,12 @@ TEST_F(HostReservationIdsParserTest, dhcp6Identifiers) { ...@@ -846,12 +846,12 @@ TEST_F(HostReservationIdsParserTest, dhcp6Identifiers) {
HostReservationIdsParser6 parser; HostReservationIdsParser6 parser;
ASSERT_NO_THROW(parser.build(config_element)); ASSERT_NO_THROW(parser.build(config_element));
ConstCfgHostReservationsPtr cfg = CfgMgr::instance().getStagingCfg()-> ConstCfgHostOperationsPtr cfg = CfgMgr::instance().getStagingCfg()->
getCfgHostReservations6(); getCfgHostOperations6();
const CfgHostReservations::IdentifierTypes& ids = cfg->getIdentifierTypes(); const CfgHostOperations::IdentifierTypes& ids = cfg->getIdentifierTypes();
ASSERT_EQ(2, ids.size()); 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_DUID);
EXPECT_EQ(*id++, Host::IDENT_HWADDR); EXPECT_EQ(*id++, Host::IDENT_HWADDR);
} }
...@@ -880,12 +880,12 @@ TEST_F(HostReservationIdsParserTest, dhcp4AutoIdentifiers) { ...@@ -880,12 +880,12 @@ TEST_F(HostReservationIdsParserTest, dhcp4AutoIdentifiers) {
HostReservationIdsParser4 parser; HostReservationIdsParser4 parser;
ASSERT_NO_THROW(parser.build(config_element)); ASSERT_NO_THROW(parser.build(config_element));
ConstCfgHostReservationsPtr cfg = CfgMgr::instance().getStagingCfg()-> ConstCfgHostOperationsPtr cfg = CfgMgr::instance().getStagingCfg()->
getCfgHostReservations4(); getCfgHostOperations4();
const CfgHostReservations::IdentifierTypes& ids = cfg->getIdentifierTypes(); const CfgHostOperations::IdentifierTypes& ids = cfg->getIdentifierTypes();
ASSERT_EQ(3, ids.size()); 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_HWADDR);
EXPECT_EQ(*id++, Host::IDENT_DUID); EXPECT_EQ(*id++, Host::IDENT_DUID);
EXPECT_EQ(*id++, Host::IDENT_CIRCUIT_ID); EXPECT_EQ(*id++, Host::IDENT_CIRCUIT_ID);
...@@ -922,12 +922,12 @@ TEST_F(HostReservationIdsParserTest, dhcp6AutoIdentifiers) { ...@@ -922,12 +922,12 @@ TEST_F(HostReservationIdsParserTest, dhcp6AutoIdentifiers) {
HostReservationIdsParser6 parser; HostReservationIdsParser6 parser;
ASSERT_NO_THROW(parser.build(config_element)); ASSERT_NO_THROW(parser.build(config_element));
ConstCfgHostReservationsPtr cfg = CfgMgr::instance().getStagingCfg()-> ConstCfgHostOperationsPtr cfg = CfgMgr::instance().getStagingCfg()->
getCfgHostReservations6(); getCfgHostOperations6();
const CfgHostReservations::IdentifierTypes& ids = cfg->getIdentifierTypes(); const CfgHostOperations::IdentifierTypes& ids = cfg->getIdentifierTypes();
ASSERT_EQ(2, ids.size()); 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_HWADDR);
EXPECT_EQ(*id++, Host::IDENT_DUID); EXPECT_EQ(*id++, Host::IDENT_DUID);