@@ -10,20 +10,20 @@ import (
10
10
"github.com/hashicorp/terraform/terraform"
11
11
)
12
12
13
- func TestAccOVHRecord_Basic (t * testing.T ) {
14
- var record Record
13
+ func TestAccOvhDomainZoneRecord_Basic (t * testing.T ) {
14
+ var record OvhDomainZoneRecord
15
15
zone := os .Getenv ("OVH_ZONE" )
16
16
17
17
resource .Test (t , resource.TestCase {
18
18
PreCheck : func () { testAccPreCheck (t ) },
19
19
Providers : testAccProviders ,
20
- CheckDestroy : testAccCheckOVHRecordDestroy ,
20
+ CheckDestroy : testAccCheckOvhDomainZoneRecordDestroy ,
21
21
Steps : []resource.TestStep {
22
22
resource.TestStep {
23
- Config : fmt .Sprintf (testAccCheckOVHRecordConfig_basic , zone ),
23
+ Config : fmt .Sprintf (testAccCheckOvhDomainZoneRecordConfig_basic , zone ),
24
24
Check : resource .ComposeTestCheckFunc (
25
- testAccCheckOVHRecordExists ("ovh_domain_zone_record.foobar" , & record ),
26
- testAccCheckOVHRecordAttributes (& record ),
25
+ testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
26
+ testAccCheckOvhDomainZoneRecordAttributes (& record ),
27
27
resource .TestCheckResourceAttr (
28
28
"ovh_domain_zone_record.foobar" , "subdomain" , "terraform" ),
29
29
resource .TestCheckResourceAttr (
@@ -38,20 +38,20 @@ func TestAccOVHRecord_Basic(t *testing.T) {
38
38
})
39
39
}
40
40
41
- func TestAccOVHRecord_Updated (t * testing.T ) {
42
- record := Record {}
41
+ func TestAccOvhDomainZoneRecord_Updated (t * testing.T ) {
42
+ record := OvhDomainZoneRecord {}
43
43
zone := os .Getenv ("OVH_ZONE" )
44
44
45
45
resource .Test (t , resource.TestCase {
46
46
PreCheck : func () { testAccPreCheck (t ) },
47
47
Providers : testAccProviders ,
48
- CheckDestroy : testAccCheckOVHRecordDestroy ,
48
+ CheckDestroy : testAccCheckOvhDomainZoneRecordDestroy ,
49
49
Steps : []resource.TestStep {
50
50
resource.TestStep {
51
- Config : fmt .Sprintf (testAccCheckOVHRecordConfig_basic , zone ),
51
+ Config : fmt .Sprintf (testAccCheckOvhDomainZoneRecordConfig_basic , zone ),
52
52
Check : resource .ComposeTestCheckFunc (
53
- testAccCheckOVHRecordExists ("ovh_domain_zone_record.foobar" , & record ),
54
- testAccCheckOVHRecordAttributes (& record ),
53
+ testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
54
+ testAccCheckOvhDomainZoneRecordAttributes (& record ),
55
55
resource .TestCheckResourceAttr (
56
56
"ovh_domain_zone_record.foobar" , "subdomain" , "terraform" ),
57
57
resource .TestCheckResourceAttr (
@@ -63,10 +63,10 @@ func TestAccOVHRecord_Updated(t *testing.T) {
63
63
),
64
64
},
65
65
resource.TestStep {
66
- Config : fmt .Sprintf (testAccCheckOVHRecordConfig_new_value_1 , zone ),
66
+ Config : fmt .Sprintf (testAccCheckOvhDomainZoneRecordConfig_new_value_1 , zone ),
67
67
Check : resource .ComposeTestCheckFunc (
68
- testAccCheckOVHRecordExists ("ovh_domain_zone_record.foobar" , & record ),
69
- testAccCheckOVHRecordAttributesUpdated_1 (& record ),
68
+ testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
69
+ testAccCheckOvhDomainZoneRecordAttributesUpdated_1 (& record ),
70
70
resource .TestCheckResourceAttr (
71
71
"ovh_domain_zone_record.foobar" , "subdomain" , "terraform" ),
72
72
resource .TestCheckResourceAttr (
@@ -78,10 +78,10 @@ func TestAccOVHRecord_Updated(t *testing.T) {
78
78
),
79
79
},
80
80
resource.TestStep {
81
- Config : fmt .Sprintf (testAccCheckOVHRecordConfig_new_value_2 , zone ),
81
+ Config : fmt .Sprintf (testAccCheckOvhDomainZoneRecordConfig_new_value_2 , zone ),
82
82
Check : resource .ComposeTestCheckFunc (
83
- testAccCheckOVHRecordExists ("ovh_domain_zone_record.foobar" , & record ),
84
- testAccCheckOVHRecordAttributesUpdated_2 (& record ),
83
+ testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
84
+ testAccCheckOvhDomainZoneRecordAttributesUpdated_2 (& record ),
85
85
resource .TestCheckResourceAttr (
86
86
"ovh_domain_zone_record.foobar" , "subdomain" , "terraform2" ),
87
87
resource .TestCheckResourceAttr (
@@ -93,10 +93,10 @@ func TestAccOVHRecord_Updated(t *testing.T) {
93
93
),
94
94
},
95
95
resource.TestStep {
96
- Config : fmt .Sprintf (testAccCheckOVHRecordConfig_new_value_3 , zone ),
96
+ Config : fmt .Sprintf (testAccCheckOvhDomainZoneRecordConfig_new_value_3 , zone ),
97
97
Check : resource .ComposeTestCheckFunc (
98
- testAccCheckOVHRecordExists ("ovh_domain_zone_record.foobar" , & record ),
99
- testAccCheckOVHRecordAttributesUpdated_3 (& record ),
98
+ testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
99
+ testAccCheckOvhDomainZoneRecordAttributesUpdated_3 (& record ),
100
100
resource .TestCheckResourceAttr (
101
101
"ovh_domain_zone_record.foobar" , "subdomain" , "terraform3" ),
102
102
resource .TestCheckResourceAttr (
@@ -111,7 +111,7 @@ func TestAccOVHRecord_Updated(t *testing.T) {
111
111
})
112
112
}
113
113
114
- func testAccCheckOVHRecordDestroy (s * terraform.State ) error {
114
+ func testAccCheckOvhDomainZoneRecordDestroy (s * terraform.State ) error {
115
115
provider := testAccProvider .Meta ().(* Config )
116
116
zone := os .Getenv ("OVH_ZONE" )
117
117
@@ -120,7 +120,7 @@ func testAccCheckOVHRecordDestroy(s *terraform.State) error {
120
120
continue
121
121
}
122
122
123
- resultRecord := Record {}
123
+ resultRecord := OvhDomainZoneRecord {}
124
124
err := provider .OVHClient .Get (
125
125
fmt .Sprintf ("/domain/zone/%s/record/%s" , zone , rs .Primary .ID ),
126
126
& resultRecord ,
@@ -134,7 +134,7 @@ func testAccCheckOVHRecordDestroy(s *terraform.State) error {
134
134
return nil
135
135
}
136
136
137
- func testAccCheckOVHRecordExists (n string , record * Record ) resource.TestCheckFunc {
137
+ func testAccCheckOvhDomainZoneRecordExists (n string , record * OvhDomainZoneRecord ) resource.TestCheckFunc {
138
138
zone := os .Getenv ("OVH_ZONE" )
139
139
return func (s * terraform.State ) error {
140
140
rs , ok := s .RootModule ().Resources [n ]
@@ -166,7 +166,7 @@ func testAccCheckOVHRecordExists(n string, record *Record) resource.TestCheckFun
166
166
}
167
167
}
168
168
169
- func testAccCheckOVHRecordAttributes (record * Record ) resource.TestCheckFunc {
169
+ func testAccCheckOvhDomainZoneRecordAttributes (record * OvhDomainZoneRecord ) resource.TestCheckFunc {
170
170
return func (s * terraform.State ) error {
171
171
172
172
if record .Target != "192.168.0.10" {
@@ -177,7 +177,7 @@ func testAccCheckOVHRecordAttributes(record *Record) resource.TestCheckFunc {
177
177
}
178
178
}
179
179
180
- func testAccCheckOVHRecordAttributesUpdated_1 (record * Record ) resource.TestCheckFunc {
180
+ func testAccCheckOvhDomainZoneRecordAttributesUpdated_1 (record * OvhDomainZoneRecord ) resource.TestCheckFunc {
181
181
return func (s * terraform.State ) error {
182
182
183
183
if record .Target != "192.168.0.11" {
@@ -188,7 +188,7 @@ func testAccCheckOVHRecordAttributesUpdated_1(record *Record) resource.TestCheck
188
188
}
189
189
}
190
190
191
- func testAccCheckOVHRecordAttributesUpdated_2 (record * Record ) resource.TestCheckFunc {
191
+ func testAccCheckOvhDomainZoneRecordAttributesUpdated_2 (record * OvhDomainZoneRecord ) resource.TestCheckFunc {
192
192
return func (s * terraform.State ) error {
193
193
194
194
if record .Target != "192.168.0.11" {
@@ -203,7 +203,7 @@ func testAccCheckOVHRecordAttributesUpdated_2(record *Record) resource.TestCheck
203
203
}
204
204
}
205
205
206
- func testAccCheckOVHRecordAttributesUpdated_3 (record * Record ) resource.TestCheckFunc {
206
+ func testAccCheckOvhDomainZoneRecordAttributesUpdated_3 (record * OvhDomainZoneRecord ) resource.TestCheckFunc {
207
207
return func (s * terraform.State ) error {
208
208
209
209
if record .Target != "192.168.0.13" {
@@ -221,7 +221,7 @@ func testAccCheckOVHRecordAttributesUpdated_3(record *Record) resource.TestCheck
221
221
}
222
222
}
223
223
224
- const testAccCheckOVHRecordConfig_basic = `
224
+ const testAccCheckOvhDomainZoneRecordConfig_basic = `
225
225
resource "ovh_domain_zone_record" "foobar" {
226
226
zone = "%s"
227
227
subdomain = "terraform"
@@ -230,7 +230,7 @@ resource "ovh_domain_zone_record" "foobar" {
230
230
ttl = 3600
231
231
}`
232
232
233
- const testAccCheckOVHRecordConfig_new_value_1 = `
233
+ const testAccCheckOvhDomainZoneRecordConfig_new_value_1 = `
234
234
resource "ovh_domain_zone_record" "foobar" {
235
235
zone = "%s"
236
236
subdomain = "terraform"
@@ -239,7 +239,7 @@ resource "ovh_domain_zone_record" "foobar" {
239
239
ttl = 3600
240
240
}
241
241
`
242
- const testAccCheckOVHRecordConfig_new_value_2 = `
242
+ const testAccCheckOvhDomainZoneRecordConfig_new_value_2 = `
243
243
resource "ovh_domain_zone_record" "foobar" {
244
244
zone = "%s"
245
245
subdomain = "terraform2"
@@ -248,7 +248,7 @@ resource "ovh_domain_zone_record" "foobar" {
248
248
ttl = 3600
249
249
}
250
250
`
251
- const testAccCheckOVHRecordConfig_new_value_3 = `
251
+ const testAccCheckOvhDomainZoneRecordConfig_new_value_3 = `
252
252
resource "ovh_domain_zone_record" "foobar" {
253
253
zone = "%s"
254
254
subdomain = "terraform3"
0 commit comments