From 327c5e053fec941da3360479d306ce923591ee8e Mon Sep 17 00:00:00 2001 From: Luca Prete Date: Mon, 27 Feb 2023 14:29:34 +0100 Subject: [PATCH] Comply with the new tests --- .../glb-hybrid-neg-internal/README.md | 14 +++ .../glb-hybrid-neg-internal/__init__.py | 13 -- .../glb-hybrid-neg-internal/fixture/main.tf | 20 ---- .../fixture/variables.tf | 111 ------------------ .../glb-hybrid-neg-internal/test_plan.py | 19 --- 5 files changed, 14 insertions(+), 163 deletions(-) delete mode 100644 tests/blueprints/networking/glb-hybrid-neg-internal/__init__.py delete mode 100644 tests/blueprints/networking/glb-hybrid-neg-internal/fixture/main.tf delete mode 100644 tests/blueprints/networking/glb-hybrid-neg-internal/fixture/variables.tf delete mode 100644 tests/blueprints/networking/glb-hybrid-neg-internal/test_plan.py diff --git a/blueprints/networking/glb-hybrid-neg-internal/README.md b/blueprints/networking/glb-hybrid-neg-internal/README.md index b87364f8c4..77022e368b 100644 --- a/blueprints/networking/glb-hybrid-neg-internal/README.md +++ b/blueprints/networking/glb-hybrid-neg-internal/README.md @@ -87,3 +87,17 @@ At the moment, every time a user changes the configuration of a NEG, the NEG is | [glb_ip_address](outputs.tf#L17) | Load balancer IP address. | | + +## Test +```hcl +module "test" { + source = "./fabric/blueprints/networking/glb-hybrid-neg-internal" + prefix = "prefix" + projects_create = { + billing_account_id = "123456-123456-123456" + parent = "folders/123456789" + } +} + +# tftest modules=21 resources=64 +``` diff --git a/tests/blueprints/networking/glb-hybrid-neg-internal/__init__.py b/tests/blueprints/networking/glb-hybrid-neg-internal/__init__.py deleted file mode 100644 index 7ba50f9339..0000000000 --- a/tests/blueprints/networking/glb-hybrid-neg-internal/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/networking/glb-hybrid-neg-internal/fixture/main.tf b/tests/blueprints/networking/glb-hybrid-neg-internal/fixture/main.tf deleted file mode 100644 index d52d039dec..0000000000 --- a/tests/blueprints/networking/glb-hybrid-neg-internal/fixture/main.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module "test" { - source = "../../../../../blueprints/networking/glb-hybrid-neg-internal" - prefix = var.prefix - projects_create = var.projects_create - project_names = var.project_names -} diff --git a/tests/blueprints/networking/glb-hybrid-neg-internal/fixture/variables.tf b/tests/blueprints/networking/glb-hybrid-neg-internal/fixture/variables.tf deleted file mode 100644 index b7fea04cca..0000000000 --- a/tests/blueprints/networking/glb-hybrid-neg-internal/fixture/variables.tf +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -variable "prefix" { - description = "Prefix used for resource names." - type = string - default = "test" -} - -variable "projects_create" { - description = "Parameters for the creation of the new project." - type = object({ - billing_account_id = string - parent = string - }) - default = { - billing_account_id = "123456789" - parent = "organizations/123456789" - } -} - -variable "project_names" { - description = "The project names." - type = object({ - landing = string - spoke_01 = string - }) - default = { - landing = "landing" - spoke_01 = "spoke-01" - } -} - -variable "region_configs" { - description = "The primary and secondary region parameters." - type = object({ - r1 = object({ - region_name = string - zone = string - }) - r2 = object({ - region_name = string - zone = string - }) - }) - default = { - r1 = { - region_name = "europe-west1" - zone = "europe-west1-b" - } - r2 = { - region_name = "europe-west2" - zone = "europe-west2-b" - } - } -} - -variable "test_vms_behind_ilb" { - description = "Whether there should be an ILB L4 in front of the test VMs in the spoke." - type = string - default = false -} - -variable "vpc_landing_untrusted_config" { - description = "The configuration of the landing untrusted VPC" - type = object({ - r1_cidr = string - r2_cidr = string - }) - default = { - r1_cidr = "192.168.1.0/24", - r2_cidr = "192.168.2.0/24" - } -} - -variable "vpc_landing_trusted_config" { - description = "The configuration of the landing trusted VPC" - type = object({ - r1_cidr = string - r2_cidr = string - }) - default = { - r1_cidr = "192.168.11.0/24", - r2_cidr = "192.168.22.0/24" - } -} - -variable "vpc_spoke_config" { - description = "The configuration of the spoke-01 VPC" - type = object({ - r1_cidr = string - r2_cidr = string - }) - default = { - r1_cidr = "192.168.101.0/24", - r2_cidr = "192.168.102.0/24" - } -} diff --git a/tests/blueprints/networking/glb-hybrid-neg-internal/test_plan.py b/tests/blueprints/networking/glb-hybrid-neg-internal/test_plan.py deleted file mode 100644 index 998a058736..0000000000 --- a/tests/blueprints/networking/glb-hybrid-neg-internal/test_plan.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -def test_resources(e2e_plan_runner): - "Test that plan works and the numbers of resources is as expected." - modules, resources = e2e_plan_runner() - assert len(modules) == 20 - assert len(resources) == 64