From bd1a6df124b2dd061172c79a78da4f29988ef19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gagn=C3=A9?= Date: Fri, 2 Dec 2022 08:35:22 -0800 Subject: [PATCH 1/3] Add single az test --- tests/test_terraform.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/test_terraform.py b/tests/test_terraform.py index b69b717..f0fea41 100644 --- a/tests/test_terraform.py +++ b/tests/test_terraform.py @@ -63,12 +63,12 @@ def setUpClass(cls): cls.vpc_executor.deploy() cls.outputs = cls.vpc_executor.output() - def test_happy_path(self): + def test_multi_az_min_path(self): executor = TerraformExecutor( terraform_workspace="test", terraform_vars_file="terraform_tests.tfvars", terraform_vars={ - "deployment_name": f"cloud-q-test-{uuid.uuid4()}"[:32], + "deployment_name": f"cloud-q-test-multi-az-{uuid.uuid4()}"[:32], "aws_vpc_id": self.outputs["vpc_id"], "private_subnet_id": ",".join(self.outputs["private_subnet_ids"]), }, @@ -85,6 +85,28 @@ def test_happy_path(self): finally: executor.destroy() + def test_single_az_min_path(self): + executor = TerraformExecutor( + terraform_workspace="test", + terraform_vars_file="terraform_tests.tfvars", + terraform_vars={ + "deployment_name": f"cloud-q-test-single-az-{uuid.uuid4()}"[:32], + "aws_vpc_id": self.outputs["vpc_id"], + "private_subnet_id": self.outputs["private_subnet_ids"][0], + }, + module_path=".", + log_level=TerraformLogLevel.INFO, + ) + try: + results = executor.deploy() + self.assertEqual( + 0, + results.returncode, + msg=f"Deployment was not successful, check the session output", + ) + finally: + executor.destroy() + @classmethod def tearDownClass(cls): cls.vpc_executor.destroy() From e102ec29bfafa6eb4b34c1e7838294a502c6176d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gagn=C3=A9?= Date: Fri, 2 Dec 2022 08:37:51 -0800 Subject: [PATCH 2/3] Change foundation test execution id --- tests/test_terraform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_terraform.py b/tests/test_terraform.py index f0fea41..20be2f4 100644 --- a/tests/test_terraform.py +++ b/tests/test_terraform.py @@ -31,7 +31,7 @@ def test_happy_path(self): executor = TerraformExecutor( terraform_workspace="test", terraform_vars_file="terraform_single_az.tfvars", - terraform_vars={"execution_id": str(uuid.uuid4())}, + terraform_vars={"execution_id": f"foundation-test-{uuid.uuid4()}"[:32]}, module_path="tests/vpc-terraform", log_level=TerraformLogLevel.INFO, ) From 8bc782a3f220d560d2566699e6c5beb9f81ecba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gagn=C3=A9?= Date: Fri, 2 Dec 2022 10:56:17 -0800 Subject: [PATCH 3/3] Make terraform work for single AZ --- terraform_tests.tfvars | 4 ++-- tests/test_terraform.py | 1 + tests/vpc-terraform/terraform_multi_az.tfvars | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/terraform_tests.tfvars b/terraform_tests.tfvars index 8b698bc..0cb08a2 100644 --- a/terraform_tests.tfvars +++ b/terraform_tests.tfvars @@ -27,7 +27,7 @@ term_protection = false q_cluster_admin_password = "!MyPwd123" q_cluster_name = "Cloud-Q" q_cluster_version = "5.1.0.1" -q_instance_type = "m5.2xlarge" +q_instance_type = "m5.xlarge" q_marketplace_type = "1TB-Usable-All-Flash" # ***** Qumulo Sidecar Variables ***** @@ -66,7 +66,7 @@ q_nodes_per_az = 1 # tags - Additional tags to add to all created resources. Often used for billing, departmental tracking, chargeback, etc. # If you add an additional tag with the key 'Name' it will be ignored. All infrastructure is tagged with the 'Name=deployment_unique_name'. # Example: tags = { "key1" = "value1", "key2" = "value2" } -dev_environment = false +dev_environment = true tags = null # ***** Qumulo Cluster Misc Options ***** diff --git a/tests/test_terraform.py b/tests/test_terraform.py index 20be2f4..55eabc3 100644 --- a/tests/test_terraform.py +++ b/tests/test_terraform.py @@ -93,6 +93,7 @@ def test_single_az_min_path(self): "deployment_name": f"cloud-q-test-single-az-{uuid.uuid4()}"[:32], "aws_vpc_id": self.outputs["vpc_id"], "private_subnet_id": self.outputs["private_subnet_ids"][0], + "q_node_count": 4, }, module_path=".", log_level=TerraformLogLevel.INFO, diff --git a/tests/vpc-terraform/terraform_multi_az.tfvars b/tests/vpc-terraform/terraform_multi_az.tfvars index 7f0ddc2..ba7e1c9 100644 --- a/tests/vpc-terraform/terraform_multi_az.tfvars +++ b/tests/vpc-terraform/terraform_multi_az.tfvars @@ -20,6 +20,6 @@ #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #SOFTWARE. -vpc_cidr = "10.0.0.0/24" +vpc_cidr = "10.0.0.0/16" private_azs = ["us-west-2a", "us-west-2b", "us-west-2c", "us-west-2d"] public_azs = ["us-west-2a", "us-west-2b", "us-west-2c", "us-west-2d"] \ No newline at end of file