Skip to content

Commit 01a9775

Browse files
committed
[#2736] Addressed review comments
Changes to be committed: modified: ../../../../ChangeLog modified: ../../../../doc/sphinx/arm/classify.rst modified: ../parsers/client_class_def_parser.cc modified: client_class_def_parser_unittest.cc
1 parent 31807e8 commit 01a9775

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

ChangeLog

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
2304. [func] tmark
2-
Both kea-dhcp4 and kea-dhcp6 will now emit a warning
3-
log message when classes are configured with both
4-
``only-in-additional-list`` true and parameter(s)
5-
that normally impact lease lifetimes (e.g. 'valid-
6-
lifetime', 'preferred-lifetime`).
2+
Both kea-dhcp4 and kea-dhcp6 servers will now
3+
log a warning message when they detect classes that
4+
configure lease life time parameters (e.g. 'valid-lifetime',
5+
'preferred-lifetime') while also setting
6+
'only-in-addditiional-list' to true.
77
(Gitlab #2736)
88

99
2303. [bug] tmark

doc/sphinx/arm/classify.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,8 +1170,8 @@ Class Priority
11701170
==============
11711171

11721172
Client classes in Kea follow the order in which they are specified in the
1173-
configuration (vs. alphabetical order). Additional classes are ordered by
1174-
pool, subnet, and then shared-network and within each scope by the order in
1173+
configuration (vs. alphabetical order). Additional classes are ordered by
1174+
pool, subnet, and then shared-network and within each scope by the order in
11751175
which they appear in ``evaluate-additional-classes``.
11761176

11771177
When determining which client-class information (comprised of
@@ -1189,7 +1189,7 @@ reservation.
11891189

11901190
On the other hand, lease lifetimes and DHCPv4 field values defined at class
11911191
scope override any values defined globally, in a subnet scope, or in a
1192-
shared-network scope.
1192+
shared-network scope.
11931193

11941194
.. note::
11951195
Because additional evaluation occurs after lease assignment, parameters

src/lib/dhcpsrv/parsers/client_class_def_parser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
297297
!preferred_lft.unspecified() ||
298298
!offer_lft.unspecified())) {
299299
LOG_WARN(dhcpsrv_logger, DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES)
300-
.arg(name);
300+
.arg(name);
301301
}
302302

303303
// Add the client class definition

src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ class ExpressionParserTest : public ::testing::Test {
103103
};
104104

105105
/// @brief Test fixture class for @c ClientClassDefParser.
106-
//class ClientClassDefParserTest : public ::testing::Test {
107106
class ClientClassDefParserTest : public LogContentTest {
108107
protected:
109108

@@ -2261,11 +2260,12 @@ TEST_F(ClientClassDefParserTest, addtionalWithLifetimes4) {
22612260
// If we expect the warning log to be emitted the occurrences
22622261
// in the log file should bump by 1.
22632262
if (scenario.should_log_) {
2264-
// Veriy we emitted another instance of the log message.
22652263
++exp_log_count;
2266-
ASSERT_EQ(countFile("DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES"),
2267-
exp_log_count);
22682264
}
2265+
2266+
// Veriy we have the expected count of log messages.
2267+
ASSERT_EQ(countFile("DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES"),
2268+
exp_log_count);
22692269
}
22702270
}
22712271

@@ -2335,11 +2335,12 @@ TEST_F(ClientClassDefParserTest, addtionalWithLifetimes6) {
23352335
// If we expect the warning log to be emitted the occurrences
23362336
// in the log file should bump by 1.
23372337
if (scenario.should_log_) {
2338-
// Veriy we emitted another instance of the log message.
23392338
++exp_log_count;
2340-
ASSERT_EQ(countFile("DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES"),
2341-
exp_log_count);
23422339
}
2340+
2341+
// Veriy we have the expected count of log messages.
2342+
ASSERT_EQ(countFile("DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES"),
2343+
exp_log_count);
23432344
}
23442345
}
23452346

0 commit comments

Comments
 (0)