Skip to content

Commit

Permalink
test: modify tencentcloud_cvm_reboot_instance test
Browse files Browse the repository at this point in the history
  • Loading branch information
yhlooo committed Jun 12, 2024
1 parent c4543be commit cbe75b8
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions tencentcloud/services/cvm/resource_tc_cvm_reboot_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,42 @@ func TestAccTencentCloudCvmRebootInstanceResource_basic(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccCvmRebootInstance,
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_cvm_reboot_instance.reboot_instance", "id")),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("tencentcloud_cvm_reboot_instance.reboot", "id"),
),
},
},
})
}

const testAccCvmRebootInstance = tcacctest.DefaultRebootCvmVariable + `
const testAccCvmRebootInstance = `
data "tencentcloud_images" "default" {
image_type = ["PUBLIC_IMAGE"]
image_name_regex = "Final"
}
data "tencentcloud_instance_types" "default" {
memory_size = 2
exclude_sold_out = true
filter {
name = "instance-family"
values = ["SA2","SA3","SA4","SA5","S2","S3"]
}
filter {
name = "zone"
values = ["ap-guangzhou-7"]
}
cpu_core_count = 2
}
resource "tencentcloud_instance" "test_cvm" {
image_id = data.tencentcloud_images.default.images.0.image_id
availability_zone = "ap-guangzhou-7"
instance_type = "SA2.MEDIUM2"
orderly_security_groups = ["sg-5275dorp"]
instance_charge_type = "POSTPAID_BY_HOUR"
}
resource "tencentcloud_cvm_reboot_instance" "reboot_instance" {
instance_id = var.cvm_id
stop_type = "SOFT_FIRST"
resource tencentcloud_cvm_reboot_instance reboot {
instance_id = tencentcloud_instance.test_cvm.id
stop_type = "SOFT"
}
`

0 comments on commit cbe75b8

Please sign in to comment.