" },"
" {"
" \"hw-address\": \"dd:dd:dd:dd:dd:01\","
- " \"hostname\": \"reserved.example.com\""
+ " \"hostname\": \"test.example.com\""
" }"
" ]"
"} ],"
"\"valid-lifetime\": 600,"
"\"subnet4\": [ { "
" \"subnet\": \"10.0.0.0/24\", "
- " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
+ " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]"
"} ],"
"\"dhcp-ddns\": {"
" \"enable-updates\": true,"
DIFF_POOL_NO_HR,
DIFF_SUBNET,
DIFF_SUBNET_NO_HR,
- NO_HR = 4
+ NO_HR
};
/// @brief Enum for specifying expected response to client renewal attempt
/// @param addr - string containing the ip address expected in the NCR
void verifyNameChangeRequest(const isc::dhcp_ddns::NameChangeType type,
const std::string& addr) {
- ASSERT_EQ(1, d2_mgr_.getQueueSize());
+ ASSERT_TRUE(d2_mgr_.getQueueSize() > 0);
isc::dhcp_ddns::NameChangeRequestPtr ncr;
ASSERT_NO_THROW(ncr = d2_mgr_.peekAt(0));
// Process the message off the queue
ASSERT_NO_THROW(d2_mgr_.runReadyIO());
- ASSERT_EQ(0, d2_mgr_.getQueueSize());
}
/// @brief Conducts a single out-of-range test scenario
// Verify that we received an ACK to our renewal
resp = client.getContext().response_;
ASSERT_EQ(DHCPACK, static_cast<int>(resp->getType()));
+ EXPECT_EQ(0, d2_mgr_.getQueueSize());
// STAGE TWO:
}
// Test verifies that once-valid dynamic address host reserveration,
-// whose address is within the configured subnet, but whose
+// whose address is within the configured subnet and pool, but whose
// reservation has been removed:
//
-// a: Is NAKed upon a renewal attempt
+// a: Is allowed to renew
// b: Is released properly upon release, including DNS removal
//
TEST_F(OutOfRangeTest, dynamicHostReservationRemoved) {
std::string hwaddress = "dd:dd:dd:dd:dd:01";
std::string expected_address = "";
- oorRenewReleaseTest(NO_HR, hwaddress, expected_address, DOES_NOT_RENEW);
+ oorRenewReleaseTest(NO_HR, hwaddress, expected_address, DOES_RENEW);
}
// Test verifies that once-valid dynamic address host reserveration,
query->addOption(forced_server_id_);
}
copyIAs(context_.response_, query);
+ context_.query_ = query;
// Add Client FQDN if configured.
appendFQDN();
- context_.query_ = query;
sendMsg(context_.query_);
context_.response_ = receiveOneMsg();
Pkt6Ptr query = createMsg(DHCPV6_RENEW);
query->addOption(context_.response_->getOption(D6O_SERVERID));
copyIAsFromLeases(query);
+ context_.query_ = query;
// Add Client FQDN if configured.
appendFQDN();
- context_.query_ = query;
sendMsg(context_.query_);
context_.response_ = receiveOneMsg();
// Apply configuration only if the server has responded.
Dhcp6Client::doRebind() {
Pkt6Ptr query = createMsg(DHCPV6_REBIND);
copyIAsFromLeases(query);
+ context_.query_ = query;
+
+ // Add Client FQDN if configured.
+ appendFQDN();
+
+ sendMsg(context_.query_);
+ context_.response_ = receiveOneMsg();
+ // Apply configuration only if the server has responded.
+ if (context_.response_) {
+ applyRcvdConfiguration(context_.response_);
+ }
+}
+
+
+void
+Dhcp6Client::doRelease() {
+ Pkt6Ptr query = createMsg(DHCPV6_RELEASE);
+ if (!forced_server_id_) {
+ query->addOption(context_.response_->getOption(D6O_SERVERID));
+ } else {
+ query->addOption(forced_server_id_);
+ }
+ copyIAsFromLeases(query);
// Add Client FQDN if configured.
appendFQDN();
}
}
+
void
Dhcp6Client::doConfirm() {
context_.query_ = createMsg(DHCPV6_CONFIRM);