Browse Source

[3987] Changes after review:

 - comments, message corrected
 - unit-tests renamed to follow naming convention better
Tomek Mrugalski 9 years ago
parent
commit
d824cbb640

+ 1 - 1
src/bin/dhcp6/dhcp6_hooks.dox

@@ -181,7 +181,7 @@ packet processing. Hook points that are not specific to packet processing
    - name: @b lease6, type: isc::dhcp::Lease6Ptr, direction: <b>in/out</b>
 
  - @b Description: This callout is executed when the server engine is
-   about to decline an existing lease. The client's request is provided as
+   about to decline an existing lease. The client's DECLINE is provided as
    the "query6" argument and the existing lease with the appropriate fields
    already modified is given in the "lease6" argument. The lease contains
    the lease before it is being declined.

+ 3 - 2
src/bin/dhcp6/dhcp6_messages.mes

@@ -292,12 +292,13 @@ or released leases), but the response will not be send to the client.
 The argument includes the client and transaction identification
 information.
 
-% DHCP6_HOOK_DECLINE_SKIP During Decline processing (client=%1, interface=%2, addr=%3) hook callout set status to DROP, ignoring packet.
+% DHCP6_HOOK_DECLINE_SKIP During Decline processing (client=%1, interface=%2, addr=%3) hook callout set status to SKIP, skipping decline.
 This message indicates that the server received DECLINE message, it was verified
 to be correct and matching server's lease information. The server called hooks
 for the lease6_decline hook point and one of the callouts set next step status to SKIP.
 The server will skip the operation of moving the lease to the declined state and
-will continue processing.
+will continue processing the packet. In particular, it will send a REPLY message
+as if the decline actually took place.
 
 % DHCP6_HOOK_DECLINE_DROP During Decline processing (client=%1, interface=%2, addr=%3) hook callout set status to DROP, dropping packet.
 This message indicates that the server received DECLINE message, it was verified

+ 1 - 1
src/bin/dhcp6/dhcp6_srv.cc

@@ -2807,7 +2807,7 @@ Dhcpv6Srv::declineLease(const Pkt6Ptr& decline, const Lease6Ptr lease,
         }
 
         // Callouts decided to DROP the packet. Let's simply log it and
-        // return false, so upper layers will act accordingly.
+        // return false, so callers will act accordingly.
         if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
             LOG_DEBUG(hooks_logger, DBG_DHCP6_DETAIL, DHCP6_HOOK_DECLINE_DROP)
                 .arg(decline->getLabel())

+ 22 - 22
src/bin/dhcp6/tests/hooks_unittest.cc

@@ -557,7 +557,7 @@ boost::shared_ptr<Option6IA> HooksDhcpv6SrvTest::callback_ia_na_;
 //
 // Note that the test name does not follow test naming convention,
 // but the proper hook name is "buffer6_receive".
