Skip to content

Commit 93d3f54

Browse files
committed
update dedicated_installation_template_test
reformat provider.go add test TestAccDedicatedInstallationTemplateDataSource_basic on CDS
1 parent e7ae619 commit 93d3f54

File tree

3 files changed

+17
-29
lines changed

3 files changed

+17
-29
lines changed

.cds/terraform-provider-ovh.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,14 @@ workflow:
544544
pipeline: terraform-provider-ovh-testacc
545545
when:
546546
- success
547-
Tests_TestAccDedicatedInstallationTemplates:
547+
Tests_TestAccDedicatedInstallationTemplate:
548548
application: terraform-provider-ovh
549549
depends_on:
550550
- terraform-provider-ovh-pre-sweepers
551551
environment: acctests
552552
one_at_a_time: true
553553
parameters:
554-
testargs: -run TestAccDedicatedInstallationTemplates
554+
testargs: -run TestAccDedicatedInstallationTemplate
555555
pipeline: terraform-provider-ovh-testacc
556556
when:
557557
- success
Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
package ovh
22

33
import (
4-
"fmt"
54
"regexp"
65
"testing"
76

87
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
98
)
109

11-
func TestAccInstallationTemplateDataSource_basic(t *testing.T) {
12-
templateName := "debian12_64"
13-
config := fmt.Sprintf(
14-
testAccInstallationTemplateDatasourceConfig_Basic,
15-
templateName,
16-
)
17-
10+
func TestAccDedicatedInstallationTemplateDataSource_basic(t *testing.T) {
11+
testAccInstallationTemplateDatasourceConfig_404 := `data "ovh_dedicated_installation_template" "notemplate" {
12+
template_name = "42"
13+
}`
14+
testAccInstallationTemplateDatasourceConfig_Basic := `data "ovh_dedicated_installation_template" "template" {
15+
template_name= "debian12_64"
16+
}`
1817
resource.Test(t, resource.TestCase{
1918
PreCheck: func() { testAccPreCheckCredentials(t) },
2019
Providers: testAccProviders,
2120
Steps: []resource.TestStep{
2221
{
23-
Config: config,
22+
Config: testAccInstallationTemplateDatasourceConfig_Basic,
2423
Check: resource.ComposeTestCheckFunc(
2524
resource.TestCheckResourceAttr(
2625
"data.ovh_dedicated_installation_template.template",
2726
"template_name",
28-
templateName,
27+
"debian12_64",
2928
),
3029
resource.TestCheckResourceAttr(
3130
"data.ovh_dedicated_installation_template.template",
@@ -41,14 +40,3 @@ func TestAccInstallationTemplateDataSource_basic(t *testing.T) {
4140
},
4241
})
4342
}
44-
45-
const testAccInstallationTemplateDatasourceConfig_404 = `
46-
data "ovh_dedicated_installation_template" "notemplate" {
47-
template_name = "42"
48-
}
49-
`
50-
const testAccInstallationTemplateDatasourceConfig_Basic = `
51-
data "ovh_dedicated_installation_template" "template" {
52-
template_name = "%s"
53-
}
54-
`

ovh/provider.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,12 @@ func Provider() *schema.Provider {
252252
"ovh_me_installation_template_partition_scheme": resourceMeInstallationTemplatePartitionScheme(),
253253
"ovh_me_installation_template_partition_scheme_hardware_raid": resourceMeInstallationTemplatePartitionSchemeHardwareRaid(),
254254
"ovh_me_installation_template_partition_scheme_partition": resourceMeInstallationTemplatePartitionSchemePartition(),
255-
"ovh_vrack": resourceVrack(),
256-
"ovh_vrack_cloudproject": resourceVrackCloudProject(),
257-
"ovh_vrack_dedicated_server": resourceVrackDedicatedServer(),
258-
"ovh_vrack_dedicated_server_interface": resourceVrackDedicatedServerInterface(),
259-
"ovh_vrack_ip": resourceVrackIp(),
260-
"ovh_vrack_iploadbalancing": resourceVrackIpLoadbalancing(),
255+
"ovh_vrack": resourceVrack(),
256+
"ovh_vrack_cloudproject": resourceVrackCloudProject(),
257+
"ovh_vrack_dedicated_server": resourceVrackDedicatedServer(),
258+
"ovh_vrack_dedicated_server_interface": resourceVrackDedicatedServerInterface(),
259+
"ovh_vrack_ip": resourceVrackIp(),
260+
"ovh_vrack_iploadbalancing": resourceVrackIpLoadbalancing(),
261261
},
262262

263263
ConfigureContextFunc: ConfigureContextFunc,

0 commit comments

Comments
 (0)