diff --git a/acc-external-testcases/data-sources/cloud.yaml b/acc-external-testcases/data-sources/cloud.yaml new file mode 100644 index 00000000..4e8dffaa --- /dev/null +++ b/acc-external-testcases/data-sources/cloud.yaml @@ -0,0 +1,6 @@ +acc: +- config: | + name = "External-Cloud" + validations: + json.zone.id: 2 + tf.id: 2 diff --git a/acc-external-testcases/data-sources/cloud_folder.yaml b/acc-external-testcases/data-sources/cloud_folder.yaml new file mode 100644 index 00000000..4fd23d50 --- /dev/null +++ b/acc-external-testcases/data-sources/cloud_folder.yaml @@ -0,0 +1,6 @@ +acc: +- config: | + name = "ExternalVMFolder" + cloud_id = 2 + validations: + json.folder.id: 11 diff --git a/acc-external-testcases/data-sources/datastore.yaml b/acc-external-testcases/data-sources/datastore.yaml new file mode 100644 index 00000000..33e5eacf --- /dev/null +++ b/acc-external-testcases/data-sources/datastore.yaml @@ -0,0 +1,4 @@ +acc: +- config: | + name = "glcicd-G2i-1-Bs-1" + cloud_id = 2 diff --git a/acc-external-testcases/data-sources/edge_cluster.yaml b/acc-external-testcases/data-sources/edge_cluster.yaml new file mode 100644 index 00000000..1219e169 --- /dev/null +++ b/acc-external-testcases/data-sources/edge_cluster.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "edge_cluster" \ No newline at end of file diff --git a/acc-external-testcases/data-sources/environment.yaml b/acc-external-testcases/data-sources/environment.yaml new file mode 100644 index 00000000..bdbbe7dc --- /dev/null +++ b/acc-external-testcases/data-sources/environment.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "dev" diff --git a/acc-external-testcases/data-sources/group.yaml b/acc-external-testcases/data-sources/group.yaml new file mode 100644 index 00000000..9066f9fd --- /dev/null +++ b/acc-external-testcases/data-sources/group.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "External-group2" diff --git a/acc-external-testcases/data-sources/layout.yaml b/acc-external-testcases/data-sources/layout.yaml new file mode 100644 index 00000000..ab1dce36 --- /dev/null +++ b/acc-external-testcases/data-sources/layout.yaml @@ -0,0 +1,4 @@ +acc: +- config: | + name = "Vmware VM" + instance_type_code = "vmware" diff --git a/acc-external-testcases/data-sources/load_balancer_ssl_ca_certs.yaml b/acc-external-testcases/data-sources/load_balancer_ssl_ca_certs.yaml new file mode 100644 index 00000000..95d24fe9 --- /dev/null +++ b/acc-external-testcases/data-sources/load_balancer_ssl_ca_certs.yaml @@ -0,0 +1,5 @@ +acc: +- config: | + name = "Test SSL Cert" + validations: + json.certificates.id: 8 \ No newline at end of file diff --git a/acc-external-testcases/data-sources/network.yaml b/acc-external-testcases/data-sources/network.yaml new file mode 100644 index 00000000..2ebad20c --- /dev/null +++ b/acc-external-testcases/data-sources/network.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "Dhcp-net1" diff --git a/acc-external-testcases/data-sources/network_interface.yaml b/acc-external-testcases/data-sources/network_interface.yaml new file mode 100644 index 00000000..f648ffb4 --- /dev/null +++ b/acc-external-testcases/data-sources/network_interface.yaml @@ -0,0 +1,6 @@ +acc: +- config: | + name = "VMXNET 3" + cloud_id = 2 + validations: + tf.id: 10 diff --git a/acc-external-testcases/data-sources/network_pool.yaml b/acc-external-testcases/data-sources/network_pool.yaml new file mode 100644 index 00000000..6a260909 --- /dev/null +++ b/acc-external-testcases/data-sources/network_pool.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "Post-pool" diff --git a/acc-external-testcases/data-sources/network_proxy.yaml b/acc-external-testcases/data-sources/network_proxy.yaml new file mode 100644 index 00000000..f697817c --- /dev/null +++ b/acc-external-testcases/data-sources/network_proxy.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "test-proxy" diff --git a/acc-external-testcases/data-sources/network_type.yaml b/acc-external-testcases/data-sources/network_type.yaml new file mode 100644 index 00000000..2352509b --- /dev/null +++ b/acc-external-testcases/data-sources/network_type.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "NSX Segment" diff --git a/acc-external-testcases/data-sources/nsx-tier1.yaml b/acc-external-testcases/data-sources/nsx-tier1.yaml new file mode 100644 index 00000000..654e305a --- /dev/null +++ b/acc-external-testcases/data-sources/nsx-tier1.yaml @@ -0,0 +1,5 @@ +acc: +- config: | + name = "tf-dont-delete" + validations: + json.networkRouter.providerId: "/infra/tier-1s/9c995f68-f873-42f0-bb1b-8c5021c8f64a" \ No newline at end of file diff --git a/acc-external-testcases/data-sources/plan.yaml b/acc-external-testcases/data-sources/plan.yaml new file mode 100644 index 00000000..4a846606 --- /dev/null +++ b/acc-external-testcases/data-sources/plan.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "G2i-small" diff --git a/acc-external-testcases/data-sources/power_schedule.yaml b/acc-external-testcases/data-sources/power_schedule.yaml new file mode 100644 index 00000000..fe9cbd36 --- /dev/null +++ b/acc-external-testcases/data-sources/power_schedule.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "power-schedule" diff --git a/acc-external-testcases/data-sources/resource_pool.yaml b/acc-external-testcases/data-sources/resource_pool.yaml new file mode 100644 index 00000000..fedace0d --- /dev/null +++ b/acc-external-testcases/data-sources/resource_pool.yaml @@ -0,0 +1,4 @@ +acc: +- config: | + name = "ExternalResourcePool" + cloud_id = 2 diff --git a/acc-external-testcases/data-sources/template.yaml b/acc-external-testcases/data-sources/template.yaml new file mode 100644 index 00000000..3ac90497 --- /dev/null +++ b/acc-external-testcases/data-sources/template.yaml @@ -0,0 +1,3 @@ +acc: +- config: | + name = "External-Centos" diff --git a/acc-external-testcases/resources/instance-template_err.yaml b/acc-external-testcases/resources/instance-template_err.yaml new file mode 100644 index 00000000..2a227cae --- /dev/null +++ b/acc-external-testcases/resources/instance-template_err.yaml @@ -0,0 +1,28 @@ +vars: + rand_name_1: tf_acc_%rand_int + rand_storage_1: "%rand_int{5,8}" +acc: +- config: | + name = "$(rand_name_1)" + cloud_id = 1 + group_id = 2 + layout_id = 113 + plan_id = 407 + instance_type_code = "vmware" + network { + id = 3 + } + volume { + name = "root_vol" + datastore_id = "auto" + size = $(rand_storage_1) + } + config { + resource_pool_id = 2 + no_agent = true + folder_code = "group-v284" + } + scale = 1 + validations: + tf.status: "running" + expect_error: ".*template.*" diff --git a/acc-external-testcases/resources/instance.yaml b/acc-external-testcases/resources/instance.yaml new file mode 100644 index 00000000..f7ffee1f --- /dev/null +++ b/acc-external-testcases/resources/instance.yaml @@ -0,0 +1,27 @@ +vars: + instance_name: tf_external_acc_%rand_int + rand_storage_1: "%rand_int{5,8}" +acc: +- config: | + name = "$(instance_name)" + cloud_id = 2 + group_id = 29 + layout_id = 415 + plan_id = 877 + instance_type_code = "vmware" + network { + id = 119 + } + volume { + name = "root_vol" + datastore_id = "auto" + size = $(rand_storage_1) + } + config { + resource_pool_id = 14 + template_id = 5069 + folder_code = "group-v7199" + } + scale = 1 + validations: + tf.status: "running" diff --git a/acc-external-testcases/resources/instance_clone.yaml b/acc-external-testcases/resources/instance_clone.yaml new file mode 100644 index 00000000..8ed3d868 --- /dev/null +++ b/acc-external-testcases/resources/instance_clone.yaml @@ -0,0 +1,9 @@ +vars: + instance_name: tf_external_acc_clone_%rand_int +acc: +- config: | + source_instance_id = 476 + name = "$(instance_name)" + network { + id = 119 + } diff --git a/go.mod b/go.mod index 3c796a21..88c270dd 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/HewlettPackard/hpegl-vmaas-terraform-resources go 1.21 require ( - github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.9 + github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.10 github.com/golang/mock v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-docs v0.9.0 diff --git a/go.sum b/go.sum index 7703457c..6177d751 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.9 h1:SjJgSnyD1XXAHy6kExOYTFiwAaAmBwvj/0BA+e+AyeA= -github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.9/go.mod h1:UzXizYR6sUVsvDRMcLC2E4eabJsPH/3nM8rlKL2BLSc= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.10 h1:RLRtdCjl12eunpAxSNrlUJTGFALbDR0lmZuW/ICbiOQ= +github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.10/go.mod h1:UzXizYR6sUVsvDRMcLC2E4eabJsPH/3nM8rlKL2BLSc= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=