|
| 1 | +package oracledatabase_test |
| 2 | + |
| 3 | +import ( |
| 4 | + "fmt" |
| 5 | + "testing" |
| 6 | + |
| 7 | + "github.com/hashicorp/terraform-plugin-testing/helper/resource" |
| 8 | + "github.com/hashicorp/terraform-provider-google/google/acctest" |
| 9 | +) |
| 10 | + |
| 11 | +func TestAccOracleDatabaseCloudVmCluster_basic(t *testing.T) { |
| 12 | + t.Parallel() |
| 13 | + acctest.VcrTest(t, resource.TestCase{ |
| 14 | + PreCheck: func() { acctest.AccTestPreCheck(t) }, |
| 15 | + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), |
| 16 | + Steps: []resource.TestStep{ |
| 17 | + { |
| 18 | + Config: testAccOracleDatabaseCloudVmCluster_basic(), |
| 19 | + Check: resource.ComposeTestCheckFunc( |
| 20 | + resource.TestCheckResourceAttrSet("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "display_name"), |
| 21 | + resource.TestCheckResourceAttrSet("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "exadata_infrastructure"), |
| 22 | + resource.TestCheckResourceAttrSet("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "cidr"), |
| 23 | + resource.TestCheckResourceAttrSet("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "properties.#"), |
| 24 | + resource.TestCheckResourceAttrSet("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "properties.0.cpu_core_count"), |
| 25 | + resource.TestCheckResourceAttrSet("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "properties.0.cluster_name"), |
| 26 | + resource.TestCheckResourceAttr("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "gcp_oracle_zone", "us-east4-b-r1"), |
| 27 | + resource.TestCheckResourceAttr("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "properties.0.node_count", "2"), |
| 28 | + resource.TestCheckResourceAttr("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "properties.0.state", "AVAILABLE"), |
| 29 | + resource.TestCheckResourceAttr("data.google_oracle_database_cloud_vm_cluster.my-vmcluster", "properties.0.shape", "Exadata.X9M"), |
| 30 | + ), |
| 31 | + }, |
| 32 | + }, |
| 33 | + }) |
| 34 | +} |
| 35 | + |
| 36 | +func testAccOracleDatabaseCloudVmCluster_basic() string { |
| 37 | + return fmt.Sprintf(` |
| 38 | +data "google_oracle_database_cloud_vm_cluster" "my-vmcluster"{ |
| 39 | + cloud_vm_cluster_id = "ofake-do-not-delete-tf-vmcluster" |
| 40 | + project = "oci-terraform-testing" |
| 41 | + location = "us-east4" |
| 42 | +} |
| 43 | +`) |
| 44 | +} |
0 commit comments