Skip to content

Commit

Permalink
Merge pull request #18 from Qumulo/az_tests
Browse files Browse the repository at this point in the history
Add single AZ test
  • Loading branch information
andre-qumulo authored Dec 2, 2022
2 parents 33d66e1 + 8bc782a commit 1998fa1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions terraform_tests.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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 *****
Expand Down Expand Up @@ -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 *****
Expand Down
29 changes: 26 additions & 3 deletions tests/test_terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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"]),
},
Expand All @@ -85,6 +85,29 @@ 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],
"q_node_count": 4,
},
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()
2 changes: 1 addition & 1 deletion tests/vpc-terraform/terraform_multi_az.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 1998fa1

Please sign in to comment.