8
8
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
9
9
)
10
10
11
- func TestAccTencentCloudDataSourceImagesBase (t * testing.T ) {
11
+ // go test -i; go test -test.run TestAccTencentCloudDataSourceImagesBase_basic -v
12
+ func TestAccTencentCloudDataSourceImagesBase_basic (t * testing.T ) {
12
13
t .Parallel ()
13
14
resource .Test (t , resource.TestCase {
14
15
PreCheck : func () { tcacctest .AccPreCheck (t ) },
@@ -17,70 +18,70 @@ func TestAccTencentCloudDataSourceImagesBase(t *testing.T) {
17
18
{
18
19
Config : testAccTencentCloudDataSourceImagesBase ,
19
20
Check : resource .ComposeTestCheckFunc (
20
- tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.foo " ),
21
- resource .TestCheckResourceAttrSet ("data.tencentcloud_images.foo " , "images.#" ),
21
+ tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.example " ),
22
+ resource .TestCheckResourceAttrSet ("data.tencentcloud_images.example " , "images.#" ),
22
23
),
23
24
},
24
25
{
25
26
Config : testAccTencentCloudDataSourceImagesBaseWithFilter ,
26
27
Check : resource .ComposeTestCheckFunc (
27
- tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.foo " ),
28
- resource .TestCheckResourceAttrSet ("data.tencentcloud_images.foo " , "images.#" ),
28
+ tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.example " ),
29
+ resource .TestCheckResourceAttrSet ("data.tencentcloud_images.example " , "images.#" ),
29
30
),
30
31
},
31
32
{
32
33
Config : testAccTencentCloudDataSourceImagesBaseWithOsName ,
33
34
Check : resource .ComposeTestCheckFunc (
34
- tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.foo " ),
35
- resource .TestCheckResourceAttrSet ("data.tencentcloud_images.foo " , "images.#" ),
35
+ tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.example " ),
36
+ resource .TestCheckResourceAttrSet ("data.tencentcloud_images.example " , "images.#" ),
36
37
),
37
38
},
38
39
{
39
40
Config : testAccTencentCloudDataSourceImagesBaseWithImageNameRegex ,
40
41
Check : resource .ComposeTestCheckFunc (
41
- tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.foo " ),
42
- resource .TestCheckResourceAttrSet ("data.tencentcloud_images.foo " , "images.#" ),
42
+ tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.example " ),
43
+ resource .TestCheckResourceAttrSet ("data.tencentcloud_images.example " , "images.#" ),
43
44
),
44
45
},
45
46
{
46
47
Config : testAccTencentCloudDataSourceImagesBaseWithInstanceType ,
47
48
Check : resource .ComposeTestCheckFunc (
48
- tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.foo " ),
49
- resource .TestCheckResourceAttrSet ("data.tencentcloud_images.foo " , "images.#" ),
49
+ tcacctest .AccCheckTencentCloudDataSourceID ("data.tencentcloud_images.example " ),
50
+ resource .TestCheckResourceAttrSet ("data.tencentcloud_images.example " , "images.#" ),
50
51
),
51
52
},
52
53
},
53
54
})
54
55
}
55
56
56
57
const testAccTencentCloudDataSourceImagesBase = `
57
- data "tencentcloud_images" "foo " {
58
+ data "tencentcloud_images" "example " {
58
59
result_output_file = "data_source_tc_images_test.txt"
59
60
}
60
61
`
61
62
62
63
const testAccTencentCloudDataSourceImagesBaseWithFilter = `
63
- data "tencentcloud_images" "foo " {
64
+ data "tencentcloud_images" "example " {
64
65
image_type = ["PRIVATE_IMAGE"]
65
66
}
66
67
`
67
68
68
69
const testAccTencentCloudDataSourceImagesBaseWithOsName = `
69
- data "tencentcloud_images" "foo " {
70
+ data "tencentcloud_images" "example " {
70
71
image_type = ["PUBLIC_IMAGE"]
71
- os_name = "CentOS 7.5"
72
+ os_name = "CentOS 7.5"
72
73
}
73
74
`
74
75
75
76
const testAccTencentCloudDataSourceImagesBaseWithImageNameRegex = `
76
- data "tencentcloud_images" "foo " {
77
- image_type = ["PUBLIC_IMAGE"]
77
+ data "tencentcloud_images" "example " {
78
+ image_type = ["PUBLIC_IMAGE"]
78
79
image_name_regex = "^CentOS\\s+7\\.5\\s+64\\w*"
79
80
}
80
81
`
81
82
82
83
const testAccTencentCloudDataSourceImagesBaseWithInstanceType = `
83
- data "tencentcloud_images" "foo " {
84
+ data "tencentcloud_images" "example " {
84
85
instance_type = "S1.SMALL1"
85
86
}
86
87
`
0 commit comments