Skip to content

Commit 3c84b61

Browse files
author
hellertang
authored
fix testcases (#996)
1 parent 94b238d commit 3c84b61

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

tencentcloud/basic_test.go

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ const (
5555
defaultVpcCidr = "172.16.0.0/16"
5656
defaultVpcCidrLess = "172.16.0.0/18"
5757

58+
defaultCvmAZone = "ap-guangzhou-7"
59+
defaultCvmVpcId = "vpc-l0dw94uh"
60+
defaultCvmSubnetId = "subnet-ccj2qg0m"
61+
5862
defaultAZone = "ap-guangzhou-3"
5963
defaultSubnetId = "subnet-enm92y0m"
6064
defaultSubnetCidr = "172.16.0.0/20"
@@ -124,6 +128,18 @@ variable "availability_zone" {
124128
default = "` + defaultAZone + `"
125129
}
126130
131+
variable "availability_cvm_zone" {
132+
default = "` + defaultCvmAZone + `"
133+
}
134+
135+
variable "cvm_vpc_id" {
136+
default = "` + defaultCvmVpcId + `"
137+
}
138+
139+
variable "cvm_subnet_id" {
140+
default = "` + defaultCvmSubnetId + `"
141+
}
142+
127143
variable "vpc_id" {
128144
default = "` + defaultVpcId + `"
129145
}
@@ -163,7 +179,10 @@ data "tencentcloud_instance_types" "default" {
163179
name = "instance-family"
164180
values = ["S6"]
165181
}
166-
182+
filter {
183+
name = "zone"
184+
values = [var.availability_cvm_zone]
185+
}
167186
cpu_core_count = 2
168187
memory_size = 2
169188
}
@@ -266,15 +285,15 @@ locals {
266285
const instanceCommonTestCase = defaultInstanceVariable + `
267286
resource "tencentcloud_instance" "default" {
268287
instance_name = var.instance_name
269-
availability_zone = data.tencentcloud_availability_zones.default.zones.0.name
288+
availability_zone = var.availability_cvm_zone
270289
image_id = data.tencentcloud_images.default.images.1.image_id
271290
instance_type = data.tencentcloud_instance_types.default.instance_types.0.instance_type
272291
system_disk_type = "CLOUD_PREMIUM"
273292
system_disk_size = 50
274293
allocate_public_ip = true
275294
internet_max_bandwidth_out = 10
276-
vpc_id = var.vpc_id
277-
subnet_id = var.subnet_id
295+
vpc_id = var.cvm_vpc_id
296+
subnet_id = var.cvm_subnet_id
278297
}
279298
`
280299

tencentcloud/resource_tc_dnat_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ resource "tencentcloud_eip" "eip_test_dnat" {
174174
175175
# Create NAT Gateway
176176
resource "tencentcloud_nat_gateway" "my_nat" {
177-
vpc_id = var.vpc_id
177+
vpc_id = var.cvm_vpc_id
178178
name = var.instance_name
179179
max_concurrent = 3000000
180180
bandwidth = 500

0 commit comments

Comments
 (0)