terraform-openstack-landing.../tests/two_tier.tftest.hcl
Bertrand Lanson 19c2032afa
Some checks failed
development / Check commit compliance (push) Successful in 4s
pull-requests-open / Check commit compliance (pull_request) Successful in 5s
pull-requests-open / Check pre-commit status (pull_request) Successful in 13s
pull-requests-open / Run E2E tofu tests (pull_request) Failing after 16s
ci: fix unauthorized issue on e2e testS
2024-09-09 20:54:43 +02:00

61 lines
2.2 KiB
HCL

run "two_tier" {
module {
source = "./tests/module"
}
variables {
project_domain = "default"
project_tags = ["cloud", "test", "tofu"]
architecture_tiers = 2
create_application_subnetpool = true
application_subnetpool_cidr_blocks = ["10.10.128.0/17"]
create_database_subnetpool = false
frontend_subnet_prefix_len = 24
backend_subnet_prefix_len = 24
public_nameservers = ["9.9.9.9", "9.9.9.10"]
create_default_secgroups = true
database_secgroup_strict = false
attach_to_external = true
}
assert {
condition = alltrue([for i in module.landing_zone.apps_subnetpool[0].prefixes : can(cidrhost(i, 0))])
error_message = "The application subnetpool does not seem correct"
}
assert {
condition = module.landing_zone.database_subnetpool == null
error_message = "The database subnetpool is not null"
}
assert {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", module.landing_zone.frontend_network[0].id))
error_message = "The frontend network was not created successfully"
}
assert {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", module.landing_zone.backend_network[0].id))
error_message = "The backend network was not created successfully"
}
assert {
condition = module.landing_zone.database_network == null
error_message = "The database network is not null"
}
assert {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", module.landing_zone.frontend_subnet[0].id))
error_message = "The frontend subnet was not created successfully"
}
assert {
condition = can(regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", module.landing_zone.backend_subnet[0].id))
error_message = "The backend subnet was not created successfully"
}
assert {
condition = module.landing_zone.database_subnet == null
error_message = "The database subnet is not null"
}
}