2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-29 04:57:52 +00:00

[#710,!408] Fixed invalid tabulations in test config backends impl.

This commit is contained in:
Marcin Siodelski 2019-07-09 00:10:38 +02:00 committed by Francis Dupont
parent 22aa7d8422
commit 326fdbeb51
2 changed files with 20 additions and 20 deletions

View File

@ -562,29 +562,29 @@ TestConfigBackendDHCPv4::createUpdateOption4(const db::ServerSelector& server_se
auto tags = server_selector.getTags(); auto tags = server_selector.getTags();
auto not_in_tags = false; auto not_in_tags = false;
for (auto subnet : subnets_) { for (auto subnet : subnets_) {
// Get the pool: if it is not here we can directly go to the next subnet. // Get the pool: if it is not here we can directly go to the next subnet.
auto pool = subnet->getPool(Lease::TYPE_V4, pool_start_address); auto pool = subnet->getPool(Lease::TYPE_V4, pool_start_address);
if (!pool) { if (!pool) {
continue; continue;
} }
// Verify the subnet is in all or one of the given servers. // Verify the subnet is in all or one of the given servers.
if (!subnet->hasAllServerTag()) { if (!subnet->hasAllServerTag()) {
auto in_tags = false; auto in_tags = false;
for (auto tag : tags) { for (auto tag : tags) {
if (subnet->hasServerTag(ServerTag(tag))) { if (subnet->hasServerTag(ServerTag(tag))) {
in_tags = true; in_tags = true;
break; break;
} }
} }
if (!in_tags) { if (!in_tags) {
// Records the fact a subnet was found but not in a server. // Records the fact a subnet was found but not in a server.
not_in_tags = true; not_in_tags = true;
continue; continue;
} }
} }
// Update the option. // Update the option.
pool->getCfgOption()->del(option->space_name_, option->option_->getType()); pool->getCfgOption()->del(option->space_name_, option->option_->getType());
pool->getCfgOption()->add(*option, option->space_name_); pool->getCfgOption()->add(*option, option->space_name_);

View File

@ -561,29 +561,29 @@ TestConfigBackendDHCPv6::createUpdateOption6(const db::ServerSelector& server_se
auto tags = server_selector.getTags(); auto tags = server_selector.getTags();
auto not_in_tags = false; auto not_in_tags = false;
for (auto subnet : subnets_) { for (auto subnet : subnets_) {
// Get the pool: if it is not here we can directly go to the next subnet. // Get the pool: if it is not here we can directly go to the next subnet.
auto pool = subnet->getPool(Lease::TYPE_NA, pool_start_address); auto pool = subnet->getPool(Lease::TYPE_NA, pool_start_address);
if (!pool) { if (!pool) {
continue; continue;
} }
// Verify the subnet is in all or one of the given servers. // Verify the subnet is in all or one of the given servers.
if (!subnet->hasAllServerTag()) { if (!subnet->hasAllServerTag()) {
auto in_tags = false; auto in_tags = false;
for (auto tag : tags) { for (auto tag : tags) {
if (subnet->hasServerTag(ServerTag(tag))) { if (subnet->hasServerTag(ServerTag(tag))) {
in_tags = true; in_tags = true;
break; break;
} }
} }
if (!in_tags) { if (!in_tags) {
// Records the fact a subnet was found but not in a server. // Records the fact a subnet was found but not in a server.
not_in_tags = true; not_in_tags = true;
continue; continue;
} }
} }
// Update the option. // Update the option.
pool->getCfgOption()->del(option->space_name_, option->option_->getType()); pool->getCfgOption()->del(option->space_name_, option->option_->getType());
pool->getCfgOption()->add(*option, option->space_name_); pool->getCfgOption()->add(*option, option->space_name_);
@ -610,15 +610,15 @@ TestConfigBackendDHCPv6::createUpdateOption6(const db::ServerSelector& server_se
auto tags = server_selector.getTags(); auto tags = server_selector.getTags();
auto not_in_tags = false; auto not_in_tags = false;
for (auto subnet : subnets_) { for (auto subnet : subnets_) {
// Get the pd pool: if it is not here we can directly go to the next subnet. // Get the pd pool: if it is not here we can directly go to the next subnet.
auto pdpool = subnet->getPool(Lease::TYPE_PD, pd_pool_prefix); auto pdpool = subnet->getPool(Lease::TYPE_PD, pd_pool_prefix);
if (!pdpool) { if (!pdpool) {
continue; continue;
} }
// Verify the subnet is in all or one of the given servers. // Verify the subnet is in all or one of the given servers.
if (!subnet->hasAllServerTag()) { if (!subnet->hasAllServerTag()) {
auto in_tags = false; auto in_tags = false;
for (auto tag : tags) { for (auto tag : tags) {
if (subnet->hasServerTag(ServerTag(tag))) { if (subnet->hasServerTag(ServerTag(tag))) {
in_tags = true; in_tags = true;
@ -626,13 +626,13 @@ TestConfigBackendDHCPv6::createUpdateOption6(const db::ServerSelector& server_se
} }
} }
if (!in_tags) { if (!in_tags) {
// Records the fact a subnet was found but not in a server. // Records the fact a subnet was found but not in a server.
not_in_tags = true; not_in_tags = true;
continue; continue;
} }
} }
// Update the option. // Update the option.
pdpool->getCfgOption()->del(option->space_name_, option->option_->getType()); pdpool->getCfgOption()->del(option->space_name_, option->option_->getType());
pdpool->getCfgOption()->add(*option, option->space_name_); pdpool->getCfgOption()->add(*option, option->space_name_);