diff --git a/tests/networking/private-cloud-function-from-onprem/__init__.py b/tests/networking/private-cloud-function-from-onprem/__init__.py new file mode 100644 index 000000000..d46dbae5e --- /dev/null +++ b/tests/networking/private-cloud-function-from-onprem/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2021 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/networking/private-cloud-function-from-onprem/fixture/main.tf b/tests/networking/private-cloud-function-from-onprem/fixture/main.tf new file mode 100644 index 000000000..d61c47e24 --- /dev/null +++ b/tests/networking/private-cloud-function-from-onprem/fixture/main.tf @@ -0,0 +1,23 @@ +/** + * Copyright 2021 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. + */ + +module "test" { + source = "../../../../networking/private-cloud-function-from-onprem" + billing_account_id = var.billing_account_id + projects_id = var.projects_id + root_node = var.root_node + cloud_function_gcs_bucket = var.cloud_function_gcs_bucket +} diff --git a/tests/networking/private-cloud-function-from-onprem/fixture/variables.tf b/tests/networking/private-cloud-function-from-onprem/fixture/variables.tf new file mode 100644 index 000000000..db042fee1 --- /dev/null +++ b/tests/networking/private-cloud-function-from-onprem/fixture/variables.tf @@ -0,0 +1,39 @@ +# Copyright 2021 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. + +variable "billing_account_id" { + type = string + default = "ABCDE-12345-ABCDE" +} + +variable "projects_id" { + type = object({ + onprem = string + function = string + }) + default = { + onprem = "onprem-project-id" + function = "function-project-id" + } +} + +variable "root_node" { + type = string + default = "organizations/0123456789" +} + +variable cloud_function_gcs_bucket { + type = string + default = "stanging-gcs-bucket" +} \ No newline at end of file diff --git a/tests/networking/private-cloud-function-from-onprem/test_plan.py b/tests/networking/private-cloud-function-from-onprem/test_plan.py new file mode 100644 index 000000000..d367412ef --- /dev/null +++ b/tests/networking/private-cloud-function-from-onprem/test_plan.py @@ -0,0 +1,27 @@ +# Copyright 2021 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. + + +import os +import pytest + + +FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixture') + + +def test_resources(e2e_plan_runner): + "Test that plan works and the numbers of resources is as expected." + modules, resources = e2e_plan_runner(FIXTURES_DIR) + assert len(modules) == 10 + assert len(resources) == 41