@@ -103,7 +103,7 @@ func TestAccOvhDomainZoneRecord_Basic(t *testing.T) {
103
103
CheckDestroy : testAccCheckOvhDomainZoneRecordDestroy ,
104
104
Steps : []resource.TestStep {
105
105
{
106
- Config : fmt . Sprintf ( testAccCheckOvhDomainZoneRecordConfig_basic , zone , subdomain ),
106
+ Config : testAccCheckOvhDomainZoneRecordConfig_A ( zone , subdomain , "192.168.0.10" , 3600 ),
107
107
Check : resource .ComposeTestCheckFunc (
108
108
testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
109
109
resource .TestCheckResourceAttr (
@@ -131,7 +131,7 @@ func TestAccOvhDomainZoneRecord_Updated(t *testing.T) {
131
131
CheckDestroy : testAccCheckOvhDomainZoneRecordDestroy ,
132
132
Steps : []resource.TestStep {
133
133
{
134
- Config : fmt . Sprintf ( testAccCheckOvhDomainZoneRecordConfig_basic , zone , subdomain ),
134
+ Config : testAccCheckOvhDomainZoneRecordConfig_A ( zone , subdomain , "192.168.0.10" , 3600 ),
135
135
Check : resource .ComposeTestCheckFunc (
136
136
testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
137
137
resource .TestCheckResourceAttr (
@@ -145,7 +145,7 @@ func TestAccOvhDomainZoneRecord_Updated(t *testing.T) {
145
145
),
146
146
},
147
147
{
148
- Config : fmt . Sprintf ( testAccCheckOvhDomainZoneRecordConfig_new_value_1 , zone , subdomain ),
148
+ Config : testAccCheckOvhDomainZoneRecordConfig_A ( zone , subdomain , "192.168.0.11" , 3600 ),
149
149
Check : resource .ComposeTestCheckFunc (
150
150
testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
151
151
resource .TestCheckResourceAttr (
@@ -159,7 +159,8 @@ func TestAccOvhDomainZoneRecord_Updated(t *testing.T) {
159
159
),
160
160
},
161
161
{
162
- Config : fmt .Sprintf (testAccCheckOvhDomainZoneRecordConfig_new_value_2 , zone , subdomain ),
162
+ Config : testAccCheckOvhDomainZoneRecordConfig_A (zone , fmt .Sprintf ("%s2" , subdomain ),
163
+ "192.168.0.11" , 3600 ),
163
164
Check : resource .ComposeTestCheckFunc (
164
165
testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
165
166
resource .TestCheckResourceAttr (
@@ -173,7 +174,8 @@ func TestAccOvhDomainZoneRecord_Updated(t *testing.T) {
173
174
),
174
175
},
175
176
{
176
- Config : fmt .Sprintf (testAccCheckOvhDomainZoneRecordConfig_new_value_3 , zone , subdomain ),
177
+ Config : testAccCheckOvhDomainZoneRecordConfig_A (zone , fmt .Sprintf ("%s3" , subdomain ),
178
+ "192.168.0.13" , 3604 ),
177
179
Check : resource .ComposeTestCheckFunc (
178
180
testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
179
181
resource .TestCheckResourceAttr (
@@ -245,38 +247,13 @@ func testAccCheckOvhDomainZoneRecordExists(n string, record *OvhDomainZoneRecord
245
247
}
246
248
}
247
249
248
- const testAccCheckOvhDomainZoneRecordConfig_basic = `
250
+ func testAccCheckOvhDomainZoneRecordConfig_A (zone , subdomain , target string , ttl int ) string {
251
+ return fmt .Sprintf (`
249
252
resource "ovh_domain_zone_record" "foobar" {
250
253
zone = "%s"
251
254
subdomain = "%s"
252
- target = "192.168.0.10 "
255
+ target = "%s "
253
256
fieldtype = "A"
254
- ttl = 3600
255
- }`
256
-
257
- const testAccCheckOvhDomainZoneRecordConfig_new_value_1 = `
258
- resource "ovh_domain_zone_record" "foobar" {
259
- zone = "%s"
260
- subdomain = "%s"
261
- target = "192.168.0.11"
262
- fieldtype = "A"
263
- ttl = 3600
264
- }
265
- `
266
- const testAccCheckOvhDomainZoneRecordConfig_new_value_2 = `
267
- resource "ovh_domain_zone_record" "foobar" {
268
- zone = "%s"
269
- subdomain = "%s2"
270
- target = "192.168.0.11"
271
- fieldtype = "A"
272
- ttl = 3600
257
+ ttl = %d
258
+ }` , zone , subdomain , target , ttl )
273
259
}
274
- `
275
- const testAccCheckOvhDomainZoneRecordConfig_new_value_3 = `
276
- resource "ovh_domain_zone_record" "foobar" {
277
- zone = "%s"
278
- subdomain = "%s3"
279
- target = "192.168.0.13"
280
- fieldtype = "A"
281
- ttl = 3604
282
- }`
0 commit comments