-TEST_F(HooksDhcpv6SrvTest, simple_buffer6_receive) {
+TEST_F(HooksDhcpv6SrvTest, simpleBuffer6Receive) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -590,7 +590,7 @@ TEST_F(HooksDhcpv6SrvTest, simple_buffer6_receive) {
 
 // Checks if callouts installed on buffer6_receive is able to change
 // the values and the parameters are indeed used by the server.
-TEST_F(HooksDhcpv6SrvTest, valueChange_buffer6_receive) {
+TEST_F(HooksDhcpv6SrvTest, valueChangeBuffer6Receive) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -627,7 +627,7 @@ TEST_F(HooksDhcpv6SrvTest, valueChange_buffer6_receive) {
 // Checks if callouts installed on buffer6_receive is able to delete
 // existing options and that change impacts server processing (mandatory
 // client-id option is deleted, so the packet is expected to be dropped)
-TEST_F(HooksDhcpv6SrvTest, deleteClientId_buffer6_receive) {
+TEST_F(HooksDhcpv6SrvTest, deleteClientIdBuffer6Receive) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -651,7 +651,7 @@ TEST_F(HooksDhcpv6SrvTest, deleteClientId_buffer6_receive) {
 
 // Checks if callouts installed on buffer6_received is able to set skip flag that
 // will cause the server to not process the packet (drop), even though it is valid.
-TEST_F(HooksDhcpv6SrvTest, skip_buffer6_receive) {
+TEST_F(HooksDhcpv6SrvTest, skipBuffer6Receive) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -678,7 +678,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_buffer6_receive) {
 //
 // Note that the test name does not follow test naming convention,
 // but the proper hook name is "pkt6_receive".
-TEST_F(HooksDhcpv6SrvTest, simple_pkt6_receive) {
+TEST_F(HooksDhcpv6SrvTest, simplePkt6Receive) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -711,7 +711,7 @@ TEST_F(HooksDhcpv6SrvTest, simple_pkt6_receive) {
 
 // Checks if callouts installed on pkt6_received is able to change
 // the values and the parameters are indeed used by the server.
-TEST_F(HooksDhcpv6SrvTest, valueChange_pkt6_receive) {
+TEST_F(HooksDhcpv6SrvTest, valueChangePkt6Receive) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -747,7 +747,7 @@ TEST_F(HooksDhcpv6SrvTest, valueChange_pkt6_receive) {
 // Checks if callouts installed on pkt6_received is able to delete
 // existing options and that change impacts server processing (mandatory
 // client-id option is deleted, so the packet is expected to be dropped)
-TEST_F(HooksDhcpv6SrvTest, deleteClientId_pkt6_receive) {
+TEST_F(HooksDhcpv6SrvTest, deleteClientIdPkt6Receive) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -771,7 +771,7 @@ TEST_F(HooksDhcpv6SrvTest, deleteClientId_pkt6_receive) {
 
 // Checks if callouts installed on pkt6_received is able to set skip flag that
 // will cause the server to not process the packet (drop), even though it is valid.
-TEST_F(HooksDhcpv6SrvTest, skip_pkt6_receive) {
+TEST_F(HooksDhcpv6SrvTest, skipPkt6Receive) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -796,7 +796,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_pkt6_receive) {
 
 // Checks if callouts installed on pkt6_send are indeed called and the
 // all necessary parameters are passed.
-TEST_F(HooksDhcpv6SrvTest, simple_pkt6_send) {
+TEST_F(HooksDhcpv6SrvTest, simplePkt6Send) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -832,7 +832,7 @@ TEST_F(HooksDhcpv6SrvTest, simple_pkt6_send) {
 
 // Checks if callouts installed on pkt6_send is able to change
 // the values and the packet sent contains those changes
-TEST_F(HooksDhcpv6SrvTest, valueChange_pkt6_send) {
+TEST_F(HooksDhcpv6SrvTest, valueChangePkt6Send) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -869,7 +869,7 @@ TEST_F(HooksDhcpv6SrvTest, valueChange_pkt6_send) {
 // existing options and that server applies those changes. In particular,
 // we are trying to send a packet without server-id. The packet should
 // be sent
-TEST_F(HooksDhcpv6SrvTest, deleteServerId_pkt6_send) {
+TEST_F(HooksDhcpv6SrvTest, deleteServerIdPkt6Send) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -900,7 +900,7 @@ TEST_F(HooksDhcpv6SrvTest, deleteServerId_pkt6_send) {
 
 // Checks if callouts installed on pkt6_skip is able to set skip flag that
 // will cause the server to not process the packet (drop), even though it is valid.
-TEST_F(HooksDhcpv6SrvTest, skip_pkt6_send) {
+TEST_F(HooksDhcpv6SrvTest, skipPkt6Send) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -931,7 +931,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_pkt6_send) {
 
 // This test checks if subnet6_select callout is triggered and reports
 // valid parameters
-TEST_F(HooksDhcpv6SrvTest, subnet6_select) {
+TEST_F(HooksDhcpv6SrvTest, subnet6Select) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -1004,7 +1004,7 @@ TEST_F(HooksDhcpv6SrvTest, subnet6_select) {
 
 // This test checks if callout installed on subnet6_select hook point can pick
 // a different subnet.
-TEST_F(HooksDhcpv6SrvTest, subnet_select_change) {
+TEST_F(HooksDhcpv6SrvTest, subnet6SselectChange) {
 
     // Install pkt6_receive_callout
     EXPECT_NO_THROW(HooksManager::preCalloutsLibraryHandle().registerCallout(
@@ -1077,7 +1077,7 @@ TEST_F(HooksDhcpv6SrvTest, subnet_select_change) {
 
 // This test verifies that incoming (positive) RENEW can be handled properly,
 // and the lease6_renew callouts are triggered.
-TEST_F(HooksDhcpv6SrvTest, basic_lease6_renew) {
+TEST_F(HooksDhcpv6SrvTest, basicLease6Renew) {
     NakedDhcpv6Srv srv(0);
 
     // Install pkt6_receive_callout
@@ -1176,7 +1176,7 @@ TEST_F(HooksDhcpv6SrvTest, basic_lease6_renew) {
 
 // This test verifies that incoming (positive) RENEW can be handled properly,
 // and the lease6_renew callouts are able to change the lease being updated.
-TEST_F(HooksDhcpv6SrvTest, leaseUpdate_lease6_renew) {
+TEST_F(HooksDhcpv6SrvTest, leaseUpdateLease6Renew) {
     NakedDhcpv6Srv srv(0);
 
     // Install pkt6_receive_callout
@@ -1269,7 +1269,7 @@ TEST_F(HooksDhcpv6SrvTest, leaseUpdate_lease6_renew) {
 // This test verifies that incoming (positive) RENEW can be handled properly,
 // and the lease6_renew callouts are able to set the skip flag that will
 // reject the renewal
-TEST_F(HooksDhcpv6SrvTest, skip_lease6_renew) {
+TEST_F(HooksDhcpv6SrvTest, skipLease6Renew) {
     NakedDhcpv6Srv srv(0);
 
     // Install pkt6_receive_callout
@@ -1347,7 +1347,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_lease6_renew) {
 // - returned REPLY message has server-id
 // - returned REPLY message has IA that does not include an IAADDR
 // - lease is actually removed from LeaseMgr
-TEST_F(HooksDhcpv6SrvTest, basic_lease6_release) {
+TEST_F(HooksDhcpv6SrvTest, basicLease6Release) {
     NakedDhcpv6Srv srv(0);
 
     // Install pkt6_receive_callout
@@ -1429,7 +1429,7 @@ TEST_F(HooksDhcpv6SrvTest, basic_lease6_release) {
 // - returned REPLY message has server-id
 // - returned REPLY message has IA that does not include an IAADDR
 // - lease is actually removed from LeaseMgr
-TEST_F(HooksDhcpv6SrvTest, skip_lease6_release) {
+TEST_F(HooksDhcpv6SrvTest, skipLease6Release) {
     NakedDhcpv6Srv srv(0);
 
     // Install pkt6_receive_callout
@@ -1493,7 +1493,7 @@ TEST_F(HooksDhcpv6SrvTest, skip_lease6_release) {
 
 // This test checks that the basic decline hook (lease6_decline) is
 // triggered properly.
-TEST_F(HooksDhcpv6SrvTest, declineBasic) {
+TEST_F(HooksDhcpv6SrvTest, basicLease6Decline) {
     IfaceMgrTestConfig test_config(true);
 
     // Install lease6_decline callout
@@ -1537,7 +1537,7 @@ TEST_F(HooksDhcpv6SrvTest, declineBasic) {
 }
 
 // Test that the lease6_decline hook point can handle SKIP status.
-TEST_F(HooksDhcpv6SrvTest, declineSkip) {
+TEST_F(HooksDhcpv6SrvTest, lease6DeclineSkip) {
     IfaceMgrTestConfig test_config(true);
 
     // Install lease6_decline callout. It will set the status to skip
@@ -1581,7 +1581,7 @@ TEST_F(HooksDhcpv6SrvTest, declineSkip) {
 }
 
 // Test that the lease6_decline hook point can handle DROP status.
-TEST_F(HooksDhcpv6SrvTest, declineDrop) {
+TEST_F(HooksDhcpv6SrvTest, lease6DeclineDrop) {
     IfaceMgrTestConfig test_config(true);
 
     // Install lease6_decline callout. It will set the status to skip