Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
cea271d0
Commit
cea271d0
authored
Dec 11, 2015
by
Marcin Siodelski
Browse files
[4206b] Added unit tests for malfromed client id in getLabel.
parent
a158b3d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcp/tests/pkt4_unittest.cc
View file @
cea271d0
...
...
@@ -1024,6 +1024,19 @@ TEST_F(Pkt4Test, getLabel) {
}
// Test that empty client identifier option doesn't cause an exception from
// Pkt4::getLabel.
TEST_F
(
Pkt4Test
,
getLabelEmptyClientId
)
{
Pkt4
pkt
(
DHCPOFFER
,
1234
);
// Create empty client identifier option.
OptionPtr
empty_opt
(
new
Option
(
Option
::
V4
,
DHO_DHCP_CLIENT_IDENTIFIER
));
pkt
.
addOption
(
empty_opt
);
EXPECT_EQ
(
"[hwtype=1 ], cid=[no info], tid=0x4d2"
" (malformed client-id)"
,
pkt
.
getLabel
());
}
// Tests that the variant of makeLabel which doesn't include transaction
// id produces expected output.
TEST_F
(
Pkt4Test
,
makeLabelWithoutTransactionId
)
{
...
...
src/lib/dhcp/tests/pkt6_unittest.cc
View file @
cea271d0
...
...
@@ -1530,4 +1530,15 @@ TEST_F(Pkt6Test, getLabel) {
}
// Test that empty client identifier option doesn't cause an exception from
// Pkt6::getLabel.
TEST_F
(
Pkt6Test
,
getLabelEmptyClientId
)
{
// Create a packet.
Pkt6
pkt
(
DHCPV6_SOLICIT
,
0x2312
);
// Add empty client idenitifier option.
pkt
.
addOption
(
OptionPtr
(
new
Option
(
Option
::
V6
,
D6O_CLIENTID
)));
EXPECT_EQ
(
"duid=[no info], tid=0x2312"
,
pkt
.
getLabel
());
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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