-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90174fe
commit 0238e09
Showing
2 changed files
with
225 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
variables { | ||
location = "eastus2" | ||
} | ||
|
||
run "prefix_length_too_short" { | ||
|
||
command = plan | ||
|
||
variables { | ||
prefix = "ba" | ||
} | ||
|
||
expect_failures = [ | ||
var.prefix, | ||
] | ||
} | ||
|
||
run "prefix_disallowed_char" { | ||
|
||
command = plan | ||
|
||
variables { | ||
prefix = "foo*" | ||
} | ||
|
||
expect_failures = [ | ||
var.prefix, | ||
] | ||
} | ||
|
||
run "prefix_dissallowed_uppercase" { | ||
|
||
command = plan | ||
|
||
variables { | ||
prefix = "Foobar" | ||
} | ||
|
||
expect_failures = [ | ||
var.prefix, | ||
] | ||
} | ||
|
||
run "prefix_cannot_start_with_dash" { | ||
|
||
command = plan | ||
|
||
variables { | ||
prefix = "-bar" | ||
} | ||
|
||
expect_failures = [ | ||
var.prefix, | ||
] | ||
} | ||
|
||
run "prefix_cannot_end_with_dash" { | ||
|
||
command = plan | ||
|
||
variables { | ||
prefix = "ba-" | ||
} | ||
|
||
expect_failures = [ | ||
var.prefix, | ||
] | ||
} | ||
|
||
run "prefix_length_ok_internal_dash" { | ||
|
||
command = plan | ||
|
||
variables { | ||
prefix = "my-prefix" | ||
} | ||
} | ||
|
||
|
||
run "prefix_length_ok_with_number" { | ||
|
||
command = plan | ||
|
||
variables { | ||
prefix = "my-prefix21" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
|
||
variables { | ||
location = "eastus2" | ||
prefix = "foobar" | ||
} | ||
|
||
run "default_cluster_sku_tier" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.aks_cluster_sku_tier == "Free" | ||
error_message = "A default value of \"${var.aks_cluster_sku_tier}\" for aks_cluster_sku_tier was not expected." | ||
} | ||
} | ||
|
||
run "default_cluster_support_tier" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.cluster_support_tier == "KubernetesOfficial" | ||
error_message = "A default value of \"${var.cluster_support_tier}\" for aks_cluster_support_tier was not expected." | ||
} | ||
} | ||
|
||
run "aks_network_plugin" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.aks_network_plugin == "kubenet" | ||
error_message = "A default value of \"${var.aks_network_plugin}\" for aks_network_plugin was not expected." | ||
} | ||
} | ||
|
||
run "cluster_egress_type" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.cluster_egress_type != null ? var.cluster_egress_type == "loadBalancer" : false | ||
error_message = "A default value of \"${var.cluster_egress_type != null ? var.cluster_egress_type : "null"}\" for cluster_egress_type was not expected." | ||
} | ||
|
||
# "${var.my_var != null ? var.my_var : "default value"}" | ||
|
||
} | ||
|
||
run "storage_type" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.storage_type == "standard" | ||
error_message = "A default value of \"${var.storage_type}\" for storage_type was not expected." | ||
} | ||
} | ||
|
||
run "netapp_size_in_tb" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.netapp_size_in_tb != null ? var.netapp_size_in_tb == 4 : false | ||
error_message = "A default value of \"${var.netapp_size_in_tb}\" for netapp_size_in_tb was not expected." | ||
} | ||
} | ||
|
||
run "netapp_network_features" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.netapp_network_features != null ? var.netapp_network_features == "Basic" : false | ||
error_message = "A default value of \"${var.netapp_network_features != null ? var.netapp_network_features : "null"}\" for netapp_network_features was not expected." | ||
} | ||
} | ||
|
||
run "metrics_category" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.metric_category.0 == "AllMetrics" | ||
error_message = "A default value of \"${var.metric_category.0}\" for metrics_category was not expected." | ||
} | ||
} | ||
|
||
run "cluster_api_mode" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.cluster_api_mode == "public" | ||
error_message = "A default value of \"${var.cluster_api_mode}\" for cluster_api_mode was not expected." | ||
} | ||
} | ||
|
||
run "aks_identity" { | ||
|
||
command = plan | ||
|
||
variables { | ||
} | ||
|
||
assert { | ||
condition = var.aks_identity == "uai" | ||
error_message = "A default value of \"${var.aks_identity}\" for aks_identity was not expected." | ||
} | ||
} |