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