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
b4ecbba0
Commit
b4ecbba0
authored
Jun 19, 2015
by
Tomek Mrugalski
🛰
Browse files
[3795] One extra unit-test implemented for pkt6-receive-drop
parent
ad36b40c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp6/tests/sarr_unittest.cc
View file @
b4ecbba0
...
...
@@ -373,7 +373,8 @@ TEST_F(SARRTest, pkt6ReceiveDropStat1) {
}
// This test verifies that pkt6-receive-drop is increased properly when the
// client's packet is rejected due to sending to unicast.
// client's packet is rejected due to having too many client-id options
// (exactly one is expected).
TEST_F
(
SARRTest
,
pkt6ReceiveDropStat2
)
{
// Let's use one of the existing configurations and tell the client to
...
...
@@ -396,5 +397,34 @@ TEST_F(SARRTest, pkt6ReceiveDropStat2) {
EXPECT_EQ
(
1
,
pkt6_recv_drop
->
getInteger
().
first
);
}
// This test verifies that pkt6-receive-drop is increased properly when the
// client's packet is rejected due to having too many
TEST_F
(
SARRTest
,
pkt6ReceiveDropStat3
)
{
// Let's use one of the existing configurations and tell the client to
// ask for an address.
Dhcp6Client
client
;
configure
(
CONFIGS
[
1
],
*
client
.
getServer
());
client
.
setInterface
(
"eth1"
);
client
.
useNA
();
client
.
setDestAddress
(
asiolink
::
IOAddress
(
"2001:db8::1"
));
// Pretend it's unicast
// Let's send our client-id as server-id. That will result in the
// packet containing the client-id twice. That should cause RFCViolation
// exception.
client
.
useServerId
(
client
.
getClientId
());
client
.
doSolicit
();
// Ok, let's check the statistics. None should be present.
using
namespace
isc
::
stats
;
StatsMgr
&
mgr
=
StatsMgr
::
instance
();
ObservationPtr
pkt6_recv_drop
=
mgr
.
getObservation
(
"pkt6-receive-drop"
);
ASSERT_TRUE
(
pkt6_recv_drop
);
EXPECT_EQ
(
1
,
pkt6_recv_drop
->
getInteger
().
first
);
}
}
// end of anonymous namespace
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