Skip to content

Commit

Permalink
[#2736] Addressed review comments
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tmarkwalder committed Nov 19, 2024
1 parent 31807e8 commit 01a9775
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
10 changes: 5 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
2304. [func] tmark
Both kea-dhcp4 and kea-dhcp6 will now emit a warning
log message when classes are configured with both
``only-in-additional-list`` true and parameter(s)
that normally impact lease lifetimes (e.g. 'valid-
lifetime', 'preferred-lifetime`).
Both kea-dhcp4 and kea-dhcp6 servers will now
log a warning message when they detect classes that
configure lease life time parameters (e.g. 'valid-lifetime',
'preferred-lifetime') while also setting
'only-in-addditiional-list' to true.
(Gitlab #2736)

2303. [bug] tmark
Expand Down
6 changes: 3 additions & 3 deletions doc/sphinx/arm/classify.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,8 @@ Class Priority
==============

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

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

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

.. note::
Because additional evaluation occurs after lease assignment, parameters
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dhcpsrv/parsers/client_class_def_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
!preferred_lft.unspecified() ||
!offer_lft.unspecified())) {
LOG_WARN(dhcpsrv_logger, DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES)
.arg(name);
.arg(name);
}

// Add the client class definition
Expand Down
15 changes: 8 additions & 7 deletions src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class ExpressionParserTest : public ::testing::Test {
};

/// @brief Test fixture class for @c ClientClassDefParser.
//class ClientClassDefParserTest : public ::testing::Test {
class ClientClassDefParserTest : public LogContentTest {
protected:

Expand Down Expand Up @@ -2261,11 +2260,12 @@ TEST_F(ClientClassDefParserTest, addtionalWithLifetimes4) {
// If we expect the warning log to be emitted the occurrences
// in the log file should bump by 1.
if (scenario.should_log_) {
// Veriy we emitted another instance of the log message.
++exp_log_count;
ASSERT_EQ(countFile("DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES"),
exp_log_count);
}

// Veriy we have the expected count of log messages.
ASSERT_EQ(countFile("DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES"),
exp_log_count);
}
}

Expand Down Expand Up @@ -2335,11 +2335,12 @@ TEST_F(ClientClassDefParserTest, addtionalWithLifetimes6) {
// If we expect the warning log to be emitted the occurrences
// in the log file should bump by 1.
if (scenario.should_log_) {
// Veriy we emitted another instance of the log message.
++exp_log_count;
ASSERT_EQ(countFile("DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES"),
exp_log_count);
}

// Veriy we have the expected count of log messages.
ASSERT_EQ(countFile("DHCPSRV_CLASS_WITH_ADDTIONAL_AND_LIFETIMES"),
exp_log_count);
}
}

Expand Down

0 comments on commit 01a9775

Please sign in to comment.