Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
447
Issues
447
List
Boards
Labels
Service Desk
Milestones
Merge Requests
73
Merge Requests
73
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
9a34bbb5
Commit
9a34bbb5
authored
Apr 26, 2016
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[4303] Renamed CfgHostReservations to CfgHostOperations.
This change was suggested during a ticket review.
parent
440fd061
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
77 additions
and
77 deletions
+77
-77
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/Makefile.am
+1
-1
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine.cc
+5
-5
src/lib/dhcpsrv/alloc_engine.h
src/lib/dhcpsrv/alloc_engine.h
+2
-2
src/lib/dhcpsrv/cfg_host_operations.cc
src/lib/dhcpsrv/cfg_host_operations.cc
+10
-10
src/lib/dhcpsrv/cfg_host_operations.h
src/lib/dhcpsrv/cfg_host_operations.h
+13
-13
src/lib/dhcpsrv/parsers/host_reservation_parser.cc
src/lib/dhcpsrv/parsers/host_reservation_parser.cc
+2
-2
src/lib/dhcpsrv/parsers/host_reservation_parser.h
src/lib/dhcpsrv/parsers/host_reservation_parser.h
+1
-1
src/lib/dhcpsrv/srv_config.cc
src/lib/dhcpsrv/srv_config.cc
+4
-4
src/lib/dhcpsrv/srv_config.h
src/lib/dhcpsrv/srv_config.h
+11
-11
src/lib/dhcpsrv/tests/Makefile.am
src/lib/dhcpsrv/tests/Makefile.am
+1
-1
src/lib/dhcpsrv/tests/cfg_host_operations_unittest.cc
src/lib/dhcpsrv/tests/cfg_host_operations_unittest.cc
+11
-11
src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc
src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc
+16
-16
No files found.
src/lib/dhcpsrv/Makefile.am
View file @
9a34bbb5
...
...
@@ -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_iface.cc cfg_iface.h
libkea_dhcpsrv_la_SOURCES
+=
cfg_expiration.cc cfg_expiration.h
libkea_dhcpsrv_la_SOURCES
+=
cfg_host_
reservations.cc cfg_host_reserv
ations.h
libkea_dhcpsrv_la_SOURCES
+=
cfg_host_
operations.cc cfg_host_oper
ations.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_rsoo.cc cfg_rsoo.h
...
...
src/lib/dhcpsrv/alloc_engine.cc
View file @
9a34bbb5
...
...
@@ -306,7 +306,7 @@ AllocEngine::AllocatorPtr AllocEngine::getAllocator(Lease::Type type) {
template
<
typename
ContextType
>
void
AllocEngine
::
findReservationInternal
(
ContextType
&
ctx
,
const
ConstCfgHost
Reserv
ationsPtr
&
cfg
,
const
ConstCfgHost
Oper
ationsPtr
&
cfg
,
const
AllocEngine
::
HostGetFunc
&
host_get
)
{
ctx
.
host_
.
reset
();
...
...
@@ -376,8 +376,8 @@ AllocEngine::ClientContext6::ClientContext6(const Subnet6Ptr& subnet, const Duid
void
AllocEngine
::
findReservation
(
ClientContext6
&
ctx
)
{
ConstCfgHost
Reserv
ationsPtr
cfg
=
CfgMgr
::
instance
().
getCurrentCfg
()
->
getCfgHost
Reserv
ations6
();
ConstCfgHost
Oper
ationsPtr
cfg
=
CfgMgr
::
instance
().
getCurrentCfg
()
->
getCfgHost
Oper
ations6
();
findReservationInternal
(
ctx
,
cfg
,
boost
::
bind
(
&
HostMgr
::
get6
,
&
HostMgr
::
instance
(),
_1
,
_2
,
_3
,
_4
));
...
...
@@ -2135,8 +2135,8 @@ AllocEngine::allocateLease4(ClientContext4& ctx) {
void
AllocEngine
::
findReservation
(
ClientContext4
&
ctx
)
{
ConstCfgHost
Reserv
ationsPtr
cfg
=
CfgMgr
::
instance
().
getCurrentCfg
()
->
getCfgHost
Reserv
ations4
();
ConstCfgHost
Oper
ationsPtr
cfg
=
CfgMgr
::
instance
().
getCurrentCfg
()
->
getCfgHost
Oper
ations4
();
findReservationInternal
(
ctx
,
cfg
,
boost
::
bind
(
&
HostMgr
::
get4
,
&
HostMgr
::
instance
(),
_1
,
_2
,
_3
,
_4
));
...
...
src/lib/dhcpsrv/alloc_engine.h
View file @
9a34bbb5
...
...
@@ -13,7 +13,7 @@
#include <dhcp/pkt4.h>
#include <dhcp/pkt6.h>
#include <dhcp/option6_ia.h>
#include <dhcpsrv/cfg_host_
reserv
ations.h>
#include <dhcpsrv/cfg_host_
oper
ations.h>
#include <dhcpsrv/host.h>
#include <dhcpsrv/subnet.h>
#include <dhcpsrv/lease_mgr.h>
...
...
@@ -642,7 +642,7 @@ private:
/// @tparam ContextType Either @ref ClientContext6 or @ref ClientContext4.
template
<
typename
ContextType
>
static
void
findReservationInternal
(
ContextType
&
ctx
,
const
ConstCfgHost
Reserv
ationsPtr
&
cfg
,
const
ConstCfgHost
Oper
ationsPtr
&
cfg
,
const
HostGetFunc
&
host_get
);
/// @brief creates a lease and inserts it in LeaseMgr if necessary
...
...
src/lib/dhcpsrv/cfg_host_
reserv
ations.cc
→
src/lib/dhcpsrv/cfg_host_
oper
ations.cc
View file @
9a34bbb5
...
...
@@ -5,35 +5,35 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <exceptions/exceptions.h>
#include <dhcpsrv/cfg_host_
reserv
ations.h>
#include <dhcpsrv/cfg_host_
oper
ations.h>
#include <algorithm>
namespace
isc
{
namespace
dhcp
{
CfgHost
Reservations
::
CfgHostReserv
ations
()
CfgHost
Operations
::
CfgHostOper
ations
()
:
identifier_types_
()
{
}
CfgHost
Reserv
ationsPtr
CfgHost
Reserv
ations
::
createConfig4
()
{
CfgHost
ReservationsPtr
cfg
(
new
CfgHostReserv
ations
());
CfgHost
Oper
ationsPtr
CfgHost
Oper
ations
::
createConfig4
()
{
CfgHost
OperationsPtr
cfg
(
new
CfgHostOper
ations
());
cfg
->
addIdentifierType
(
"hw-address"
);
cfg
->
addIdentifierType
(
"duid"
);
cfg
->
addIdentifierType
(
"circuit-id"
);
return
(
cfg
);
}
CfgHost
Reserv
ationsPtr
CfgHost
Reserv
ations
::
createConfig6
()
{
CfgHost
ReservationsPtr
cfg
(
new
CfgHostReserv
ations
());
CfgHost
Oper
ationsPtr
CfgHost
Oper
ations
::
createConfig6
()
{
CfgHost
OperationsPtr
cfg
(
new
CfgHostOper
ations
());
cfg
->
addIdentifierType
(
"hw-address"
);
cfg
->
addIdentifierType
(
"duid"
);
return
(
cfg
);
}
void
CfgHost
Reserv
ations
::
addIdentifierType
(
const
std
::
string
&
identifier_name
)
{
CfgHost
Oper
ations
::
addIdentifierType
(
const
std
::
string
&
identifier_name
)
{
Host
::
IdentifierType
identifier_type
=
Host
::
getIdentifierType
(
identifier_name
);
if
(
std
::
find
(
identifier_types_
.
begin
(),
identifier_types_
.
end
(),
identifier_type
)
!=
identifier_types_
.
end
())
{
...
...
@@ -44,7 +44,7 @@ CfgHostReservations::addIdentifierType(const std::string& identifier_name) {
}
void
CfgHost
Reserv
ations
::
clear
()
{
CfgHost
Oper
ations
::
clear
()
{
identifier_types_
.
clear
();
}
...
...
src/lib/dhcpsrv/cfg_host_
reserv
ations.h
→
src/lib/dhcpsrv/cfg_host_
oper
ations.h
View file @
9a34bbb5
...
...
@@ -4,8 +4,8 @@
// 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/.
#ifndef CFG_HOST_
RESERV
ATIONS_H
#define CFG_HOST_
RESERV
ATIONS_H
#ifndef CFG_HOST_
OPER
ATIONS_H
#define CFG_HOST_
OPER
ATIONS_H
#include <dhcpsrv/host.h>
#include <boost/shared_ptr.hpp>
...
...
@@ -15,17 +15,17 @@
namespace
isc
{
namespace
dhcp
{
/// @brief Forward declaration of the @ref CfgHost
Reserv
ations.
class
CfgHost
Reserv
ations
;
/// @brief Forward declaration of the @ref CfgHost
Oper
ations.
class
CfgHost
Oper
ations
;
/// @name Pointers to the @ref CfgHost
Reserv
ations objects.
/// @name Pointers to the @ref CfgHost
Oper
ations objects.
//@{
/// @brief Pointer to the Non-const object.
typedef
boost
::
shared_ptr
<
CfgHost
Reservations
>
CfgHostReserv
ationsPtr
;
typedef
boost
::
shared_ptr
<
CfgHost
Operations
>
CfgHostOper
ationsPtr
;
/// @brief Pointer to the const object.
typedef
boost
::
shared_ptr
<
const
CfgHost
Reserv
ations
>
ConstCfgHost
Reserv
ationsPtr
;
typedef
boost
::
shared_ptr
<
const
CfgHost
Oper
ations
>
ConstCfgHost
Oper
ationsPtr
;
//@}
...
...
@@ -39,7 +39,7 @@ ConstCfgHostReservationsPtr;
/// An administrator selects which identifiers the server should
/// use and in which order to search for host reservations to
/// optimize performance of the server.
class
CfgHost
Reserv
ations
{
class
CfgHost
Oper
ations
{
public:
/// @brief Type of the container holding ordered list of identifiers.
...
...
@@ -49,15 +49,15 @@ public:
///
/// The default confguration:
/// - no identifiers selected for host reservations searches.
CfgHost
Reserv
ations
();
CfgHost
Oper
ations
();
/// @name Factory functions for creating default configurations.
//@{
/// @brief Factory function for DHCPv4.
static
CfgHost
Reserv
ationsPtr
createConfig4
();
static
CfgHost
Oper
ationsPtr
createConfig4
();
/// @brief Factory function for DHCPv6.
static
CfgHost
Reserv
ationsPtr
createConfig6
();
static
CfgHost
Oper
ationsPtr
createConfig6
();
//@}
/// @brief Adds new identifier type to a collection of identifiers
...
...
@@ -88,4 +88,4 @@ private:
}
}
#endif // CFG_HOST_
RESERV
ATIONS_H
#endif // CFG_HOST_
OPER
ATIONS_H
src/lib/dhcpsrv/parsers/host_reservation_parser.cc
View file @
9a34bbb5
...
...
@@ -377,7 +377,7 @@ HostReservationIdsParser::build(isc::data::ConstElementPtr ids_list) {
HostReservationIdsParser4
::
HostReservationIdsParser4
()
:
HostReservationIdsParser
()
{
staging_cfg_
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Reserv
ations4
();
staging_cfg_
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Oper
ations4
();
}
bool
...
...
@@ -387,7 +387,7 @@ HostReservationIdsParser4::isSupportedIdentifier(const std::string& id_name) con
HostReservationIdsParser6
::
HostReservationIdsParser6
()
:
HostReservationIdsParser
()
{
staging_cfg_
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Reserv
ations6
();
staging_cfg_
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Oper
ations6
();
}
bool
...
...
src/lib/dhcpsrv/parsers/host_reservation_parser.h
View file @
9a34bbb5
...
...
@@ -182,7 +182,7 @@ protected:
virtual
bool
isSupportedIdentifier
(
const
std
::
string
&
id_name
)
const
=
0
;
/// @brief Pointer to the object holding configuration.
CfgHost
Reserv
ationsPtr
staging_cfg_
;
CfgHost
Oper
ationsPtr
staging_cfg_
;
};
...
...
src/lib/dhcpsrv/srv_config.cc
View file @
9a34bbb5
...
...
@@ -25,8 +25,8 @@ SrvConfig::SrvConfig()
cfg_hosts_
(
new
CfgHosts
()),
cfg_rsoo_
(
new
CfgRSOO
()),
cfg_expiration_
(
new
CfgExpiration
()),
cfg_duid_
(
new
CfgDUID
()),
cfg_db_access_
(
new
CfgDbAccess
()),
cfg_host_
reservations4_
(
CfgHostReserv
ations
::
createConfig4
()),
cfg_host_
reservations6_
(
CfgHostReserv
ations
::
createConfig6
()),
cfg_host_
operations4_
(
CfgHostOper
ations
::
createConfig4
()),
cfg_host_
operations6_
(
CfgHostOper
ations
::
createConfig6
()),
class_dictionary_
(
new
ClientClassDictionary
()),
decline_timer_
(
0
)
{
}
...
...
@@ -38,8 +38,8 @@ SrvConfig::SrvConfig(const uint32_t sequence)
cfg_hosts_
(
new
CfgHosts
()),
cfg_rsoo_
(
new
CfgRSOO
()),
cfg_expiration_
(
new
CfgExpiration
()),
cfg_duid_
(
new
CfgDUID
()),
cfg_db_access_
(
new
CfgDbAccess
()),
cfg_host_
reservations4_
(
CfgHostReserv
ations
::
createConfig4
()),
cfg_host_
reservations6_
(
CfgHostReserv
ations
::
createConfig6
()),
cfg_host_
operations4_
(
CfgHostOper
ations
::
createConfig4
()),
cfg_host_
operations6_
(
CfgHostOper
ations
::
createConfig6
()),
class_dictionary_
(
new
ClientClassDictionary
()),
decline_timer_
(
0
)
{
}
...
...
src/lib/dhcpsrv/srv_config.h
View file @
9a34bbb5
...
...
@@ -10,7 +10,7 @@
#include <dhcpsrv/cfg_db_access.h>
#include <dhcpsrv/cfg_duid.h>
#include <dhcpsrv/cfg_expiration.h>
#include <dhcpsrv/cfg_host_
reserv
ations.h>
#include <dhcpsrv/cfg_host_
oper
ations.h>
#include <dhcpsrv/cfg_hosts.h>
#include <dhcpsrv/cfg_iface.h>
#include <dhcpsrv/cfg_option.h>
...
...
@@ -294,26 +294,26 @@ public:
/// @brief Returns pointer to the object holding general configuration
/// for host reservations in DHCPv4.
CfgHost
ReservationsPtr
getCfgHostReserv
ations4
()
{
return
(
cfg_host_
reserv
ations4_
);
CfgHost
OperationsPtr
getCfgHostOper
ations4
()
{
return
(
cfg_host_
oper
ations4_
);
}
/// @brief Returns const pointer to the object holding general
/// configuration for host reservations in DHCPv4
ConstCfgHost
ReservationsPtr
getCfgHostReserv
ations4
()
const
{
return
(
cfg_host_
reserv
ations4_
);
ConstCfgHost
OperationsPtr
getCfgHostOper
ations4
()
const
{
return
(
cfg_host_
oper
ations4_
);
}
/// @brief Returns pointer to the object holding general configuration
/// for host reservations in DHCPv6.
CfgHost
ReservationsPtr
getCfgHostReserv
ations6
()
{
return
(
cfg_host_
reserv
ations6_
);
CfgHost
OperationsPtr
getCfgHostOper
ations6
()
{
return
(
cfg_host_
oper
ations6_
);
}
/// @brief Returns const pointer to the object holding general
/// configuration for host reservations in DHCPv6
ConstCfgHost
ReservationsPtr
getCfgHostReserv
ations6
()
const
{
return
(
cfg_host_
reserv
ations6_
);
ConstCfgHost
OperationsPtr
getCfgHostOper
ations6
()
const
{
return
(
cfg_host_
oper
ations6_
);
}
//@}
...
...
@@ -529,11 +529,11 @@ private:
/// @brief Pointer to the general configuration for host reservations in
/// DHCPv4.
CfgHost
ReservationsPtr
cfg_host_reserv
ations4_
;
CfgHost
OperationsPtr
cfg_host_oper
ations4_
;
/// @brief Pointer to the general configuration for host reservations in
/// DHCPv6.
CfgHost
ReservationsPtr
cfg_host_reserv
ations6_
;
CfgHost
OperationsPtr
cfg_host_oper
ations6_
;
/// @brief Pointer to the control-socket information
isc
::
data
::
ConstElementPtr
control_socket_
;
...
...
src/lib/dhcpsrv/tests/Makefile.am
View file @
9a34bbb5
...
...
@@ -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_
reserv
ations_unittest.cc
libdhcpsrv_unittests_SOURCES
+=
cfg_host_
oper
ations_unittest.cc
libdhcpsrv_unittests_SOURCES
+=
cfg_hosts_unittest.cc
libdhcpsrv_unittests_SOURCES
+=
cfg_iface_unittest.cc
libdhcpsrv_unittests_SOURCES
+=
cfg_mac_source_unittest.cc
...
...
src/lib/dhcpsrv/tests/cfg_host_
reserv
ations_unittest.cc
→
src/lib/dhcpsrv/tests/cfg_host_
oper
ations_unittest.cc
View file @
9a34bbb5
...
...
@@ -6,7 +6,7 @@
#include <config.h>
#include <dhcp/dhcp6.h>
#include <dhcpsrv/cfg_host_
reserv
ations.h>
#include <dhcpsrv/cfg_host_
oper
ations.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
CfgHost
Reserv
ations
&
cfg
,
const
Host
::
IdentifierType
&
id
)
{
CfgHost
Reserv
ations
::
IdentifierTypes
types
=
cfg
.
getIdentifierTypes
();
identifierAdded
(
const
CfgHost
Oper
ations
&
cfg
,
const
Host
::
IdentifierType
&
id
)
{
CfgHost
Oper
ations
::
IdentifierTypes
types
=
cfg
.
getIdentifierTypes
();
return
(
std
::
find
(
types
.
begin
(),
types
.
end
(),
id
)
!=
types
.
end
());
}
// This test checks default configuration.
TEST
(
CfgHost
Reserv
ationsTest
,
defaults
)
{
CfgHost
Reserv
ations
cfg
;
TEST
(
CfgHost
Oper
ationsTest
,
defaults
)
{
CfgHost
Oper
ations
cfg
;
EXPECT_TRUE
(
cfg
.
getIdentifierTypes
().
empty
());
}
// This test verifies that identifier types can be added into an
// ordered collection and then removed.
TEST
(
CfgHost
Reserv
ationsTest
,
addIdentifier
)
{
CfgHost
Reserv
ations
cfg
;
TEST
(
CfgHost
Oper
ationsTest
,
addIdentifier
)
{
CfgHost
Oper
ations
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
(
CfgHost
Reserv
ationsTest
,
createConfig4
)
{
CfgHost
ReservationsPtr
cfg
=
CfgHostReserv
ations
::
createConfig4
();
TEST
(
CfgHost
Oper
ationsTest
,
createConfig4
)
{
CfgHost
OperationsPtr
cfg
=
CfgHostOper
ations
::
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
(
CfgHost
Reserv
ationsTest
,
createConfig6
)
{
CfgHost
ReservationsPtr
cfg
=
CfgHostReserv
ations
::
createConfig6
();
TEST
(
CfgHost
Oper
ationsTest
,
createConfig6
)
{
CfgHost
OperationsPtr
cfg
=
CfgHostOper
ations
::
createConfig6
();
EXPECT_TRUE
(
identifierAdded
(
*
cfg
,
Host
::
IDENT_HWADDR
));
EXPECT_TRUE
(
identifierAdded
(
*
cfg
,
Host
::
IDENT_DUID
));
...
...
src/lib/dhcpsrv/tests/host_reservation_parser_unittest.cc
View file @
9a34bbb5
...
...
@@ -825,12 +825,12 @@ TEST_F(HostReservationIdsParserTest, dhcp4Identifiers) {
HostReservationIdsParser4
parser
;
ASSERT_NO_THROW
(
parser
.
build
(
config_element
));
ConstCfgHost
Reserv
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Reserv
ations4
();
const
CfgHost
Reserv
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ConstCfgHost
Oper
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Oper
ations4
();
const
CfgHost
Oper
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ASSERT_EQ
(
3
,
ids
.
size
());
CfgHost
Reserv
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
CfgHost
Oper
ations
::
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
));
ConstCfgHost
Reserv
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Reserv
ations6
();
const
CfgHost
Reserv
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ConstCfgHost
Oper
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Oper
ations6
();
const
CfgHost
Oper
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ASSERT_EQ
(
2
,
ids
.
size
());
CfgHost
Reserv
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
CfgHost
Oper
ations
::
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
));
ConstCfgHost
Reserv
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Reserv
ations4
();
const
CfgHost
Reserv
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ConstCfgHost
Oper
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Oper
ations4
();
const
CfgHost
Oper
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ASSERT_EQ
(
3
,
ids
.
size
());
CfgHost
Reserv
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
CfgHost
Oper
ations
::
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
));
ConstCfgHost
Reserv
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Reserv
ations6
();
const
CfgHost
Reserv
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ConstCfgHost
Oper
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Oper
ations6
();
const
CfgHost
Oper
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ASSERT_EQ
(
2
,
ids
.
size
());
CfgHost
Reserv
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
CfgHost
Oper
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
EXPECT_EQ
(
*
id
++
,
Host
::
IDENT_HWADDR
);
EXPECT_EQ
(
*
id
++
,
Host
::
IDENT_DUID
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment