Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions tencentcloud/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,18 +996,20 @@ variable "cynosdb_cluster_security_group_id" {

// TSF
const (
defaultNamespaceId = "namespace-aemrg36v"
defaultTsfApplicationId = "application-a24x29xv"
defaultTsfClustId = "cluster-vwgj5e6y"
defaultTsfGroupId = "group-yrjkln9v"
defaultTsfGateway = "gw-ins-lvdypq5k"
defaultTsfDestNamespaceId = "namespace-aemrg36v"
defaultTsfConfigId = "dcfg-y54wzk3a"
defaultTsfApiId = "api-j03q029a"
defaultTsfGWGroupId = "group-vzd97zpy"
defaultTsfFileConfigId = "dcfg-f-ab6l9x5y"
defaultTsfImageId = "img-7r9vq8wd"
defaultTsfGWNamespaceId = "namespace-vwgo38wy"
defaultNamespaceId = "namespace-aemrg36v"
defaultTsfApplicationId = "application-a24x29xv"
defaultTsfClustId = "cluster-vwgj5e6y"
defaultTsfGroupId = "group-yrjkln9v"
defaultTsfGateway = "gw-ins-lvdypq5k"
defaultTsfDestNamespaceId = "namespace-aemrg36v"
defaultTsfConfigId = "dcfg-y54wzk3a"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

怎么这么多预置资源?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是一套资源,里面不同的参数

defaultTsfApiId = "api-j03q029a"
defaultTsfGWGroupId = "group-vzd97zpy"
defaultTsfFileConfigId = "dcfg-f-ab6l9x5y"
defaultTsfImageId = "img-7r9vq8wd"
defaultTsfGWNamespaceId = "namespace-vwgo38wy"
defaultTsfContainerGroupId = "group-y43x5jpa"
defaultTsfpodName = "keep-terraform-7f4874bc5c-w75q4"
)

// End of TSF
Expand Down
16 changes: 13 additions & 3 deletions tencentcloud/data_source_tc_tsf_pod_instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,21 @@ func TestAccTencentCloudTsfPodInstancesDataSource_basic(t *testing.T) {
})
}

const testAccTsfPodInstancesDataSource = `
const testAccTsfPodInstancesDataSourceVar = `
variable "group_id" {
default = "` + defaultTsfContainerGroupId + `"
}

variable "pod_name" {
default = "` + defaultTsfpodName + `"
}
`

const testAccTsfPodInstancesDataSource = testAccTsfPodInstancesDataSourceVar + `

data "tencentcloud_tsf_pod_instances" "pod_instances" {
group_id = "group-ynd95rea"
pod_name_list = ["keep-terraform-6f8f977688-zvphm"]
group_id = var.group_id
pod_name_list = [var.pod_name]
}

`
37 changes: 31 additions & 6 deletions tencentcloud/resource_tc_redis_ssl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestAccTencentCloudRedisSslResource_basic(t *testing.T) {
Config: testAccRedisSsl,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("tencentcloud_redis_ssl.ssl", "id"),
resource.TestCheckResourceAttr("tencentcloud_redis_ssl.ssl", "instance_id", defaultCrsInstanceId),
resource.TestCheckResourceAttrSet("tencentcloud_redis_ssl.ssl", "instance_id"),
resource.TestCheckResourceAttr("tencentcloud_redis_ssl.ssl", "ssl_config", "enabled"),
),
},
Expand All @@ -32,7 +32,7 @@ func TestAccTencentCloudRedisSslResource_basic(t *testing.T) {
Config: testAccRedisSslUpdate,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("tencentcloud_redis_ssl.ssl", "id"),
resource.TestCheckResourceAttr("tencentcloud_redis_ssl.ssl", "instance_id", defaultCrsInstanceId),
resource.TestCheckResourceAttrSet("tencentcloud_redis_ssl.ssl", "instance_id"),
resource.TestCheckResourceAttr("tencentcloud_redis_ssl.ssl", "ssl_config", "disabled"),
),
},
Expand All @@ -41,15 +41,40 @@ func TestAccTencentCloudRedisSslResource_basic(t *testing.T) {
}

const testAccRedisSslVar = `
variable "instance_id" {
default = "` + defaultCrsInstanceId + `"
data "tencentcloud_redis_zone_config" "zone" {
type_id = 7
}

resource "tencentcloud_vpc" "vpc" {
cidr_block = "10.0.0.0/16"
name = "tf_redis_vpc"
}

resource "tencentcloud_subnet" "subnet" {
vpc_id = tencentcloud_vpc.vpc.id
availability_zone = data.tencentcloud_redis_zone_config.zone.list[1].zone
name = "tf_redis_subnet"
cidr_block = "10.0.1.0/24"
}

resource "tencentcloud_redis_instance" "foo" {
availability_zone = data.tencentcloud_redis_zone_config.zone.list[1].zone
type_id = data.tencentcloud_redis_zone_config.zone.list[1].type_id
password = "test12345789"
mem_size = 8192
redis_shard_num = data.tencentcloud_redis_zone_config.zone.list[1].redis_shard_nums[0]
redis_replicas_num = data.tencentcloud_redis_zone_config.zone.list[1].redis_replicas_nums[0]
name = "terrform_test"
port = 6379
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.subnet.id
}
`

const testAccRedisSsl = testAccRedisSslVar + `

resource "tencentcloud_redis_ssl" "ssl" {
instance_id = var.instance_id
instance_id = tencentcloud_redis_instance.foo.id
ssl_config = "enabled"
}

Expand All @@ -58,7 +83,7 @@ resource "tencentcloud_redis_ssl" "ssl" {
const testAccRedisSslUpdate = testAccRedisSslVar + `

resource "tencentcloud_redis_ssl" "ssl" {
instance_id = var.instance_id
instance_id = tencentcloud_redis_instance.foo.id
ssl_config = "disabled"
}

Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/resource_tc_redis_switch_master_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// go test -i; go test -test.run TestAccTencentCloudRedisSwitchMasterResource_basic -v
func TestAccTencentCloudRedisSwitchMasterResource_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/resource_tc_tse_cngw_route_rate_limit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// go test -i; go test -test.run TestAccTencentCloudTseCngwRouteRateLimitResource_basic -v
func TestAccTencentCloudTseCngwRouteRateLimitResource_basic(t *testing.T) {
func TestAccTencentCloudNeedFixTseCngwRouteRateLimitResource_basic(t *testing.T) {
t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// go test -i; go test -test.run TestAccTencentCloudTseCngwServiceRateLimitResource_basic -v
func TestAccTencentCloudTseCngwServiceRateLimitResource_basic(t *testing.T) {
func TestAccTencentCloudNeedFixTseCngwServiceRateLimitResource_basic(t *testing.T) {
t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand Down
10 changes: 8 additions & 2 deletions tencentcloud/resource_tc_tsf_deploy_container_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,16 @@ func TestAccTencentCloudTsfDeployContainerGroupResource_basic(t *testing.T) {
})
}

const testAccTsfDeployContainerGroup = `
const testAccTsfDeployContainerGroupVar = `
variable "group_id" {
default = "` + defaultTsfContainerGroupId + `"
}
`

const testAccTsfDeployContainerGroup = testAccTsfDeployContainerGroupVar + `

resource "tencentcloud_tsf_deploy_container_group" "deploy_container_group" {
group_id = "group-yqml6w3a"
group_id = var.group_id
cpu_request = "0.25"
mem_request = "640"
server = "ccr.ccs.tencentyun.com"
Expand Down
4 changes: 2 additions & 2 deletions tencentcloud/resource_tc_tsf_operate_container_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ func testAccCheckTsfOperateContainerGroupExists(r string) resource.TestCheckFunc
const testAccTsfOperateContainerGroup = `

resource "tencentcloud_tsf_operate_container_group" "operate_container_group" {
group_id = "group-yqml6w3a"
group_id = "group-ympdpdzy"
operate = "stop"
}

`
const testAccTsfOperateContainerGroupUp = `

resource "tencentcloud_tsf_operate_container_group" "operate_container_group" {
group_id = "group-yqml6w3a"
group_id = "group-ympdpdzy"
operate = "start"
}

Expand Down