Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
12772fb4
Commit
12772fb4
authored
May 08, 2015
by
Thomas Markwalder
Browse files
[3779] Addressed additional minor review comments
parent
e87dc1e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/tests/fqdn_unittest.cc
View file @
12772fb4
...
@@ -1332,12 +1332,12 @@ TEST_F(NameDhcpv4SrvTest, hostnameReservation) {
...
@@ -1332,12 +1332,12 @@ TEST_F(NameDhcpv4SrvTest, hostnameReservation) {
// Test verifies that the server properly generates a FQDN when the client
// Test verifies that the server properly generates a FQDN when the client
// FQDN name is blank, whether or not DDNS updates are enabled. It also
// FQDN name is blank, whether or not DDNS updates are enabled. It also
// verifies that the lease is only in the database following a REQUEST and
// verifies that the lease is only in the database following a
DHCP
REQUEST and
// that the lesae contains the generated FQDN.
// that the lesae contains the generated FQDN.
TEST_F
(
NameDhcpv4SrvTest
,
emptyFqdn
)
{
TEST_F
(
NameDhcpv4SrvTest
,
emptyFqdn
)
{
Dhcp4Client
client
(
Dhcp4Client
::
SELECTING
);
Dhcp4Client
client
(
Dhcp4Client
::
SELECTING
);
isc
::
asiolink
::
IOAddress
expected
A
ddress
(
"10.0.0.10"
);
isc
::
asiolink
::
IOAddress
expected
_a
ddress
(
"10.0.0.10"
);
std
::
string
expected
F
qdn
(
"myhost-10-0-0-10.fake-suffix.isc.org."
);
std
::
string
expected
_f
qdn
(
"myhost-10-0-0-10.fake-suffix.isc.org."
);
// Load a configuration with DDNS updates disabled
// Load a configuration with DDNS updates disabled
configure
(
CONFIGS
[
2
],
*
client
.
getServer
());
configure
(
CONFIGS
[
2
],
*
client
.
getServer
());
...
@@ -1361,13 +1361,13 @@ TEST_F(NameDhcpv4SrvTest, emptyFqdn) {
...
@@ -1361,13 +1361,13 @@ TEST_F(NameDhcpv4SrvTest, emptyFqdn) {
Option4ClientFqdnPtr
fqdn
;
Option4ClientFqdnPtr
fqdn
;
fqdn
=
boost
::
dynamic_pointer_cast
<
Option4ClientFqdn
>
(
resp
->
getOption
(
DHO_FQDN
));
fqdn
=
boost
::
dynamic_pointer_cast
<
Option4ClientFqdn
>
(
resp
->
getOption
(
DHO_FQDN
));
ASSERT_TRUE
(
fqdn
);
ASSERT_TRUE
(
fqdn
);
EXPECT_EQ
(
expected
F
qdn
,
fqdn
->
getDomainName
());
EXPECT_EQ
(
expected
_f
qdn
,
fqdn
->
getDomainName
());
checkFqdnFlags
(
resp
,
(
Option4ClientFqdn
::
FLAG_N
|
checkFqdnFlags
(
resp
,
(
Option4ClientFqdn
::
FLAG_N
|
Option4ClientFqdn
::
FLAG_E
|
Option4ClientFqdn
::
FLAG_E
|
Option4ClientFqdn
::
FLAG_O
));
Option4ClientFqdn
::
FLAG_O
));
// Make sure the lease is NOT in the database.
// Make sure the lease is NOT in the database.
Lease4Ptr
lease
=
LeaseMgrFactory
::
instance
().
getLease4
(
IOAddress
(
expected
A
ddress
));
Lease4Ptr
lease
=
LeaseMgrFactory
::
instance
().
getLease4
(
IOAddress
(
expected
_a
ddress
));
ASSERT_FALSE
(
lease
);
ASSERT_FALSE
(
lease
);
// Now test with updates enabled
// Now test with updates enabled
...
@@ -1387,12 +1387,12 @@ TEST_F(NameDhcpv4SrvTest, emptyFqdn) {
...
@@ -1387,12 +1387,12 @@ TEST_F(NameDhcpv4SrvTest, emptyFqdn) {
// correct for updates enabled.
// correct for updates enabled.
fqdn
=
boost
::
dynamic_pointer_cast
<
Option4ClientFqdn
>
(
resp
->
getOption
(
DHO_FQDN
));
fqdn
=
boost
::
dynamic_pointer_cast
<
Option4ClientFqdn
>
(
resp
->
getOption
(
DHO_FQDN
));
ASSERT_TRUE
(
fqdn
);
ASSERT_TRUE
(
fqdn
);
EXPECT_EQ
(
expected
F
qdn
,
fqdn
->
getDomainName
());
EXPECT_EQ
(
expected
_f
qdn
,
fqdn
->
getDomainName
());
checkFqdnFlags
(
resp
,
(
Option4ClientFqdn
::
FLAG_E
|
checkFqdnFlags
(
resp
,
(
Option4ClientFqdn
::
FLAG_E
|
Option4ClientFqdn
::
FLAG_S
));
Option4ClientFqdn
::
FLAG_S
));
// Make sure the lease is NOT in the database.
// Make sure the lease is NOT in the database.
lease
=
LeaseMgrFactory
::
instance
().
getLease4
(
IOAddress
(
expected
A
ddress
));
lease
=
LeaseMgrFactory
::
instance
().
getLease4
(
IOAddress
(
expected
_a
ddress
));
ASSERT_FALSE
(
lease
);
ASSERT_FALSE
(
lease
);
// Do a DORA and verify that the lease exists and the name is correct.
// Do a DORA and verify that the lease exists and the name is correct.
...
@@ -1407,14 +1407,14 @@ TEST_F(NameDhcpv4SrvTest, emptyFqdn) {
...
@@ -1407,14 +1407,14 @@ TEST_F(NameDhcpv4SrvTest, emptyFqdn) {
// correct for updates enabled.
// correct for updates enabled.
fqdn
=
boost
::
dynamic_pointer_cast
<
Option4ClientFqdn
>
(
resp
->
getOption
(
DHO_FQDN
));
fqdn
=
boost
::
dynamic_pointer_cast
<
Option4ClientFqdn
>
(
resp
->
getOption
(
DHO_FQDN
));
ASSERT_TRUE
(
fqdn
);
ASSERT_TRUE
(
fqdn
);
EXPECT_EQ
(
expected
F
qdn
,
fqdn
->
getDomainName
());
EXPECT_EQ
(
expected
_f
qdn
,
fqdn
->
getDomainName
());
checkFqdnFlags
(
resp
,
(
Option4ClientFqdn
::
FLAG_E
|
checkFqdnFlags
(
resp
,
(
Option4ClientFqdn
::
FLAG_E
|
Option4ClientFqdn
::
FLAG_S
));
Option4ClientFqdn
::
FLAG_S
));
// Make sure the lease is in the database and hostname is correct.
// Make sure the lease is in the database and hostname is correct.
lease
=
LeaseMgrFactory
::
instance
().
getLease4
(
IOAddress
(
expected
A
ddress
));
lease
=
LeaseMgrFactory
::
instance
().
getLease4
(
IOAddress
(
expected
_a
ddress
));
ASSERT_TRUE
(
lease
);
ASSERT_TRUE
(
lease
);
EXPECT_EQ
(
expected
F
qdn
,
lease
->
hostname_
);
EXPECT_EQ
(
expected
_f
qdn
,
lease
->
hostname_
);
}
}
...
...
Write
Preview
Supports
Markdown
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