// Purposely using high cltt and valid lifetime to test that
// expiration time is cast properly.
lease->valid_lft_ = HIGH_VALID_LIFETIME; // Very high valid lifetime
+ lease->old_valid_lft_ = HIGH_VALID_LIFETIME; // Very high valid lifetime
lease->cltt_ = DEC_2030_TIME; // December 11th 2030
+ lease->old_cltt_ = DEC_2030_TIME; // December 11th 2030
if (declined) {
lease->state_ = Lease::STATE_DECLINED;
}
// Purposely using high cltt and valid lifetime to test that
// expiration time is cast properly.
lease->valid_lft_ = HIGH_VALID_LIFETIME; // Very high valid lifetime
+ lease->old_valid_lft_ = HIGH_VALID_LIFETIME; // Very high valid lifetime
lease->cltt_ = DEC_2030_TIME; // December 11th 2030
+ lease->old_cltt_ = DEC_2030_TIME; // December 11th 2030
if (declined) {
lease->state_ = Lease::STATE_DECLINED;
}
" \"hostname\": \"newhostname.example.org\""
" }\n"
"}";
- string exp_rsp = "failed to update the lease with address 192.0.2.1 - no such lease";
+ string exp_rsp = "failed to update the lease with address 192.0.2.1 "
+ "either because the lease has been deleted or it has changed in the "
+ "database, in both cases a retry might succeed";
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
}
" \"force-create\": false"
" }\n"
"}";
- string exp_rsp = "failed to update the lease with address 192.0.2.1 - no such lease";
+ string exp_rsp = "failed to update the lease with address 192.0.2.1 "
+ "either because the lease has been deleted or it has changed in the "
+ "database, in both cases a retry might succeed";
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
checkLease4Stats(44, 0, 0);
" \"hostname\": \"newhostname.example.org\""
" }\n"
"}";
- string exp_rsp = "failed to update the lease with address 2001:db8:1::1 - no such lease";
+ string exp_rsp = "failed to update the lease with address 2001:db8:1::1 "
+ "either because the lease has been deleted or it has changed in the "
+ "database, in both cases a retry might succeed";
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
checkLease6Stats(66, 0, 0, 0);
" \"force-create\": false"
" }\n"
"}";
- string exp_rsp = "failed to update the lease with address 2001:db8:1::1 - no such lease";
+ string exp_rsp = "failed to update the lease with address 2001:db8:1::1 "
+ "either because the lease has been deleted or it has changed in the "
+ "database, in both cases a retry might succeed";
testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
checkLease6Stats(66, 0, 0, 0);
Lease4StorageAddressIndex::const_iterator lease_it = index.find(lease->addr_);
if (lease_it == index.end()) {
valid = false;
- } else if ((!persist) && (((*lease_it)->old_cltt_ != lease->old_cltt_) ||
- ((*lease_it)->old_valid_lft_ != lease->old_valid_lft_))) {
+ } else if ((!persist) && (((*lease_it)->cltt_ != lease->old_cltt_) ||
+ ((*lease_it)->valid_lft_ != lease->old_valid_lft_))) {
valid = false;
}
Lease6StorageAddressIndex::const_iterator lease_it = index.find(lease->addr_);
if (lease_it == index.end()) {
valid = false;
- } else if ((!persist) && (((*lease_it)->old_cltt_ != lease->old_cltt_) ||
- ((*lease_it)->old_valid_lft_ != lease->old_valid_lft_))) {
+ } else if ((!persist) && (((*lease_it)->cltt_ != lease->old_cltt_) ||
+ ((*lease_it)->valid_lft_ != lease->old_valid_lft_))) {
valid = false;
}
lease_copy.valid_lft_ = 0;
lease_file4_->append(lease_copy);
} else {
- // for test purpose only to check that an actual database
+ // For test purpose only: check that an actual database
// implementation action is atomic
- if ((*l)->old_cltt_ != lease->old_cltt_ ||
- (*l)->old_valid_lft_ != lease->old_valid_lft_) {
+ if ((*l)->cltt_ != lease->old_cltt_ ||
+ (*l)->valid_lft_ != lease->old_valid_lft_) {
return false;
}
}
lease_copy.preferred_lft_ = 0;
lease_file6_->append(lease_copy);
} else {
- // for test purpose only to check that an actual database
+ // For test purpose only: check that an actual database
// implementation action is atomic
- if ((*l)->old_cltt_ != lease->old_cltt_ ||
- (*l)->old_valid_lft_ != lease->old_valid_lft_) {
+ if ((*l)->cltt_ != lease->old_cltt_ ||
+ (*l)->valid_lft_ != lease->old_valid_lft_) {
return false;
}
}