Skip to content

Commit

Permalink
Rename functions for acceptances tests spliting
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa committed Mar 20, 2023
1 parent 56e168d commit d2f15b5
Show file tree
Hide file tree
Showing 119 changed files with 685 additions and 869 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/others_testacc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ on:

jobs:
Others_acceptances_tests:
environment: us-east-2
runs-on: [self-hosted, linux, us-east-2]
environment: eu-west-2
runs-on: [self-hosted, linux, eu-west-2]
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_access_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccOutscaleDataSourceAccessKey_basic(t *testing.T) {
func TestAccOthers_DatasourceAccessKey_basic(t *testing.T) {
t.Parallel()
dataSourceName := "outscale_access_key.outscale_access_key"

Expand All @@ -28,7 +28,7 @@ func TestAccOutscaleDataSourceAccessKey_basic(t *testing.T) {
})
}

func TestAccOutscaleDataSourceAccessKey_withFilters(t *testing.T) {
func TestAccOthers_AccessKey_withFilters(t *testing.T) {
t.Parallel()
dataSourceName := "outscale_access_key.outscale_access_key"

Expand Down
8 changes: 4 additions & 4 deletions outscale/data_source_outscale_access_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccOutscaleDataSourceAccessKeys_basic(t *testing.T) {
func TestAccOthers_DataSourceAccessKeys_basic(t *testing.T) {
t.Parallel()
dataSourceName := "data.outscale_access_keys.outscale_access_key"

Expand All @@ -25,7 +25,7 @@ func TestAccOutscaleDataSourceAccessKeys_basic(t *testing.T) {
})
}

func TestAccOutscaleDataSourceAccessKeys_withFilters(t *testing.T) {
func TestAccOthers_DataSourceAccessKeys_withFilters(t *testing.T) {
t.Parallel()
dataSourceName := "data.outscale_access_keys.outscale_access_key"

Expand All @@ -49,7 +49,7 @@ func testAccClientAccessKeysDataSourceBasic() string {
resource "outscale_access_key" "outscale_access_key" {}
data "outscale_access_keys" "outscale_access_key" {
access_key_ids = ["${outscale_access_key.outscale_access_key.id}"]
access_key_ids = [outscale_access_key.outscale_access_key.id]
}
`
}
Expand All @@ -61,7 +61,7 @@ func testAccClientAccessKeysDataSourceWithFilters() string {
data "outscale_access_keys" "outscale_access_key" {
filter {
name = "access_key_ids"
values = ["${outscale_access_key.outscale_access_key.id}"]
values = [outscale_access_key.outscale_access_key.id]
}
}
`
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccDataSourceAccount_basic(t *testing.T) {
func TestAccOthers_DataSourceAccount_basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccDataSourceAccounts_basic(t *testing.T) {
func TestAccOthers_DataSourceAccounts_basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_api_access_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func TestAccDataOutscaleOAPIApiAccessRule_basic(t *testing.T) {
func TestAccOthers_DataOutscaleOAPIApiAccessRule_basic(t *testing.T) {
t.Parallel()
resourceName := "outscale_api_access_rule.rule_data"

Expand Down Expand Up @@ -78,15 +78,15 @@ resource "outscale_ca" "ca_rule" {
}
resource "outscale_api_access_rule" "rule_data" {
ca_ids = ["${outscale_ca.ca_rule.id}"]
ca_ids = [outscale_ca.ca_rule.id]
ip_ranges = ["192.4.2.32/16"]
description = "test api access rule"
}
data "outscale_api_access_rule" "api_access_rule" {
filter {
name = "api_access_rule_ids"
values = ["${outscale_api_access_rule.rule_data.id}"]
values = [outscale_api_access_rule.rule_data.id]
}
filter {
Expand Down
12 changes: 6 additions & 6 deletions outscale/data_source_outscale_ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

func TestAccDataOutscaleOAPICa_basic(t *testing.T) {
func TestAccOthers_DataOutscaleCa_basic(t *testing.T) {
resourceName := "outscale_ca.ca_test"

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -72,16 +72,16 @@ func testAccDataCheckOutscaleCaDestroy(s *terraform.State) error {

func testAccDataOutscaleOAPICaConfig(ca_pem string) string {
return fmt.Sprintf(`
resource "outscale_ca" "ca_test" {
resource "outscale_ca" "ca_test" {
ca_pem = %[1]q
description = "Ca testacc create"
}
data "outscale_ca" "ca_data" {
filter {
name = "ca_ids"
values = ["${outscale_ca.ca_test.id}"]
}
filter {
name = "ca_ids"
values = [outscale_ca.ca_test.id]
}
}
`, ca_pem)
}
24 changes: 16 additions & 8 deletions outscale/data_source_outscale_cas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

func TestAccDataOutscaleOAPICas_basic(t *testing.T) {
func TestAccOthers_DataOutscaleCas_basic(t *testing.T) {
resName := "outscale_ca.ca_test"

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -72,17 +72,25 @@ func testAccDataCheckOutscaleCasDestroy(s *terraform.State) error {

func testAccDataOutscaleOAPICasConfig(ca_pem string) string {
return fmt.Sprintf(`
resource "outscale_ca" "ca_test" {
resource "outscale_ca" "ca_test" {
ca_pem = %[1]q
description = "Ca testacc create"
}
data "outscale_cas" "cas_data" {
filter {
name = "ca_ids"
values = ["${outscale_ca.ca_test.id}"]
}
resource "outscale_ca" "ca_test2" {
ca_pem = %[1]q
description = "Ca testacc create2"
}
data "outscale_cas" "cas_data" {
filter {
name = "ca_ids"
values = [outscale_ca.ca_test.id]
}
filter {
name = "description"
values = ["Ca testacc create2"]
}
}
data "outscale_cas" "all_cas" {}
`, ca_pem)
}
10 changes: 5 additions & 5 deletions outscale/data_source_outscale_client_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

func TestAccOutscaleGatewayDatasource_basic(t *testing.T) {
func TestAccOthers_GatewayDatasource_basic(t *testing.T) {
t.Parallel()
rBgpAsn := utils.RandIntRange(64512, 65534)
value := fmt.Sprintf("testacc-%s", acctest.RandString(5))
Expand All @@ -25,7 +25,7 @@ func TestAccOutscaleGatewayDatasource_basic(t *testing.T) {
})
}

func TestAccOutscaleGatewayDatasource_withFilters(t *testing.T) {
func TestAccOthers_GatewayDatasource_withFilters(t *testing.T) {
t.Parallel()
// datasourceName := "data.outscale_client_gateway.test"
rBgpAsn := utils.RandIntRange(64512, 65534)
Expand All @@ -42,7 +42,7 @@ func TestAccOutscaleGatewayDatasource_withFilters(t *testing.T) {
})
}

func TestAccOutscaleGatewayDatasource_withFiltersNoLocalhost(t *testing.T) {
func TestAccOthers_GatewayDatasource_withFiltersNoLocalhost(t *testing.T) {
t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -69,7 +69,7 @@ func testAccClientGatewayDatasourceBasic(rBgpAsn int, value string) string {
}
data "outscale_client_gateway" "test" {
client_gateway_id = "${outscale_client_gateway.foo.id}"
client_gateway_id = outscale_client_gateway.foo.id
}
`, rBgpAsn, value)
}
Expand All @@ -90,7 +90,7 @@ func testAccClientGatewayDatasourceWithFilters(rBgpAsn int, value string) string
data "outscale_client_gateway" "test" {
filter {
name = "client_gateway_ids"
values = ["${outscale_client_gateway.foo.id}"]
values = [outscale_client_gateway.foo.id]
}
}
`, rBgpAsn, value)
Expand Down
8 changes: 4 additions & 4 deletions outscale/data_source_outscale_client_gateways_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccOutscaleClientGatewaysDatasource_basic(t *testing.T) {
func TestAccOthers_ClientGatewaysDatasource_basic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Expand All @@ -18,7 +18,7 @@ func TestAccOutscaleClientGatewaysDatasource_basic(t *testing.T) {
})
}

func TestAccOutscaleClientGatewaysDatasource_withFilters(t *testing.T) {
func TestAccOthers_ClientGatewaysDatasource_withFilters(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Expand Down Expand Up @@ -49,7 +49,7 @@ const testAccOutscaleClientGatewaysDatasourceConfigBasic = `
}
data "outscale_client_gateways" "test" {
client_gateway_ids = ["${outscale_client_gateway.foo1.id}", "${outscale_client_gateway.foo2.id}"]
client_gateway_ids = [outscale_client_gateway.foo1.id, outscale_client_gateway.foo2.id]
}
`

Expand All @@ -74,7 +74,7 @@ const testAccOutscaleClientGatewaysDatasourceConfigWithFilters = `
data "outscale_client_gateways" "test" {
filter {
name = "client_gateway_ids"
values = ["${outscale_client_gateway.foo1.id}", "${outscale_client_gateway.foo2.id}"]
values = [outscale_client_gateway.foo1.id, outscale_client_gateway.foo2.id]
}
}
`
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_dhcp_option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccOutscaleDHCPOption_basic(t *testing.T) {
func TestAccOthers_DHCPOption_basic(t *testing.T) {
t.Parallel()
resourceName := "outscale_dhcp_option.foo"
dataSourceName := "data.outscale_dhcp_option.test"
Expand Down Expand Up @@ -45,7 +45,7 @@ func TestAccOutscaleDHCPOption_basic(t *testing.T) {
})
}

func TestAccOutscaleDHCPOption_withFilters(t *testing.T) {
func TestAccOthers_DHCPOption_withFilters(t *testing.T) {
t.Parallel()
resourceName := "outscale_dhcp_option.foo"
dataSourceName := "data.outscale_dhcp_option.test"
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_dhcp_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccOutscaleDHCPOptionsDatasource_basic(t *testing.T) {
func TestAccOthers_DHCPOptionsDatasource_basic(t *testing.T) {
t.Parallel()
value := fmt.Sprintf("test-acc-value-%s", acctest.RandString(5))

Expand All @@ -23,7 +23,7 @@ func TestAccOutscaleDHCPOptionsDatasource_basic(t *testing.T) {
})
}

func TestAccOutscaleDHCPOptionsDatasource_withFilters(t *testing.T) {
func TestAccOthers_DHCPOptionsDatasource_withFilters(t *testing.T) {
t.Parallel()
value := fmt.Sprintf("test-acc-value-%s", acctest.RandString(5))

Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_flexible_gpu_catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccDataSourceOutscaleOAPIFlexibleGpuCatalog_basic(t *testing.T) {
func TestAccOthers_DataSourceFlexibleGpuCatalog_basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand Down
22 changes: 10 additions & 12 deletions outscale/data_source_outscale_flexible_gpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package outscale

import (
"fmt"
"os"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

func TestAccDataSourceOutscaleOAPIFlexibleGpu_basic(t *testing.T) {
t.Parallel()
region := fmt.Sprintf("%sa", os.Getenv("OUTSCALE_REGION"))
func TestAccOthers_DataSourceFlexibleGpu_basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand All @@ -19,25 +17,25 @@ func TestAccDataSourceOutscaleOAPIFlexibleGpu_basic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccDataSourceOutscaleOAPIFlexibleGpuConfig(region, region),
Config: testAccDataSourceOutscaleOAPIFlexibleGpuConfig(utils.GetRegion()),
},
},
})
}

func testAccDataSourceOutscaleOAPIFlexibleGpuConfig(region, region1 string) string {
func testAccDataSourceOutscaleOAPIFlexibleGpuConfig(region string) string {
return fmt.Sprintf(`
resource "outscale_flexible_gpu" "fGPU-data1" {
resource "outscale_flexible_gpu" "dataGPU" {
model_name = "nvidia-p6"
generation = "v5"
subregion_name = "%s"
subregion_name = "%sa"
delete_on_vm_deletion = true
}
data "outscale_flexible_gpu" "data_fGPU-1" {
data "outscale_flexible_gpu" "data_fGPU" {
filter {
name = "flexible_gpu_ids"
values = [outscale_flexible_gpu.fGPU-data1.flexible_gpu_id]
values = [outscale_flexible_gpu.dataGPU.flexible_gpu_id]
}
filter {
name = "delete_on_vm_deletion"
Expand All @@ -57,8 +55,8 @@ func testAccDataSourceOutscaleOAPIFlexibleGpuConfig(region, region1 string) stri
}
filter {
name = "subregion_names"
values = ["%s"]
values = ["%[1]sa"]
}
}
`, region, region)
`, region)
}
Loading

0 comments on commit d2f15b5

Please sign in to comment.