Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Adam Osuchowski
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_
res
er
v
ations.cc cfg_host_
res
er
v
ations.h
libkea_dhcpsrv_la_SOURCES
+=
cfg_host_
op
erations.cc cfg_host_
op
erations.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
Res
er
v
ationsPtr
&
cfg
,
const
ConstCfgHost
Op
erationsPtr
&
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
Res
er
v
ationsPtr
cfg
=
CfgMgr
::
instance
().
getCurrentCfg
()
->
getCfgHost
Res
er
v
ations6
();
ConstCfgHost
Op
erationsPtr
cfg
=
CfgMgr
::
instance
().
getCurrentCfg
()
->
getCfgHost
Op
erations6
();
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
Res
er
v
ationsPtr
cfg
=
CfgMgr
::
instance
().
getCurrentCfg
()
->
getCfgHost
Res
er
v
ations4
();
ConstCfgHost
Op
erationsPtr
cfg
=
CfgMgr
::
instance
().
getCurrentCfg
()
->
getCfgHost
Op
erations4
();
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_
res
er
v
ations.h>
#include <dhcpsrv/cfg_host_
op
erations.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
Res
er
v
ationsPtr
&
cfg
,
const
ConstCfgHost
Op
erationsPtr
&
cfg
,
const
HostGetFunc
&
host_get
);
/// @brief creates a lease and inserts it in LeaseMgr if necessary
...
...
src/lib/dhcpsrv/cfg_host_
res
er
v
ations.cc
→
src/lib/dhcpsrv/cfg_host_
op
erations.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_
res
er
v
ations.h>
#include <dhcpsrv/cfg_host_
op
erations.h>
#include <algorithm>
namespace
isc
{
namespace
dhcp
{
CfgHost
Res
er
v
ations
::
CfgHost
Res
er
v
ations
()
CfgHost
Op
erations
::
CfgHost
Op
erations
()
:
identifier_types_
()
{
}
CfgHost
Res
er
v
ationsPtr
CfgHost
Res
er
v
ations
::
createConfig4
()
{
CfgHost
Res
er
v
ationsPtr
cfg
(
new
CfgHost
Res
er
v
ations
());
CfgHost
Op
erationsPtr
CfgHost
Op
erations
::
createConfig4
()
{
CfgHost
Op
erationsPtr
cfg
(
new
CfgHost
Op
erations
());
cfg
->
addIdentifierType
(
"hw-address"
);
cfg
->
addIdentifierType
(
"duid"
);
cfg
->
addIdentifierType
(
"circuit-id"
);
return
(
cfg
);
}
CfgHost
Res
er
v
ationsPtr
CfgHost
Res
er
v
ations
::
createConfig6
()
{
CfgHost
Res
er
v
ationsPtr
cfg
(
new
CfgHost
Res
er
v
ations
());
CfgHost
Op
erationsPtr
CfgHost
Op
erations
::
createConfig6
()
{
CfgHost
Op
erationsPtr
cfg
(
new
CfgHost
Op
erations
());
cfg
->
addIdentifierType
(
"hw-address"
);
cfg
->
addIdentifierType
(
"duid"
);
return
(
cfg
);
}
void
CfgHost
Res
er
v
ations
::
addIdentifierType
(
const
std
::
string
&
identifier_name
)
{
CfgHost
Op
erations
::
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
Res
er
v
ations
::
clear
()
{
CfgHost
Op
erations
::
clear
()
{
identifier_types_
.
clear
();
}
...
...
src/lib/dhcpsrv/cfg_host_
res
er
v
ations.h
→
src/lib/dhcpsrv/cfg_host_
op
erations.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_
RES
ER
V
ATIONS_H
#define CFG_HOST_
RES
ER
V
ATIONS_H
#ifndef CFG_HOST_
OP
ERATIONS_H
#define CFG_HOST_
OP
ERATIONS_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
Res
er
v
ations.
class
CfgHost
Res
er
v
ations
;
/// @brief Forward declaration of the @ref CfgHost
Op
erations.
class
CfgHost
Op
erations
;
/// @name Pointers to the @ref CfgHost
Res
er
v
ations objects.
/// @name Pointers to the @ref CfgHost
Op
erations objects.
//@{
/// @brief Pointer to the Non-const object.
typedef
boost
::
shared_ptr
<
CfgHost
Res
er
v
ations
>
CfgHost
Res
er
v
ationsPtr
;
typedef
boost
::
shared_ptr
<
CfgHost
Op
erations
>
CfgHost
Op
erationsPtr
;
/// @brief Pointer to the const object.
typedef
boost
::
shared_ptr
<
const
CfgHost
Res
er
v
ations
>
ConstCfgHost
Res
er
v
ationsPtr
;
typedef
boost
::
shared_ptr
<
const
CfgHost
Op
erations
>
ConstCfgHost
Op
erationsPtr
;
//@}
...
...
@@ -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
Res
er
v
ations
{
class
CfgHost
Op
erations
{
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
Res
er
v
ations
();
CfgHost
Op
erations
();
/// @name Factory functions for creating default configurations.
//@{
/// @brief Factory function for DHCPv4.
static
CfgHost
Res
er
v
ationsPtr
createConfig4
();
static
CfgHost
Op
erationsPtr
createConfig4
();
/// @brief Factory function for DHCPv6.
static
CfgHost
Res
er
v
ationsPtr
createConfig6
();
static
CfgHost
Op
erationsPtr
createConfig6
();
//@}
/// @brief Adds new identifier type to a collection of identifiers
...
...
@@ -88,4 +88,4 @@ private:
}
}
#endif // CFG_HOST_
RES
ER
V
ATIONS_H
#endif // CFG_HOST_
OP
ERATIONS_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
Res
er
v
ations4
();
staging_cfg_
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Op
erations4
();
}
bool
...
...
@@ -387,7 +387,7 @@ HostReservationIdsParser4::isSupportedIdentifier(const std::string& id_name) con
HostReservationIdsParser6
::
HostReservationIdsParser6
()
:
HostReservationIdsParser
()
{
staging_cfg_
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Res
er
v
ations6
();
staging_cfg_
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Op
erations6
();
}
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
Res
er
v
ationsPtr
staging_cfg_
;
CfgHost
Op
erationsPtr
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_
res
er
v
ations4_
(
CfgHost
Res
er
v
ations
::
createConfig4
()),
cfg_host_
res
er
v
ations6_
(
CfgHost
Res
er
v
ations
::
createConfig6
()),
cfg_host_
op
erations4_
(
CfgHost
Op
erations
::
createConfig4
()),
cfg_host_
op
erations6_
(
CfgHost
Op
erations
::
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_
res
er
v
ations4_
(
CfgHost
Res
er
v
ations
::
createConfig4
()),
cfg_host_
res
er
v
ations6_
(
CfgHost
Res
er
v
ations
::
createConfig6
()),
cfg_host_
op
erations4_
(
CfgHost
Op
erations
::
createConfig4
()),
cfg_host_
op
erations6_
(
CfgHost
Op
erations
::
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_
res
er
v
ations.h>
#include <dhcpsrv/cfg_host_
op
erations.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
Res
er
v
ationsPtr
getCfgHost
Res
er
v
ations4
()
{
return
(
cfg_host_
res
er
v
ations4_
);
CfgHost
Op
erationsPtr
getCfgHost
Op
erations4
()
{
return
(
cfg_host_
op
erations4_
);
}
/// @brief Returns const pointer to the object holding general
/// configuration for host reservations in DHCPv4
ConstCfgHost
Res
er
v
ationsPtr
getCfgHost
Res
er
v
ations4
()
const
{
return
(
cfg_host_
res
er
v
ations4_
);
ConstCfgHost
Op
erationsPtr
getCfgHost
Op
erations4
()
const
{
return
(
cfg_host_
op
erations4_
);
}
/// @brief Returns pointer to the object holding general configuration
/// for host reservations in DHCPv6.
CfgHost
Res
er
v
ationsPtr
getCfgHost
Res
er
v
ations6
()
{
return
(
cfg_host_
res
er
v
ations6_
);
CfgHost
Op
erationsPtr
getCfgHost
Op
erations6
()
{
return
(
cfg_host_
op
erations6_
);
}
/// @brief Returns const pointer to the object holding general
/// configuration for host reservations in DHCPv6
ConstCfgHost
Res
er
v
ationsPtr
getCfgHost
Res
er
v
ations6
()
const
{
return
(
cfg_host_
res
er
v
ations6_
);
ConstCfgHost
Op
erationsPtr
getCfgHost
Op
erations6
()
const
{
return
(
cfg_host_
op
erations6_
);
}
//@}
...
...
@@ -529,11 +529,11 @@ private:
/// @brief Pointer to the general configuration for host reservations in
/// DHCPv4.
CfgHost
Res
er
v
ationsPtr
cfg_host_
res
er
v
ations4_
;
CfgHost
Op
erationsPtr
cfg_host_
op
erations4_
;
/// @brief Pointer to the general configuration for host reservations in
/// DHCPv6.
CfgHost
Res
er
v
ationsPtr
cfg_host_
res
er
v
ations6_
;
CfgHost
Op
erationsPtr
cfg_host_
op
erations6_
;
/// @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_
res
er
v
ations_unittest.cc
libdhcpsrv_unittests_SOURCES
+=
cfg_host_
op
erations_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_
res
er
v
ations_unittest.cc
→
src/lib/dhcpsrv/tests/cfg_host_
op
erations_unittest.cc
View file @
9a34bbb5
...
...
@@ -6,7 +6,7 @@
#include <config.h>
#include <dhcp/dhcp6.h>
#include <dhcpsrv/cfg_host_
res
er
v
ations.h>
#include <dhcpsrv/cfg_host_
op
erations.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
Res
er
v
ations
&
cfg
,
const
Host
::
IdentifierType
&
id
)
{
CfgHost
Res
er
v
ations
::
IdentifierTypes
types
=
cfg
.
getIdentifierTypes
();
identifierAdded
(
const
CfgHost
Op
erations
&
cfg
,
const
Host
::
IdentifierType
&
id
)
{
CfgHost
Op
erations
::
IdentifierTypes
types
=
cfg
.
getIdentifierTypes
();
return
(
std
::
find
(
types
.
begin
(),
types
.
end
(),
id
)
!=
types
.
end
());
}
// This test checks default configuration.
TEST
(
CfgHost
Res
er
v
ationsTest
,
defaults
)
{
CfgHost
Res
er
v
ations
cfg
;
TEST
(
CfgHost
Op
erationsTest
,
defaults
)
{
CfgHost
Op
erations
cfg
;
EXPECT_TRUE
(
cfg
.
getIdentifierTypes
().
empty
());
}
// This test verifies that identifier types can be added into an
// ordered collection and then removed.
TEST
(
CfgHost
Res
er
v
ationsTest
,
addIdentifier
)
{
CfgHost
Res
er
v
ations
cfg
;
TEST
(
CfgHost
Op
erationsTest
,
addIdentifier
)
{
CfgHost
Op
erations
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
Res
er
v
ationsTest
,
createConfig4
)
{
CfgHost
Res
er
v
ationsPtr
cfg
=
CfgHost
Res
er
v
ations
::
createConfig4
();
TEST
(
CfgHost
Op
erationsTest
,
createConfig4
)
{
CfgHost
Op
erationsPtr
cfg
=
CfgHost
Op
erations
::
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
Res
er
v
ationsTest
,
createConfig6
)
{
CfgHost
Res
er
v
ationsPtr
cfg
=
CfgHost
Res
er
v
ations
::
createConfig6
();
TEST
(
CfgHost
Op
erationsTest
,
createConfig6
)
{
CfgHost
Op
erationsPtr
cfg
=
CfgHost
Op
erations
::
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
Res
er
v
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Res
er
v
ations4
();
const
CfgHost
Res
er
v
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ConstCfgHost
Op
erationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Op
erations4
();
const
CfgHost
Op
erations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ASSERT_EQ
(
3
,
ids
.
size
());
CfgHost
Res
er
v
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
CfgHost
Op
erations
::
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
Res
er
v
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Res
er
v
ations6
();
const
CfgHost
Res
er
v
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ConstCfgHost
Op
erationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Op
erations6
();
const
CfgHost
Op
erations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ASSERT_EQ
(
2
,
ids
.
size
());
CfgHost
Res
er
v
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
CfgHost
Op
erations
::
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
Res
er
v
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Res
er
v
ations4
();
const
CfgHost
Res
er
v
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ConstCfgHost
Op
erationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Op
erations4
();
const
CfgHost
Op
erations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ASSERT_EQ
(
3
,
ids
.
size
());
CfgHost
Res
er
v
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
CfgHost
Op
erations
::
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
Res
er
v
ationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Res
er
v
ations6
();
const
CfgHost
Res
er
v
ations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ConstCfgHost
Op
erationsPtr
cfg
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getCfgHost
Op
erations6
();
const
CfgHost
Op
erations
::
IdentifierTypes
&
ids
=
cfg
->
getIdentifierTypes
();
ASSERT_EQ
(
2
,
ids
.
size
());
CfgHost
Res
er
v
ations
::
IdentifierTypes
::
const_iterator
id
=
ids
.
begin
();
CfgHost
Op
erations
::
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