Commit 12772fb4 authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[3779] Addressed additional minor review comments

parent e87dc1e7
...@@ -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 DHCPREQUEST 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 expectedAddress("10.0.0.10"); isc::asiolink::IOAddress expected_address("10.0.0.10");
std::string expectedFqdn("myhost-10-0-0-10.fake-suffix.isc.org."); std::string expected_fqdn("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(expectedFqdn, fqdn->getDomainName()); EXPECT_EQ(expected_fqdn, 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(expectedAddress)); Lease4Ptr lease = LeaseMgrFactory::instance().getLease4(IOAddress(expected_address));
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(expectedFqdn, fqdn->getDomainName()); EXPECT_EQ(expected_fqdn, 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(expectedAddress)); lease = LeaseMgrFactory::instance().getLease4(IOAddress(expected_address));
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(expectedFqdn, fqdn->getDomainName()); EXPECT_EQ(expected_fqdn, 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(expectedAddress)); lease = LeaseMgrFactory::instance().getLease4(IOAddress(expected_address));
ASSERT_TRUE(lease); ASSERT_TRUE(lease);
EXPECT_EQ(expectedFqdn, lease->hostname_); EXPECT_EQ(expected_fqdn, lease->hostname_);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment