Skip to content

Commit

Permalink
update dedicated_installation_template_test
Browse files Browse the repository at this point in the history
reformat provider.go
add test TestAccDedicatedInstallationTemplateDataSource_basic on CDS

update test
  • Loading branch information
bigbigbang committed May 2, 2024
1 parent e7ae619 commit 175e3b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .cds/terraform-provider-ovh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,14 @@ workflow:
pipeline: terraform-provider-ovh-testacc
when:
- success
Tests_TestAccDedicatedInstallationTemplates:
Tests_TestAccDedicatedInstallationTemplate:
application: terraform-provider-ovh
depends_on:
- terraform-provider-ovh-pre-sweepers
environment: acctests
one_at_a_time: true
parameters:
testargs: -run TestAccDedicatedInstallationTemplates
testargs: -run TestAccDedicatedInstallationTemplateDataSource_basic
pipeline: terraform-provider-ovh-testacc
when:
- success
Expand Down
25 changes: 5 additions & 20 deletions ovh/data_dedicated_installation_template_test.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
package ovh

import (
"fmt"
"regexp"
"testing"

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

func TestAccInstallationTemplateDataSource_basic(t *testing.T) {
templateName := "debian12_64"
config := fmt.Sprintf(
testAccInstallationTemplateDatasourceConfig_Basic,
templateName,
)

func TestAccDedicatedInstallationTemplateDataSource_basic(t *testing.T) {
testAccInstallationTemplateDatasourceConfig_404 := `data "ovh_dedicated_installation_template" "notemplate" {template_name = "42"}`
testAccInstallationTemplateDatasourceConfig_Basic := `data "ovh_dedicated_installation_template" "template" {template_name= "debian12_64"}`
config := testAccInstallationTemplateDatasourceConfig_Basic
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheckCredentials(t) },
Providers: testAccProviders,
Expand All @@ -25,7 +21,7 @@ func TestAccInstallationTemplateDataSource_basic(t *testing.T) {
resource.TestCheckResourceAttr(
"data.ovh_dedicated_installation_template.template",
"template_name",
templateName,
"debian12_64",
),
resource.TestCheckResourceAttr(
"data.ovh_dedicated_installation_template.template",
Expand All @@ -41,14 +37,3 @@ func TestAccInstallationTemplateDataSource_basic(t *testing.T) {
},
})
}

const testAccInstallationTemplateDatasourceConfig_404 = `
data "ovh_dedicated_installation_template" "notemplate" {
template_name = "42"
}
`
const testAccInstallationTemplateDatasourceConfig_Basic = `
data "ovh_dedicated_installation_template" "template" {
template_name = "%s"
}
`
12 changes: 6 additions & 6 deletions ovh/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ func Provider() *schema.Provider {
"ovh_me_installation_template_partition_scheme": resourceMeInstallationTemplatePartitionScheme(),
"ovh_me_installation_template_partition_scheme_hardware_raid": resourceMeInstallationTemplatePartitionSchemeHardwareRaid(),
"ovh_me_installation_template_partition_scheme_partition": resourceMeInstallationTemplatePartitionSchemePartition(),
"ovh_vrack": resourceVrack(),
"ovh_vrack_cloudproject": resourceVrackCloudProject(),
"ovh_vrack_dedicated_server": resourceVrackDedicatedServer(),
"ovh_vrack_dedicated_server_interface": resourceVrackDedicatedServerInterface(),
"ovh_vrack_ip": resourceVrackIp(),
"ovh_vrack_iploadbalancing": resourceVrackIpLoadbalancing(),
"ovh_vrack": resourceVrack(),
"ovh_vrack_cloudproject": resourceVrackCloudProject(),
"ovh_vrack_dedicated_server": resourceVrackDedicatedServer(),
"ovh_vrack_dedicated_server_interface": resourceVrackDedicatedServerInterface(),
"ovh_vrack_ip": resourceVrackIp(),
"ovh_vrack_iploadbalancing": resourceVrackIpLoadbalancing(),
},

ConfigureContextFunc: ConfigureContextFunc,
Expand Down

0 comments on commit 175e3b7

Please sign in to comment.