From 12533acc111c5ea526f5e53ddf286d238bc82456 Mon Sep 17 00:00:00 2001 From: Thiery Ouattara Date: Fri, 10 Mar 2023 09:00:41 +0000 Subject: [PATCH] fuxp Net --- .github/workflows/acceptance_test.yml | 2 +- .../data_source_outscale_access_key_test.go | 4 +- .../data_source_outscale_access_keys_test.go | 8 +- outscale/data_source_outscale_account_test.go | 2 +- .../data_source_outscale_accounts_test.go | 2 +- ...ta_source_outscale_api_access_rule_test.go | 6 +- outscale/data_source_outscale_ca_test.go | 2 +- outscale/data_source_outscale_cas_test.go | 2 +- ...ata_source_outscale_client_gateway_test.go | 10 +- ...ta_source_outscale_client_gateways_test.go | 8 +- .../data_source_outscale_dhcp_option_test.go | 4 +- .../data_source_outscale_dhcp_options_test.go | 4 +- ...urce_outscale_flexible_gpu_catalog_test.go | 2 +- .../data_source_outscale_flexible_gpu_test.go | 11 +- ...data_source_outscale_flexible_gpus_test.go | 11 +- ..._source_outscale_image_export_task_test.go | 2 +- ...source_outscale_image_export_tasks_test.go | 2 +- outscale/data_source_outscale_image_test.go | 48 +----- outscale/data_source_outscale_images_test.go | 8 +- ...a_source_outscale_internet_service_test.go | 4 +- ..._source_outscale_internet_services_test.go | 4 +- outscale/data_source_outscale_keypair_test.go | 5 +- .../data_source_outscale_keypairs_test.go | 2 +- ...data_source_outscale_load_balancer_test.go | 2 +- ...ata_source_outscale_load_balancers_test.go | 4 +- .../data_source_outscale_product_type_test.go | 2 +- ...data_source_outscale_product_types_test.go | 2 +- ...ata_source_outscale_public_catalog_test.go | 2 +- .../data_source_outscale_public_ip_test.go | 10 +- .../data_source_outscale_public_ips_test.go | 4 +- outscale/data_source_outscale_quota_test.go | 2 +- outscale/data_source_outscale_quotas_test.go | 2 +- outscale/data_source_outscale_regions_test.go | 2 +- ...ata_source_outscale_security_group_test.go | 2 +- ...source_outscale_server_certificate_test.go | 2 +- ...ource_outscale_server_certificates_test.go | 2 +- ...urce_outscale_snapshot_export_task_test.go | 6 +- ...rce_outscale_snapshot_export_tasks_test.go | 2 +- .../data_source_outscale_snapshot_test.go | 6 +- .../data_source_outscale_snapshots_test.go | 6 +- .../data_source_outscale_subregions_test.go | 4 +- outscale/data_source_outscale_tag_test.go | 2 +- ...ta_source_outscale_virtual_gateway_test.go | 4 +- ...a_source_outscale_virtual_gateways_test.go | 4 +- .../data_source_outscale_vm_state_test.go | 2 +- .../data_source_outscale_vm_states_test.go | 2 +- outscale/data_source_outscale_vm_test.go | 2 +- .../data_source_outscale_vm_types_test.go | 2 +- outscale/data_source_outscale_vms_test.go | 2 +- outscale/data_source_outscale_volume_test.go | 8 +- outscale/data_source_outscale_volumes_test.go | 31 ++-- ...ata_source_outscale_vpn_connection_test.go | 4 +- ...ta_source_outscale_vpn_connections_test.go | 4 +- outscale/resource_outscale_access_key_test.go | 8 +- .../resource_outscale_api_access_rule_test.go | 4 +- outscale/resource_outscale_ca_test.go | 2 +- .../resource_outscale_client_gateway_test.go | 4 +- .../resource_outscale_dhcp_option_test.go | 6 +- ...esource_outscale_flexible_gpu_link_test.go | 6 +- .../resource_outscale_flexible_gpu_test.go | 4 +- ...esource_outscale_image_export_task_test.go | 2 +- outscale/resource_outscale_image_test.go | 2 +- ...resource_outscale_internet_service_test.go | 2 +- outscale/resource_outscale_keypair_test.go | 7 +- ..._outscale_load_balancer_attributes_test.go | 20 ++- ...urce_outscale_load_balancer_policy_test.go | 10 +- .../resource_outscale_load_balancer_test.go | 4 +- ...esource_outscale_load_balancer_vms_test.go | 6 +- outscale/resource_outscale_public_ip_test.go | 12 +- ...ource_outscale_security_group_rule_test.go | 4 +- ...source_outscale_server_certificate_test.go | 2 +- ...urce_outscale_snapshot_export_task_test.go | 2 +- outscale/resource_outscale_snapshot_test.go | 20 +-- outscale/resource_outscale_tags_test.go | 18 +-- ...urce_outscale_virtual_gateway_link_test.go | 2 +- outscale/resource_outscale_vm_test.go | 148 ++++-------------- outscale/resource_outscale_volume_test.go | 53 +++++-- .../resource_outscale_volumes_link_test.go | 4 +- ...urce_outscale_vpn_connection_route_test.go | 10 +- utils/utils.go | 4 +- 80 files changed, 270 insertions(+), 378 deletions(-) diff --git a/.github/workflows/acceptance_test.yml b/.github/workflows/acceptance_test.yml index 67b01bdfa..addf48b82 100644 --- a/.github/workflows/acceptance_test.yml +++ b/.github/workflows/acceptance_test.yml @@ -33,7 +33,7 @@ jobs: - name: Build go test run: make test - name: Run acceptance tests - run: make testacc + run: make test-net env: OUTSCALE_ACCESSKEYID: ${{ secrets.OSC_ACCESS_KEY }} OUTSCALE_SECRETKEYID: ${{ secrets.OSC_SECRET_KEY }} diff --git a/outscale/data_source_outscale_access_key_test.go b/outscale/data_source_outscale_access_key_test.go index 981ad247a..93537cb5a 100644 --- a/outscale/data_source_outscale_access_key_test.go +++ b/outscale/data_source_outscale_access_key_test.go @@ -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" @@ -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" diff --git a/outscale/data_source_outscale_access_keys_test.go b/outscale/data_source_outscale_access_keys_test.go index 170987e65..c4a702cee 100644 --- a/outscale/data_source_outscale_access_keys_test.go +++ b/outscale/data_source_outscale_access_keys_test.go @@ -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" @@ -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" @@ -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] } ` } @@ -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] } } ` diff --git a/outscale/data_source_outscale_account_test.go b/outscale/data_source_outscale_account_test.go index c8e00de76..73012b166 100644 --- a/outscale/data_source_outscale_account_test.go +++ b/outscale/data_source_outscale_account_test.go @@ -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() { diff --git a/outscale/data_source_outscale_accounts_test.go b/outscale/data_source_outscale_accounts_test.go index fb0280344..feb3f973d 100644 --- a/outscale/data_source_outscale_accounts_test.go +++ b/outscale/data_source_outscale_accounts_test.go @@ -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() { diff --git a/outscale/data_source_outscale_api_access_rule_test.go b/outscale/data_source_outscale_api_access_rule_test.go index 31c92ac21..cfc67681b 100644 --- a/outscale/data_source_outscale_api_access_rule_test.go +++ b/outscale/data_source_outscale_api_access_rule_test.go @@ -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" @@ -78,7 +78,7 @@ 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" } @@ -86,7 +86,7 @@ resource "outscale_api_access_rule" "rule_data" { 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 { diff --git a/outscale/data_source_outscale_ca_test.go b/outscale/data_source_outscale_ca_test.go index ee3bbaa39..6ddd0f59e 100644 --- a/outscale/data_source_outscale_ca_test.go +++ b/outscale/data_source_outscale_ca_test.go @@ -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{ diff --git a/outscale/data_source_outscale_cas_test.go b/outscale/data_source_outscale_cas_test.go index 0a361cbc5..2207d1ce2 100644 --- a/outscale/data_source_outscale_cas_test.go +++ b/outscale/data_source_outscale_cas_test.go @@ -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{ diff --git a/outscale/data_source_outscale_client_gateway_test.go b/outscale/data_source_outscale_client_gateway_test.go index c4801504f..a27a1c913 100644 --- a/outscale/data_source_outscale_client_gateway_test.go +++ b/outscale/data_source_outscale_client_gateway_test.go @@ -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)) @@ -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) @@ -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) }, @@ -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) } @@ -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) diff --git a/outscale/data_source_outscale_client_gateways_test.go b/outscale/data_source_outscale_client_gateways_test.go index 59175acb2..dd8c6767c 100644 --- a/outscale/data_source_outscale_client_gateways_test.go +++ b/outscale/data_source_outscale_client_gateways_test.go @@ -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, @@ -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, @@ -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] } ` @@ -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] } } ` diff --git a/outscale/data_source_outscale_dhcp_option_test.go b/outscale/data_source_outscale_dhcp_option_test.go index 996de273c..afbe10093 100644 --- a/outscale/data_source_outscale_dhcp_option_test.go +++ b/outscale/data_source_outscale_dhcp_option_test.go @@ -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" @@ -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" diff --git a/outscale/data_source_outscale_dhcp_options_test.go b/outscale/data_source_outscale_dhcp_options_test.go index c90d9022c..2e64abd4c 100644 --- a/outscale/data_source_outscale_dhcp_options_test.go +++ b/outscale/data_source_outscale_dhcp_options_test.go @@ -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)) @@ -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)) diff --git a/outscale/data_source_outscale_flexible_gpu_catalog_test.go b/outscale/data_source_outscale_flexible_gpu_catalog_test.go index bd6a138ee..4faabcea3 100644 --- a/outscale/data_source_outscale_flexible_gpu_catalog_test.go +++ b/outscale/data_source_outscale_flexible_gpu_catalog_test.go @@ -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() { diff --git a/outscale/data_source_outscale_flexible_gpu_test.go b/outscale/data_source_outscale_flexible_gpu_test.go index 0cae0b64d..5a1d781bb 100644 --- a/outscale/data_source_outscale_flexible_gpu_test.go +++ b/outscale/data_source_outscale_flexible_gpu_test.go @@ -8,8 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPIFlexibleGpu_basic(t *testing.T) { - t.Parallel() +func TestAccOthers_DataSourceFlexibleGpu_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -26,17 +25,17 @@ func TestAccDataSourceOutscaleOAPIFlexibleGpu_basic(t *testing.T) { func testAccDataSourceOutscaleOAPIFlexibleGpuConfig(region string) string { return fmt.Sprintf(` - resource "outscale_flexible_gpu" "fGPU-1" { + resource "outscale_flexible_gpu" "dataGPU" { model_name = "nvidia-p6" generation = "v5" 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" @@ -56,7 +55,7 @@ func testAccDataSourceOutscaleOAPIFlexibleGpuConfig(region string) string { } filter { name = "subregion_names" - values = ["%[1]s"] + values = ["%[1]sa"] } } `, region) diff --git a/outscale/data_source_outscale_flexible_gpus_test.go b/outscale/data_source_outscale_flexible_gpus_test.go index 37b2abea0..6ca38ae18 100644 --- a/outscale/data_source_outscale_flexible_gpus_test.go +++ b/outscale/data_source_outscale_flexible_gpus_test.go @@ -8,8 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPIFlexibleGpus_basic(t *testing.T) { - t.Parallel() +func TestAccOthers_DataSourceFlexibleGpus_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -26,10 +25,10 @@ func TestAccDataSourceOutscaleOAPIFlexibleGpus_basic(t *testing.T) { func testAccDataSourceOutscaleOAPIFlexibleGpusConfig(region string) string { return fmt.Sprintf(` - resource "outscale_flexible_gpu" "fGPUS-1" { + resource "outscale_flexible_gpu" "fGPUS-1" { model_name = "nvidia-p6" generation = "v5" - subregion_name = "%sb" + subregion_name = "%sa" delete_on_vm_deletion = true } @@ -56,8 +55,8 @@ func testAccDataSourceOutscaleOAPIFlexibleGpusConfig(region string) string { } filter { name = "subregion_names" - values = ["%[1]s"] + values = ["%[1]sa"] } } - `, region, region) + `, region) } diff --git a/outscale/data_source_outscale_image_export_task_test.go b/outscale/data_source_outscale_image_export_task_test.go index 185f349bc..452e80cc0 100644 --- a/outscale/data_source_outscale_image_export_task_test.go +++ b/outscale/data_source_outscale_image_export_task_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPIImageExportTaskDataSource_basic(t *testing.T) { +func TestAccVM_withImageExportTaskDataSource_basic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") imageName := acctest.RandomWithPrefix("test-image-name") diff --git a/outscale/data_source_outscale_image_export_tasks_test.go b/outscale/data_source_outscale_image_export_tasks_test.go index 57dbb22e8..ae58f7bdb 100644 --- a/outscale/data_source_outscale_image_export_tasks_test.go +++ b/outscale/data_source_outscale_image_export_tasks_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPIImageExportTasksDataSource_basic(t *testing.T) { +func TestAccVM_withImageExportTasksDataSource_basic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") imageName := acctest.RandomWithPrefix("test-image-name") diff --git a/outscale/data_source_outscale_image_test.go b/outscale/data_source_outscale_image_test.go index c9a3a7c05..14a09aedf 100644 --- a/outscale/data_source_outscale_image_test.go +++ b/outscale/data_source_outscale_image_test.go @@ -11,29 +11,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIImageDataSource_Instance(t *testing.T) { - t.Parallel() - omi := os.Getenv("OUTSCALE_IMAGEID") - imageName := fmt.Sprintf("image-test-%d", acctest.RandInt()) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: testAccCheckOutscaleOAPIImageConfigBasic(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), - Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIImageDataSourceID("data.outscale_image.nat_ami"), - resource.TestCheckResourceAttr("data.outscale_image.nat_ami", "architecture", "x86_64"), - ), - }, - }, - }) -} - -func TestAccOutscaleOAPIImageDataSource_basic(t *testing.T) { +func TestAccVM_WithImageDataSource_basic(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") imageName := fmt.Sprintf("image-test-%d", acctest.RandInt()) @@ -80,34 +58,14 @@ func testAccCheckOutscaleOAPIImageDataSourceBasicConfig(omi, vmType, region, ima resource "outscale_image" "image" { image_name = "%[4]s" - vm_id = "${outscale_vm.basic.id}" + vm_id = outscale_vm.basic.id } data "outscale_image" "omi" { filter { name = "image_ids" - values = ["${outscale_image.image.id}"] + values = [outscale_image.image.id] } } `, omi, vmType, region, imageName) } - -func testAccCheckOutscaleOAPIImageConfigBasic(omi, vmType, region, imageName string) string { - return fmt.Sprintf(` - resource "outscale_vm" "basic" { - image_id = "%[1]s" - vm_type = "%[2]s" - keypair_name = "terraform-basic" - placement_subregion_name = "%[3]sa" - } - - resource "outscale_image" "foo" { - image_name = "%[4]s" - vm_id = "${outscale_vm.basic.id}" - } - - data "outscale_image" "nat_ami" { - image_id = "${outscale_image.foo.id}" - } - `, omi, vmType, region, imageName) -} diff --git a/outscale/data_source_outscale_images_test.go b/outscale/data_source_outscale_images_test.go index bf74ab817..ebcd9580c 100644 --- a/outscale/data_source_outscale_images_test.go +++ b/outscale/data_source_outscale_images_test.go @@ -11,7 +11,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIImagesDataSource_Instance(t *testing.T) { +func TestAccVM_WithImagesDataSource_basic(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") imageName := fmt.Sprintf("image-test-%d", acctest.RandInt()) @@ -65,18 +65,18 @@ func testAccCheckOutscaleOAPIImagesDataSourceConfig(omi, vmType, region, imageNa resource "outscale_image" "image_one" { image_name = "%[4]s-one" - vm_id = "${outscale_vm.basic_one.id}" + vm_id = outscale_vm.basic_one.id } resource "outscale_image" "image_two" { image_name = "%[4]s-two" - vm_id = "${outscale_vm.basic_two.id}" + vm_id = outscale_vm.basic_two.id } data "outscale_images" "nat_ami" { filter { name = "image_ids" - values = ["${outscale_image.image_one.id}", "${outscale_image.image_two.id}"] + values = [outscale_image.image_one.id, outscale_image.image_two.id] } } `, omi, vmType, region, imageName) diff --git a/outscale/data_source_outscale_internet_service_test.go b/outscale/data_source_outscale_internet_service_test.go index e06aa905b..478080916 100644 --- a/outscale/data_source_outscale_internet_service_test.go +++ b/outscale/data_source_outscale_internet_service_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPIInternetServiceDatasource_basic(t *testing.T) { +func TestAccOthers_InternetServiceDatasource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -28,7 +28,7 @@ const testAccOutscaleOAPIInternetServiceDatasourceConfig = ` data "outscale_internet_service" "outscale_internet_serviced" { filter { name = "internet_service_ids" - values = ["${outscale_internet_service.outscale_internet_service.internet_service_id}"] + values = [outscale_internet_service.outscale_internet_service.internet_service_id] } } ` diff --git a/outscale/data_source_outscale_internet_services_test.go b/outscale/data_source_outscale_internet_services_test.go index 0f77a91cf..1a554f02f 100644 --- a/outscale/data_source_outscale_internet_services_test.go +++ b/outscale/data_source_outscale_internet_services_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPIInternetServicesDatasource_basic(t *testing.T) { +func TestAccOthers_InternetServicesDatasource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -25,7 +25,7 @@ const testAccOutscaleOAPIInternetServicesDatasourceConfig = ` data "outscale_internet_services" "outscale_internet_services" { filter { name = "internet_service_id" - values = ["${outscale_internet_service.gateway.id}"] + values = [outscale_internet_service.gateway.id] } } ` diff --git a/outscale/data_source_outscale_keypair_test.go b/outscale/data_source_outscale_keypair_test.go index 73bec91e6..db2c10ff0 100644 --- a/outscale/data_source_outscale_keypair_test.go +++ b/outscale/data_source_outscale_keypair_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIKeypairDataSource_Instance(t *testing.T) { +func TestAccOthers_KeypairDataSource_Instance(t *testing.T) { t.Parallel() keyPairName := fmt.Sprintf("acc-test-keypair-%d", utils.RandIntRange(0, 400)) @@ -50,10 +50,9 @@ func testAccCheckOutscaleOAPIKeypairDataSourceConfig(keypairName string) string } data "outscale_keypair" "nat_ami" { - #keypair_name = "${outscale_keypair.a_key_pair.id}" filter { name = "keypair_names" - values = ["${outscale_keypair.a_key_pair.keypair_name}"] + values = [outscale_keypair.a_key_pair.keypair_name] } } `, keypairName) diff --git a/outscale/data_source_outscale_keypairs_test.go b/outscale/data_source_outscale_keypairs_test.go index 4a9c7c385..5ff462e8c 100644 --- a/outscale/data_source_outscale_keypairs_test.go +++ b/outscale/data_source_outscale_keypairs_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIKeypairsDataSource_Instance(t *testing.T) { +func TestAccOthers_KeypairsDataSource_Instance(t *testing.T) { t.Parallel() keyPairName := fmt.Sprintf("testacc-keypair-%d", utils.RandIntRange(0, 400)) resource.Test(t, resource.TestCase{ diff --git a/outscale/data_source_outscale_load_balancer_test.go b/outscale/data_source_outscale_load_balancer_test.go index 66349b730..12b70637c 100644 --- a/outscale/data_source_outscale_load_balancer_test.go +++ b/outscale/data_source_outscale_load_balancer_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPIDSLBU_basic(t *testing.T) { +func TestAccOthers_LBU_basic(t *testing.T) { t.Parallel() var conf oscgo.LoadBalancer diff --git a/outscale/data_source_outscale_load_balancers_test.go b/outscale/data_source_outscale_load_balancers_test.go index 31519e866..5eea5fc5d 100644 --- a/outscale/data_source_outscale_load_balancers_test.go +++ b/outscale/data_source_outscale_load_balancers_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIDSLBSU_basic(t *testing.T) { +func TestAccOthers_LBUs_basic(t *testing.T) { t.Parallel() region := fmt.Sprintf("%sa", utils.GetRegion()) numLbu := utils.RandIntRange(0, 50) @@ -33,7 +33,7 @@ func TestAccOutscaleOAPIDSLBSU_basic(t *testing.T) { func testAccDSOutscaleOAPILBsUConfig(region string, numLbu int) string { return fmt.Sprintf(` resource "outscale_load_balancer" "bar" { - subregion_names = ["%sa"] + subregion_names = ["%s"] load_balancer_name = "foobar-terraform-elb%d" listeners { diff --git a/outscale/data_source_outscale_product_type_test.go b/outscale/data_source_outscale_product_type_test.go index 8154d15cf..356afeaf3 100644 --- a/outscale/data_source_outscale_product_type_test.go +++ b/outscale/data_source_outscale_product_type_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIProductType(t *testing.T) { +func TestAccOthers_DataSourceProductType(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_product_types_test.go b/outscale/data_source_outscale_product_types_test.go index 3c521fb5e..0a558edf8 100644 --- a/outscale/data_source_outscale_product_types_test.go +++ b/outscale/data_source_outscale_product_types_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIProductTypes(t *testing.T) { +func TestAccOthers_DataSourceProductTypes(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_public_catalog_test.go b/outscale/data_source_outscale_public_catalog_test.go index 2e9501c0c..dfdeec90f 100644 --- a/outscale/data_source_outscale_public_catalog_test.go +++ b/outscale/data_source_outscale_public_catalog_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIPublicCatalog_basic(t *testing.T) { +func TestAccOthers_DataSourcePublicCatalog_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { diff --git a/outscale/data_source_outscale_public_ip_test.go b/outscale/data_source_outscale_public_ip_test.go index d3c707930..bf8c0a5a4 100644 --- a/outscale/data_source_outscale_public_ip_test.go +++ b/outscale/data_source_outscale_public_ip_test.go @@ -10,7 +10,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPIPublicIP(t *testing.T) { +func TestAccOthers_DataSourcePublicIP(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -27,7 +27,7 @@ func TestAccDataSourceOutscaleOAPIPublicIP(t *testing.T) { }) } -func TestAccDataSourceOutscaleOAPIPublicIPWithVM(t *testing.T) { +func TestAccVM_WithPublicIP(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") @@ -77,7 +77,7 @@ func testAccDataSourceOutscaleOAPIPublicIPCheck(name string) resource.TestCheckF } } -func TestAccDataSourceOutscaleOAPIPublicIP_withTags(t *testing.T) { +func TestAccOthers_DataSourcePublicIP_withTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -94,13 +94,13 @@ const testAccDataSourceOutscaleOAPIPublicIPConfig = ` resource "outscale_public_ip" "test" {} data "outscale_public_ip" "by_public_ip_id" { - public_ip_id = "${outscale_public_ip.test.public_ip_id}" + public_ip_id = outscale_public_ip.test.public_ip_id } data "outscale_public_ip" "by_public_ip" { filter { name = "public_ips" - values = ["${outscale_public_ip.test.public_ip}"] + values = [outscale_public_ip.test.public_ip] } } ` diff --git a/outscale/data_source_outscale_public_ips_test.go b/outscale/data_source_outscale_public_ips_test.go index 10662682e..b765abed0 100644 --- a/outscale/data_source_outscale_public_ips_test.go +++ b/outscale/data_source_outscale_public_ips_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIPublicIPS(t *testing.T) { +func TestAccOthers_DataSourcePublicIPS(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -28,7 +28,7 @@ func TestAccDataSourceOutscaleOAPIPublicIPS(t *testing.T) { }) } -func TestAccDataSourceOutscaleOAPIPublicIPS_withTags(t *testing.T) { +func TestAccOthers_DataSourcePublicIPS_withTags(t *testing.T) { t.Parallel() if os.Getenv("TEST_QUOTA") == "true" { resource.Test(t, resource.TestCase{ diff --git a/outscale/data_source_outscale_quota_test.go b/outscale/data_source_outscale_quota_test.go index 92ff5c236..37633a6d2 100644 --- a/outscale/data_source_outscale_quota_test.go +++ b/outscale/data_source_outscale_quota_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIQuota(t *testing.T) { +func TestAccOthers_DataSourceQuota(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_quotas_test.go b/outscale/data_source_outscale_quotas_test.go index 7062de18b..c8809dc2a 100644 --- a/outscale/data_source_outscale_quotas_test.go +++ b/outscale/data_source_outscale_quotas_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourcesOutscaleOAPIQuotas(t *testing.T) { +func TestAccOthers_DataSourcesQuotas(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_regions_test.go b/outscale/data_source_outscale_regions_test.go index 485bef254..5c9f91e85 100644 --- a/outscale/data_source_outscale_regions_test.go +++ b/outscale/data_source_outscale_regions_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIRegionsDataSource_basic(t *testing.T) { +func TestAccOthers_RegionsDataSource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { diff --git a/outscale/data_source_outscale_security_group_test.go b/outscale/data_source_outscale_security_group_test.go index a0091a1f6..856159b2c 100644 --- a/outscale/data_source_outscale_security_group_test.go +++ b/outscale/data_source_outscale_security_group_test.go @@ -102,7 +102,7 @@ func testAccDataSourceOutscaleOAPISecurityGroupConfig(rInt int) string { #data "outscale_security_group" "by_filter" { # filter { # name = "security_group_names" - # values = ["${outscale_security_group.test.security_group_name}"] + # values = [outscale_security_group.test.security_group_name] # } #}`, rInt, rInt) } diff --git a/outscale/data_source_outscale_server_certificate_test.go b/outscale/data_source_outscale_server_certificate_test.go index bf68db7a0..b4b80e140 100644 --- a/outscale/data_source_outscale_server_certificate_test.go +++ b/outscale/data_source_outscale_server_certificate_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform/helper/acctest" ) -func TestAccOutscaleOAPIServerCertificateDatasource_basic(t *testing.T) { +func TestAccOthers_ServerCertificateDatasource_basic(t *testing.T) { t.Parallel() rName := acctest.RandomWithPrefix("acc-test") body := `-----BEGIN CERTIFICATE----- diff --git a/outscale/data_source_outscale_server_certificates_test.go b/outscale/data_source_outscale_server_certificates_test.go index 87d4afc47..cf3cce28d 100644 --- a/outscale/data_source_outscale_server_certificates_test.go +++ b/outscale/data_source_outscale_server_certificates_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPIServerCertificatesDatasource_basic(t *testing.T) { +func TestAccOthers_ServerCertificatesDatasource_basic(t *testing.T) { t.Parallel() rName := acctest.RandomWithPrefix("acc-test") body := `-----BEGIN CERTIFICATE----- diff --git a/outscale/data_source_outscale_snapshot_export_task_test.go b/outscale/data_source_outscale_snapshot_export_task_test.go index 7ea430d4c..0896a71a9 100644 --- a/outscale/data_source_outscale_snapshot_export_task_test.go +++ b/outscale/data_source_outscale_snapshot_export_task_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPISnapshotExportTaskDataSource_basic(t *testing.T) { +func TestAccOthers_SnapshotExportTaskDataSource_basic(t *testing.T) { t.Parallel() imageName := acctest.RandomWithPrefix("terraform-export-") resource.Test(t, resource.TestCase{ @@ -60,7 +60,7 @@ func testAccOutscaleOAPISnapshotExportTaskDataSourceConfig(testName, region stri snapshot_id = outscale_snapshot.outscale_snapshot.snapshot_id osu_export { disk_image_format = "qcow2" - osu_bucket = "%s" + osu_bucket = "%[1]s" osu_prefix = "new-export" } } @@ -72,5 +72,5 @@ func testAccOutscaleOAPISnapshotExportTaskDataSourceConfig(testName, region stri } } ` - return fmt.Sprintf(stringTemplate, testName) + return fmt.Sprintf(stringTemplate, testName, region) } diff --git a/outscale/data_source_outscale_snapshot_export_tasks_test.go b/outscale/data_source_outscale_snapshot_export_tasks_test.go index 92277819c..85e3f6bbf 100644 --- a/outscale/data_source_outscale_snapshot_export_tasks_test.go +++ b/outscale/data_source_outscale_snapshot_export_tasks_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPISnapshotExportTasksDataSource_basic(t *testing.T) { +func TestAccOthers_SnapshotExportTasksDataSource_basic(t *testing.T) { imageName := acctest.RandomWithPrefix("terraform-export") resource.Test(t, resource.TestCase{ PreCheck: func() { diff --git a/outscale/data_source_outscale_snapshot_test.go b/outscale/data_source_outscale_snapshot_test.go index 551325e3f..ed3d92342 100644 --- a/outscale/data_source_outscale_snapshot_test.go +++ b/outscale/data_source_outscale_snapshot_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPISnapshotDataSource_basic(t *testing.T) { +func TestAccOthers_SnapshotDataSource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ @@ -27,7 +27,7 @@ func TestAccOutscaleOAPISnapshotDataSource_basic(t *testing.T) { }) } -func TestAccOutscaleOAPISnapshotDataSource_multipleFilters(t *testing.T) { +func TestAccOthers_SnapshotDataSource_multipleFilters(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ @@ -67,7 +67,7 @@ func testAccCheckOutscaleOAPISnapshotDataSourceConfig(region string) string { } resource "outscale_snapshot" "snapshot" { - volume_id = "${outscale_volume.example.id}" + volume_id = outscale_volume.example.id } data "outscale_snapshot" "snapshot" { diff --git a/outscale/data_source_outscale_snapshots_test.go b/outscale/data_source_outscale_snapshots_test.go index 04fc3bf5d..e32bea5fd 100644 --- a/outscale/data_source_outscale_snapshots_test.go +++ b/outscale/data_source_outscale_snapshots_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPISnapshotsDataSource_basic(t *testing.T) { +func TestAccOthers_SnapshotsDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -31,11 +31,11 @@ func testAccCheckOutscaleOAPISnapshotsDataSourceConfig(region string) string { } resource "outscale_snapshot" "snapshot" { - volume_id = "${outscale_volume.example.id}" + volume_id = outscale_volume.example.id } data "outscale_snapshots" "outscale_snapshots" { - snapshot_id = ["${outscale_snapshot.snapshot.id}"] + snapshot_id = [outscale_snapshot.snapshot.id] } `, region) } diff --git a/outscale/data_source_outscale_subregions_test.go b/outscale/data_source_outscale_subregions_test.go index 406dfea18..9df932512 100644 --- a/outscale/data_source_outscale_subregions_test.go +++ b/outscale/data_source_outscale_subregions_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPISubregionsDataSource_Basic(t *testing.T) { +func TestAccOthers_SubregionsDataSource_Basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ @@ -28,7 +28,7 @@ func TestAccOutscaleOAPISubregionsDataSource_Basic(t *testing.T) { }) } -func TestAccOutscaleOAPISubregionsDataSource_All(t *testing.T) { +func TestAccOthers_SubregionsDataSource_All(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { diff --git a/outscale/data_source_outscale_tag_test.go b/outscale/data_source_outscale_tag_test.go index 875f13e46..20c5e513e 100644 --- a/outscale/data_source_outscale_tag_test.go +++ b/outscale/data_source_outscale_tag_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPITagDataSource(t *testing.T) { +func TestAccVM_WithTagDataSource(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") resource.Test(t, resource.TestCase{ diff --git a/outscale/data_source_outscale_virtual_gateway_test.go b/outscale/data_source_outscale_virtual_gateway_test.go index b075ed0eb..b2d47c83b 100644 --- a/outscale/data_source_outscale_virtual_gateway_test.go +++ b/outscale/data_source_outscale_virtual_gateway_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIVirtualGateway_unattached(t *testing.T) { +func TestAccOthers_DataSourceVirtualGateway_unattached(t *testing.T) { //t.Skip() t.Parallel() rInt := acctest.RandInt() @@ -40,7 +40,7 @@ func testAccDataSourceOutscaleOAPIVirtualGatewayUnattachedConfig(rInt int) strin } data "outscale_virtual_gateway" "test_by_id" { - virtual_gateway_id = "${outscale_virtual_gateway.unattached.id}" + virtual_gateway_id = outscale_virtual_gateway.unattached.id } `) } diff --git a/outscale/data_source_outscale_virtual_gateways_test.go b/outscale/data_source_outscale_virtual_gateways_test.go index f86d1bfdb..f790b9214 100644 --- a/outscale/data_source_outscale_virtual_gateways_test.go +++ b/outscale/data_source_outscale_virtual_gateways_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIVpnGateways_unattached(t *testing.T) { +func TestAccOthers_DataSourceVpnGateways_unattached(t *testing.T) { //t.Skip() t.Parallel() rInt := acctest.RandInt() @@ -33,7 +33,7 @@ func testAccDataSourceOutscaleOAPIVpnGatewaysUnattachedConfig(rInt int) string { } data "outscale_virtual_gateways" "test_by_id" { - virtual_gateway_id = ["${outscale_virtual_gateway.unattached.id}"] + virtual_gateway_id = [outscale_virtual_gateway.unattached.id] } `) } diff --git a/outscale/data_source_outscale_vm_state_test.go b/outscale/data_source_outscale_vm_state_test.go index 68b93e5b4..66871bc9f 100644 --- a/outscale/data_source_outscale_vm_state_test.go +++ b/outscale/data_source_outscale_vm_state_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccDataSourceOutscaleOAPIVmState(t *testing.T) { +func TestAccVM_StateDataSource(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") diff --git a/outscale/data_source_outscale_vm_states_test.go b/outscale/data_source_outscale_vm_states_test.go index dd81749cd..a5209f333 100644 --- a/outscale/data_source_outscale_vm_states_test.go +++ b/outscale/data_source_outscale_vm_states_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIVMStates(t *testing.T) { +func TestAccVM_StatesDataSource(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") diff --git a/outscale/data_source_outscale_vm_test.go b/outscale/data_source_outscale_vm_test.go index 084fc81d1..6b13a3383 100644 --- a/outscale/data_source_outscale_vm_test.go +++ b/outscale/data_source_outscale_vm_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIVMDataSource_basic(t *testing.T) { +func TestAccVM_DataSource_basic(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") datasourcceName := "data.outscale_vm.basic_web" diff --git a/outscale/data_source_outscale_vm_types_test.go b/outscale/data_source_outscale_vm_types_test.go index a48784442..86e990399 100644 --- a/outscale/data_source_outscale_vm_types_test.go +++ b/outscale/data_source_outscale_vm_types_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIVMTypes_basic(t *testing.T) { +func TestAccVM_TypesDataSource_basic(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") diff --git a/outscale/data_source_outscale_vms_test.go b/outscale/data_source_outscale_vms_test.go index 821808c34..20cfa0d3d 100644 --- a/outscale/data_source_outscale_vms_test.go +++ b/outscale/data_source_outscale_vms_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPIVMSDataSource_basic(t *testing.T) { +func TestAccVMS_DataSource_basic(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") diff --git a/outscale/data_source_outscale_volume_test.go b/outscale/data_source_outscale_volume_test.go index 61e538e1b..cfa21c497 100644 --- a/outscale/data_source_outscale_volume_test.go +++ b/outscale/data_source_outscale_volume_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIVolumeDataSource_basic(t *testing.T) { +func TestAccOthers_VolumeDataSource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ @@ -28,7 +28,7 @@ func TestAccOutscaleOAPIVolumeDataSource_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIVolumeDataSource_filterByTags(t *testing.T) { +func TestAccOthers_VolumeDataSource_filterByTags(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ @@ -77,7 +77,7 @@ func testAccCheckOutscaleOAPIVolumeDataSourceConfig(region string) string { data "outscale_volume" "ebs_volume" { filter { name = "volume_ids" - values = ["${outscale_volume.example.id}"] + values = [outscale_volume.example.id] } } `, region) @@ -104,7 +104,7 @@ func testAccCheckOutscaleOAPIVolumeDataSourceConfigFilterByTags(region string) s filter { name = "volume_ids" - values = ["outscale_volume.example.id"] + values = [outscale_volume.example.id] } } diff --git a/outscale/data_source_outscale_volumes_test.go b/outscale/data_source_outscale_volumes_test.go index 1b8e884eb..b2a6e8da0 100644 --- a/outscale/data_source_outscale_volumes_test.go +++ b/outscale/data_source_outscale_volumes_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIVolumesDataSource_multipleFilters(t *testing.T) { +func TestAccOthers_VolumesDataSource_multipleFilters(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ @@ -28,7 +28,7 @@ func TestAccOutscaleOAPIVolumesDataSource_multipleFilters(t *testing.T) { }) } -func TestAccOutscaleOAPIVolumeDataSource_multipleVIdsFilters(t *testing.T) { +func TestAccOthers_VolumeDataSource_multipleVIdsFilters(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ @@ -46,7 +46,7 @@ func TestAccOutscaleOAPIVolumeDataSource_multipleVIdsFilters(t *testing.T) { }) } -func TestAccOutscaleOAPIVolumesDataSource_withVM(t *testing.T) { +func TestAccVM_withVolumesDataSource(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -84,12 +84,12 @@ func testAccCheckOutscaleOAPIVolumeDataSourceConfigWithMultipleFilters(region st data "outscale_volumes" "ebs_volume" { filter { name = "volume_sizes" - values = ["${outscale_volume.external.size}"] + values = [outscale_volume.external.size] } filter { name = "volume_types" - values = ["${outscale_volume.external.volume_type}"] + values = [outscale_volume.external.volume_type] } } `, region) @@ -110,7 +110,7 @@ func testAccCheckOutscaleOAPIVolumesDataSourceConfigWithMultipleVolumeIDsFilter( data "outscale_volumes" "outscale_volumes" { filter { name = "volume_ids" - values = ["${outscale_volume.outscale_volume.volume_id}", "${outscale_volume.outscale_volume2.volume_id}"] + values = [outscale_volume.outscale_volume.volume_id, outscale_volume.outscale_volume2.volume_id] } } `, region) @@ -141,11 +141,10 @@ func testAccCheckOutscaleOAPIVolumesDataSourceConfigWithVM(region, imageID, keyp resource "outscale_volume" "outscale_volume3" { subregion_name = "%[1]sa" size = 40 - iops = 100 - volume_type = "io1" + volume_type = "gp2" tags { key = "type" - value = "io1" + value = "gp2" } } @@ -168,26 +167,26 @@ func testAccCheckOutscaleOAPIVolumesDataSourceConfigWithVM(region, imageID, keyp resource "outscale_volumes_link" "outscale_volumes_link" { device_name = "/dev/xvdc" - volume_id = "${outscale_volume.outscale_volume.id}" - vm_id = "${outscale_vm.outscale_vm.id}" + volume_id = outscale_volume.outscale_volume.id + vm_id = outscale_vm.outscale_vm.id } resource "outscale_volumes_link" "outscale_volumes_link_2" { device_name = "/dev/xvdd" - volume_id = "${outscale_volume.outscale_volume2.id}" - vm_id = "${outscale_vm.outscale_vm.id}" + volume_id = outscale_volume.outscale_volume2.id + vm_id = outscale_vm.outscale_vm.id } resource "outscale_volumes_link" "outscale_volumes_link_3" { device_name = "/dev/xvde" - volume_id = "${outscale_volume.outscale_volume3.id}" - vm_id = "${outscale_vm.outscale_vm.id}" + volume_id = outscale_volume.outscale_volume3.id + vm_id = outscale_vm.outscale_vm.id } data "outscale_volumes" "outscale_volumes" { filter { name = "link_volume_vm_ids" - values = ["${outscale_vm.outscale_vm.vm_id}"] + values = [outscale_vm.outscale_vm.vm_id] } } `, region, imageID, keypair, sgId) diff --git a/outscale/data_source_outscale_vpn_connection_test.go b/outscale/data_source_outscale_vpn_connection_test.go index 66a425f6a..44605d8b4 100644 --- a/outscale/data_source_outscale_vpn_connection_test.go +++ b/outscale/data_source_outscale_vpn_connection_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleVPNConnectionDataSource_basic(t *testing.T) { +func TestAccOthers_VPNConnectionDataSource_basic(t *testing.T) { t.Parallel() publicIP := fmt.Sprintf("172.0.0.%d", utils.RandIntRange(1, 255)) @@ -24,7 +24,7 @@ func TestAccOutscaleVPNConnectionDataSource_basic(t *testing.T) { }) } -func TestAccOutscaleVPNConnectionDataSource_withFilters(t *testing.T) { +func TestAccOthers_VPNConnectionDataSource_withFilters(t *testing.T) { t.Parallel() publicIP := fmt.Sprintf("172.0.0.%d", utils.RandIntRange(1, 255)) diff --git a/outscale/data_source_outscale_vpn_connections_test.go b/outscale/data_source_outscale_vpn_connections_test.go index 1d6b52d6c..187c76a76 100644 --- a/outscale/data_source_outscale_vpn_connections_test.go +++ b/outscale/data_source_outscale_vpn_connections_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleVPNConnectionsDataSource_basic(t *testing.T) { +func TestAccOthers_VPNConnectionsDataSource_basic(t *testing.T) { t.Parallel() publicIP := fmt.Sprintf("172.0.0.%d", utils.RandIntRange(1, 255)) @@ -23,7 +23,7 @@ func TestAccOutscaleVPNConnectionsDataSource_basic(t *testing.T) { }) } -func TestAccOutscaleVPNConnectionsDataSource_withFilters(t *testing.T) { +func TestAccOthers_VPNConnectionsDataSource_withFilters(t *testing.T) { t.Parallel() publicIP := fmt.Sprintf("172.0.0.%d", utils.RandIntRange(1, 255)) diff --git a/outscale/resource_outscale_access_key_test.go b/outscale/resource_outscale_access_key_test.go index c8a177742..c2ddfbd46 100644 --- a/outscale/resource_outscale_access_key_test.go +++ b/outscale/resource_outscale_access_key_test.go @@ -12,7 +12,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleAccessKey_basic(t *testing.T) { +func TestAccOthers_AccessKey_basic(t *testing.T) { t.Parallel() resourceName := "outscale_access_key.outscale_access_key" @@ -38,7 +38,7 @@ func TestAccOutscaleAccessKey_basic(t *testing.T) { }) } -func TestAccOutscaleAccessKey_updatedToInactivedKey(t *testing.T) { +func TestAccOthers_AccessKey_updatedToInactivedKey(t *testing.T) { t.Parallel() resourceName := "outscale_access_key.outscale_access_key" @@ -80,7 +80,7 @@ func TestAccOutscaleAccessKey_updatedToInactivedKey(t *testing.T) { }) } -func TestAccOutscaleAccessKey_updatedToActivedKey(t *testing.T) { +func TestAccOthers_AccessKey_updatedToActivedKey(t *testing.T) { resourceName := "outscale_access_key.outscale_access_key" state := "INACTIVE" @@ -121,7 +121,7 @@ func TestAccOutscaleAccessKey_updatedToActivedKey(t *testing.T) { }) } -func TestAccOutscaleAccessKey_updatedExpirationDate(t *testing.T) { +func TestAccOthers_AccessKey_updatedExpirationDate(t *testing.T) { resourceName := "outscale_access_key.outscale_access_key" expirDate := time.Now().AddDate(1, 1, 0).Format("2006-01-02") expirDateUpdated := time.Now().AddDate(1, 4, 0).Format("2006-01-02") diff --git a/outscale/resource_outscale_api_access_rule_test.go b/outscale/resource_outscale_api_access_rule_test.go index be8f9fee8..01f2ae58d 100644 --- a/outscale/resource_outscale_api_access_rule_test.go +++ b/outscale/resource_outscale_api_access_rule_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIApiAccessRule_basic(t *testing.T) { +func TestAccOthers_AccessRule_basic(t *testing.T) { t.Parallel() resourceName := "outscale_api_access_rule.rule_test" @@ -124,7 +124,7 @@ resource "outscale_ca" "ca_rule" { } resource "outscale_api_access_rule" "rule_test" { - ca_ids = ["${outscale_ca.ca_rule.id}"] + ca_ids = [outscale_ca.ca_rule.id] ip_ranges = ["192.0.2.0/16"] description = "testing api access rule" } diff --git a/outscale/resource_outscale_ca_test.go b/outscale/resource_outscale_ca_test.go index 6c70a3d79..1ddc934b5 100644 --- a/outscale/resource_outscale_ca_test.go +++ b/outscale/resource_outscale_ca_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPICa_basic(t *testing.T) { +func TestAccOthers_Ca_basic(t *testing.T) { t.Parallel() resourceName := "outscale_ca.ca_test" diff --git a/outscale/resource_outscale_client_gateway_test.go b/outscale/resource_outscale_client_gateway_test.go index c0c96c29d..817758211 100644 --- a/outscale/resource_outscale_client_gateway_test.go +++ b/outscale/resource_outscale_client_gateway_test.go @@ -14,7 +14,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleClientGateway_basic(t *testing.T) { +func TestAccOthers_ClientGateway_basic(t *testing.T) { t.Parallel() resourceName := "outscale_client_gateway.foo" rBgpAsn := utils.RandIntRange(64512, 65534) @@ -52,7 +52,7 @@ func TestAccOutscaleClientGateway_basic(t *testing.T) { }) } -func TestAccOutscaleClientGateway_withTags(t *testing.T) { +func TestAccOthers_ClientGateway_withTags(t *testing.T) { resourceName := "outscale_client_gateway.foo" value := fmt.Sprintf("testacc-%s", acctest.RandString(5)) valueUpdated := fmt.Sprintf("testacc-%s", acctest.RandString(5)) diff --git a/outscale/resource_outscale_dhcp_option_test.go b/outscale/resource_outscale_dhcp_option_test.go index a7b22a86a..311688b92 100644 --- a/outscale/resource_outscale_dhcp_option_test.go +++ b/outscale/resource_outscale_dhcp_option_test.go @@ -17,7 +17,7 @@ import ( oscgo "github.com/outscale/osc-sdk-go/v2" ) -func TestAccOutscaleOAPIDhcpOptional_basic(t *testing.T) { +func TestAccOthers_DhcpOptional_basic(t *testing.T) { t.Parallel() resourceName := "outscale_dhcp_option.foo" value := fmt.Sprintf("test-acc-value-%s", acctest.RandString(5)) @@ -67,7 +67,7 @@ func TestAccOutscaleOAPIDhcpOptional_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIDhcpOptional_withEmptyAttrs(t *testing.T) { +func TestAccOthers_DhcpOptional_withEmptyAttrs(t *testing.T) { resourceName := "outscale_dhcp_option.foo" value := fmt.Sprintf("test-acc-value-%s", acctest.RandString(5)) @@ -164,7 +164,7 @@ func TestAccNet_withDhcpOptional(t *testing.T) { }) } -func TestAccOutscaleDHCPOption_importBasic(t *testing.T) { +func TestAccOthers_DHCPOption_importBasic(t *testing.T) { resourceName := "outscale_dhcp_option.foo" value := fmt.Sprintf("test-acc-value-%s", acctest.RandString(5)) diff --git a/outscale/resource_outscale_flexible_gpu_link_test.go b/outscale/resource_outscale_flexible_gpu_link_test.go index b220ba409..54e15238f 100644 --- a/outscale/resource_outscale_flexible_gpu_link_test.go +++ b/outscale/resource_outscale_flexible_gpu_link_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIFlexibleGpuLink_basic(t *testing.T) { +func TestAccVM_withFlexibleGpuLink_basic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") resource.Test(t, resource.TestCase{ @@ -31,14 +31,14 @@ func testAccOutscaleOAPIFlexibleGpuLinkConfig(omi, vmType, region string) string image_id = "%s" vm_type = "%s" keypair_name = "terraform-basic" - placement_subregion_name = "%[3]sb" + placement_subregion_name = "%[3]sa" } resource "outscale_flexible_gpu" "fGPU-1" { model_name = "nvidia-p6" generation = "v5" - subregion_name = "%[3]sb" + subregion_name = "%[3]sa" delete_on_vm_deletion = true } diff --git a/outscale/resource_outscale_flexible_gpu_test.go b/outscale/resource_outscale_flexible_gpu_test.go index e252c4ccc..d7016b4e2 100644 --- a/outscale/resource_outscale_flexible_gpu_test.go +++ b/outscale/resource_outscale_flexible_gpu_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIFlexibleGpu_basic(t *testing.T) { +func TestAccOthers_FlexibleGpu_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ @@ -29,7 +29,7 @@ func testAccOutscaleOAPIFlexibleGpuConfig(region string) string { resource "outscale_flexible_gpu" "fGPU-1" { model_name = "nvidia-p6" generation = "v5" - subregion_name = "%sb" + subregion_name = "%sa" delete_on_vm_deletion = true } diff --git a/outscale/resource_outscale_image_export_task_test.go b/outscale/resource_outscale_image_export_task_test.go index accd19dbe..5aa84df40 100644 --- a/outscale/resource_outscale_image_export_task_test.go +++ b/outscale/resource_outscale_image_export_task_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIImageExportTask_basic(t *testing.T) { +func TestAccVM_withImageExportTask_basic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") region := utils.GetRegion() imageName := acctest.RandomWithPrefix("test-image-name") diff --git a/outscale/resource_outscale_image_test.go b/outscale/resource_outscale_image_test.go index 5eeaaa5c5..1ec51e562 100644 --- a/outscale/resource_outscale_image_test.go +++ b/outscale/resource_outscale_image_test.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIImage_basic(t *testing.T) { +func TestAccOthers_Image_basic(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") region := utils.GetRegion() diff --git a/outscale/resource_outscale_internet_service_test.go b/outscale/resource_outscale_internet_service_test.go index 7e0de3e2f..c5a7388b1 100644 --- a/outscale/resource_outscale_internet_service_test.go +++ b/outscale/resource_outscale_internet_service_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIInternetService_basic(t *testing.T) { +func TestAccOthers_InternetService_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/resource_outscale_keypair_test.go b/outscale/resource_outscale_keypair_test.go index 10079d830..1800ca16f 100644 --- a/outscale/resource_outscale_keypair_test.go +++ b/outscale/resource_outscale_keypair_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIKeyPair_basic(t *testing.T) { +func TestAccOthers_Keypair_basic(t *testing.T) { t.Parallel() var conf oscgo.Keypair @@ -37,7 +37,7 @@ func TestAccOutscaleOAPIKeyPair_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIKeyPair_retrieveName(t *testing.T) { +func TestAccOthers_Keypair_retrieveName(t *testing.T) { t.Parallel() var conf oscgo.Keypair @@ -60,7 +60,8 @@ func TestAccOutscaleOAPIKeyPair_retrieveName(t *testing.T) { }, }) } -func TestAccOutscaleOAPIKeyPair_generatedName(t *testing.T) { + +func TestAccOthers_Keypair_generatedName(t *testing.T) { t.Parallel() var conf oscgo.Keypair diff --git a/outscale/resource_outscale_load_balancer_attributes_test.go b/outscale/resource_outscale_load_balancer_attributes_test.go index 36d32f664..1f41b247c 100644 --- a/outscale/resource_outscale_load_balancer_attributes_test.go +++ b/outscale/resource_outscale_load_balancer_attributes_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPILBUAttr_basic(t *testing.T) { +func TestAccOthers_LBUAttr_basic(t *testing.T) { t.Parallel() var conf oscgo.AccessLog @@ -52,19 +52,17 @@ func testAccOutscaleOAPILBUAttrConfig(region string, r int) string { return fmt.Sprintf(` resource "outscale_load_balancer" "bar" { subregion_names = ["%sa"] - load_balancer_name = "foobar-terraform-elb-%d" + load_balancer_name = "foobar-terraform-elb-%d" listeners { - backend_port = 8000 - backend_protocol = "HTTP" - load_balancer_port = 80 + backend_port = 8000 + backend_protocol = "HTTP" + load_balancer_port = 80 load_balancer_protocol = "HTTP" } - - tags { - key = "test_baz" - value = "baz" - } - + tags { + key = "test_baz" + value = "baz" + } } resource "outscale_load_balancer_attributes" "bar2" { diff --git a/outscale/resource_outscale_load_balancer_policy_test.go b/outscale/resource_outscale_load_balancer_policy_test.go index 9b9da09b4..0788c10d6 100644 --- a/outscale/resource_outscale_load_balancer_policy_test.go +++ b/outscale/resource_outscale_load_balancer_policy_test.go @@ -10,7 +10,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleCookieStickinessPolicy_basic(t *testing.T) { +func TestAccOthers_CookieStickinessPolicy_basic(t *testing.T) { t.Parallel() lbName := fmt.Sprintf("tf-test-lb-%s", acctest.RandString(10)) zone := fmt.Sprintf("%sa", utils.GetRegion()) @@ -87,14 +87,14 @@ resource "outscale_load_balancer" "lb" { resource "outscale_load_balancer_policy" "app-policy" { policy_type = "app" policy_name = "foo-policy" - load_balancer_name = "${outscale_load_balancer.lb.id}" + load_balancer_name = outscale_load_balancer.lb.id cookie_name = "MyAppCookie" } resource "outscale_load_balancer_policy" "lb-policy" { policy_type = "load_balancer" policy_name = "lb-policy" - load_balancer_name = "${outscale_load_balancer.lb.id}" + load_balancer_name = outscale_load_balancer.lb.id cookie_expiration_period = 180 } `, rName, zone) @@ -117,14 +117,14 @@ resource "outscale_load_balancer" "lb" { resource "outscale_load_balancer_policy" "app-policy" { policy_type = "app" policy_name = "foo-policy" - load_balancer_name = "${outscale_load_balancer.lb.id}" + load_balancer_name = outscale_load_balancer.lb.id cookie_name = "MyOtherAppCookie" } resource "outscale_load_balancer_policy" "lb-policy" { policy_type = "load_balancer" policy_name = "lb-policy" - load_balancer_name = "${outscale_load_balancer.lb.id}" + load_balancer_name = outscale_load_balancer.lb.id cookie_expiration_period = 100 }`, rName, zone) } diff --git a/outscale/resource_outscale_load_balancer_test.go b/outscale/resource_outscale_load_balancer_test.go index b5d772a26..c15a74430 100644 --- a/outscale/resource_outscale_load_balancer_test.go +++ b/outscale/resource_outscale_load_balancer_test.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPILBUBasic(t *testing.T) { +func TestAccOthers_LBUBasic(t *testing.T) { t.Parallel() var conf oscgo.LoadBalancer @@ -44,7 +44,7 @@ func TestAccOutscaleOAPILBUBasic(t *testing.T) { }) } -func TestAccOutscaleOAPILBUPublicIp(t *testing.T) { +func TestAccOthers_LBUPublicIp(t *testing.T) { t.Skip("will be done soon") t.Parallel() var conf oscgo.LoadBalancer diff --git a/outscale/resource_outscale_load_balancer_vms_test.go b/outscale/resource_outscale_load_balancer_vms_test.go index c996d5477..5534b4988 100644 --- a/outscale/resource_outscale_load_balancer_vms_test.go +++ b/outscale/resource_outscale_load_balancer_vms_test.go @@ -12,7 +12,7 @@ import ( oscgo "github.com/outscale/osc-sdk-go/v2" ) -func TestAccOutscaleOAPILBUAttachment_basic(t *testing.T) { +func TestAccVM_WithLBUAttachment_basic(t *testing.T) { t.Parallel() var conf oscgo.LoadBalancer omi := os.Getenv("OUTSCALE_IMAGEID") @@ -66,8 +66,8 @@ resource "outscale_vm" "foo1" { } resource "outscale_load_balancer_vms" "foo1" { - load_balancer_name = "${outscale_load_balancer.bar.id}" - backend_vm_ids = ["${outscale_vm.foo1.id}"] + load_balancer_name = outscale_load_balancer.bar.id + backend_vm_ids = [outscale_vm.foo1.id] } `, region, omi) } diff --git a/outscale/resource_outscale_public_ip_test.go b/outscale/resource_outscale_public_ip_test.go index ae7fd36a0..77ada4b67 100644 --- a/outscale/resource_outscale_public_ip_test.go +++ b/outscale/resource_outscale_public_ip_test.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIPublicIP_basic(t *testing.T) { +func TestAccOthers_PublicIP_basic(t *testing.T) { t.Parallel() var conf oscgo.PublicIp @@ -36,7 +36,7 @@ func TestAccOutscaleOAPIPublicIP_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIPublicIP_instance(t *testing.T) { +func TestAccNet_PublicIP_instance(t *testing.T) { t.Parallel() var conf oscgo.PublicIp omi := os.Getenv("OUTSCALE_IMAGEID") @@ -72,7 +72,7 @@ func TestAccOutscaleOAPIPublicIP_instance(t *testing.T) { // // This test is an expansion of TestAccOutscalePublicIP_instance, by testing the // // associated Private PublicIPs of two instances -func TestAccOutscaleOAPIPublicIP_associated_user_private_ip(t *testing.T) { +func TestAccNet_PublicIP_associated_user_private_ip(t *testing.T) { var one oscgo.PublicIp omi := os.Getenv("OUTSCALE_IMAGEID") region := utils.GetRegion() @@ -318,7 +318,7 @@ func testAccOutscaleOAPIPublicIPInstanceConfig2(omi, vmType, region, keypair, sg value = "tf-acc-test" } - net_id = "${outscale_net.net.id}" + net_id = outscale_net.net.id } resource "outscale_vm" "basic" { @@ -353,7 +353,7 @@ func testAccOutscaleOAPIPublicIPInstanceConfigAssociated(omi, vmType, region, ke value = "tf-acc-test" } - net_id = "${outscale_net.net.id}" + net_id = outscale_net.net.id } resource "outscale_vm" "basic" { @@ -396,7 +396,7 @@ func testAccOutscaleOAPIPublicIPInstanceConfigAssociatedSwitch(omi, vmType, regi value = "tf-acc-test" } - net_id = "${outscale_net.net.id}" + net_id = outscale_net.net.id } resource "outscale_vm" "basic" { diff --git a/outscale/resource_outscale_security_group_rule_test.go b/outscale/resource_outscale_security_group_rule_test.go index a487bef76..c2d94f975 100644 --- a/outscale/resource_outscale_security_group_rule_test.go +++ b/outscale/resource_outscale_security_group_rule_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleSecurityGroupRule_basic(t *testing.T) { +func TestAccOthers_SecurityGroupRule_basic(t *testing.T) { t.Parallel() resourceName := "outscale_security_group_rule.outscale_security_group_rule_https" @@ -50,7 +50,7 @@ func TestAccOutscaleSecurityGroupRule_basic(t *testing.T) { } } -func TestAccOutscaleSecurityGroupRule_withSecurityGroupMember(t *testing.T) { +func TestAccOthers_SecurityGroupRule_withSecurityGroupMember(t *testing.T) { t.Parallel() rInt := acctest.RandInt() accountID := os.Getenv("OUTSCALE_ACCOUNT") diff --git a/outscale/resource_outscale_server_certificate_test.go b/outscale/resource_outscale_server_certificate_test.go index ef17a7e99..f153dab6a 100644 --- a/outscale/resource_outscale_server_certificate_test.go +++ b/outscale/resource_outscale_server_certificate_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIServerCertificate_basic(t *testing.T) { +func TestAccOthers_ServerCertificate_basic(t *testing.T) { t.Parallel() resourceName := "outscale_server_certificate.test" rName := acctest.RandomWithPrefix("acc-test") diff --git a/outscale/resource_outscale_snapshot_export_task_test.go b/outscale/resource_outscale_snapshot_export_task_test.go index 3d477d563..6af4a48fe 100644 --- a/outscale/resource_outscale_snapshot_export_task_test.go +++ b/outscale/resource_outscale_snapshot_export_task_test.go @@ -10,7 +10,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPISnapshotExportTask_basic(t *testing.T) { +func TestAccOthers_SnapshotExportTask_basic(t *testing.T) { osuBucketNames := []string{ acctest.RandomWithPrefix("terraform-export-bucket-"), acctest.RandomWithPrefix("terraform-export-bucket-"), diff --git a/outscale/resource_outscale_snapshot_test.go b/outscale/resource_outscale_snapshot_test.go index 81c22e6ce..ac9e1733e 100644 --- a/outscale/resource_outscale_snapshot_test.go +++ b/outscale/resource_outscale_snapshot_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPISnapshot_basic(t *testing.T) { +func TestAccOthers_Snapshot_basic(t *testing.T) { t.Parallel() var v oscgo.Snapshot @@ -31,7 +31,7 @@ func TestAccOutscaleOAPISnapshot_basic(t *testing.T) { }) } -func TestAccOutscaleOAPISnapshot_withDescription(t *testing.T) { +func TestAccOthers_Snapshot_withDescription(t *testing.T) { t.Parallel() var v oscgo.Snapshot @@ -50,7 +50,7 @@ func TestAccOutscaleOAPISnapshot_withDescription(t *testing.T) { }) } -func TestAccOutscaleOAPISnapshot_CopySnapshot(t *testing.T) { +func TestAccOthers_Snapshot_CopySnapshot(t *testing.T) { t.Parallel() var v oscgo.Snapshot @@ -69,7 +69,7 @@ func TestAccOutscaleOAPISnapshot_CopySnapshot(t *testing.T) { }) } -func TestAccOutscaleOAPISnapshot_UpdateTags(t *testing.T) { +func TestAccOthers_Snapshot_UpdateTags(t *testing.T) { region := utils.GetRegion() //var v oscgo.Snapshot @@ -89,7 +89,7 @@ func TestAccOutscaleOAPISnapshot_UpdateTags(t *testing.T) { }) } -func TestAccOutscaleOAPISnapshot_importBasic(t *testing.T) { +func TestAccOthers_Snapshot_importBasic(t *testing.T) { var v oscgo.Snapshot resource.Test(t, resource.TestCase{ @@ -176,7 +176,7 @@ func testAccOutscaleOAPISnapshotConfigWithDescription(region string) string { } resource "outscale_snapshot" "test" { - volume_id = "${outscale_volume.description_test.id}" + volume_id = outscale_volume.description_test.id description = "Snapshot Acceptance Test" } `, region) @@ -190,13 +190,13 @@ func testAccOutscaleOAPISnapshotConfigCopySnapshot(region string) string { } resource "outscale_snapshot" "source" { - volume_id = "${outscale_volume.description_test.id}" + volume_id = outscale_volume.description_test.id description = "Source Snapshot Acceptance Test" } resource "outscale_snapshot" "test" { source_region_name = "%[1]s" - source_snapshot_id = "${outscale_snapshot.source.id}" + source_snapshot_id = outscale_snapshot.source.id description = "Target Snapshot Acceptance Test" } `, region) @@ -209,8 +209,8 @@ func testAccOutscaleOAPISnapshotConfigUpdateTags(region, value string) string { size = 10 } resource "outscale_snapshot" "outscale_snapshot" { - volume_id = "${outscale_volume.outscale_volume.volume_id}" - + volume_id = outscale_volume.outscale_volume.volume_id + tags { key = "Name" value = "%s" diff --git a/outscale/resource_outscale_tags_test.go b/outscale/resource_outscale_tags_test.go index a5cfeaa49..080039f1d 100644 --- a/outscale/resource_outscale_tags_test.go +++ b/outscale/resource_outscale_tags_test.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIVM_tags(t *testing.T) { +func TestAccVM_tags(t *testing.T) { v := &oscgo.Vm{} omi := os.Getenv("OUTSCALE_IMAGEID") @@ -148,27 +148,11 @@ func checkOAPITags(ts []oscgo.ResourceTag, key, value string) error { func testAccCheckOAPIInstanceConfigTags(omi, vmType, region, key, value string) string { return fmt.Sprintf(` - resource "outscale_net" "outscale_net" { - ip_range = "10.0.0.0/16" - - tags { - key = "Name" - value = "testacc-tags-rs" - } - } - - resource "outscale_subnet" "outscale_subnet" { - net_id = outscale_net.outscale_net.net_id - ip_range = "10.0.0.0/24" - subregion_name = "%[3]sa" - } resource "outscale_vm" "vm" { image_id = "%s" vm_type = "%s" keypair_name = "terraform-basic" placement_subregion_name = "%[3]sa" - subnet_id = outscale_subnet.outscale_subnet.subnet_id - private_ips = ["10.0.0.12"] } resource "outscale_tag" "foo" { diff --git a/outscale/resource_outscale_virtual_gateway_link_test.go b/outscale/resource_outscale_virtual_gateway_link_test.go index 481801d48..e93f39095 100644 --- a/outscale/resource_outscale_virtual_gateway_link_test.go +++ b/outscale/resource_outscale_virtual_gateway_link_test.go @@ -39,7 +39,7 @@ func TestAccNet_withpnGatewayAttachment_basic(t *testing.T) { }) } -func TestAccResourceVpnGatewayAttachment_importBasic(t *testing.T) { +func TestAccNet_VpnGatewayAttachment_importBasic(t *testing.T) { resourceName := "outscale_virtual_gateway_link.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/outscale/resource_outscale_vm_test.go b/outscale/resource_outscale_vm_test.go index b706d722d..f6fdf039b 100644 --- a/outscale/resource_outscale_vm_test.go +++ b/outscale/resource_outscale_vm_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIVM_Basic(t *testing.T) { +func TestAccVM_Basic(t *testing.T) { t.Parallel() var server oscgo.Vm @@ -46,12 +46,12 @@ func TestAccOutscaleOAPIVM_Basic(t *testing.T) { }) } -func TestAccOutscaleOAPIVMBehavior_Basic(t *testing.T) { +func TestAccVM_Behavior_Basic(t *testing.T) { t.Parallel() var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") - region := fmt.Sprintf("%sb", utils.GetRegion()) + region := fmt.Sprintf("%sa", utils.GetRegion()) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -61,36 +61,36 @@ func TestAccOutscaleOAPIVMBehavior_Basic(t *testing.T) { { Config: testAccCheckOutscaleOAPIVMBehaviorConfigBasic(omi, "tinav4.c2r2p2", region, keypair, "high", "stop"), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), + testAccCheckOutscaleOAPIVMExists("outscale_vm.basicr1", &server), testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), resource.TestCheckResourceAttr( - "outscale_vm.basic", "image_id", omi), + "outscale_vm.basicr1", "image_id", omi), resource.TestCheckResourceAttr( - "outscale_vm.basic", "vm_type", "tinav4.c2r2p2"), + "outscale_vm.basicr1", "vm_type", "tinav4.c2r2p2"), ), }, { Config: testAccCheckOutscaleOAPIVMBehaviorConfigBasic(omi, "tinav4.c2r2p2", region, keypair, "highest", "restart"), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), + testAccCheckOutscaleOAPIVMExists("outscale_vm.basicr1", &server), testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), resource.TestCheckResourceAttr( - "outscale_vm.basic", "image_id", omi), + "outscale_vm.basicr1", "image_id", omi), resource.TestCheckResourceAttr( - "outscale_vm.basic", "vm_type", "tinav4.c2r2p2"), + "outscale_vm.basicr1", "vm_type", "tinav4.c2r2p2"), ), }, }, }) } -func TestAccOutscaleOAPIVM_importBasic(t *testing.T) { +func TestAccVM_importBasic(t *testing.T) { var ( server oscgo.Vm - resourceName = "outscale_vm.basic" + resourceName = "outscale_vm.basic_import" omi = os.Getenv("OUTSCALE_IMAGEID") keypair = os.Getenv("OUTSCALE_KEYPAIR") - region = fmt.Sprintf("%sb", utils.GetRegion()) + region = fmt.Sprintf("%sa", utils.GetRegion()) ) resource.ParallelTest(t, resource.TestCase{ @@ -155,7 +155,7 @@ func TestAccNet_VM_withNicAttached(t *testing.T) { }) } -func TestAccOutscaleOAPIVM_withTags(t *testing.T) { +func TestAccVM_withTags(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -205,7 +205,7 @@ func TestAccNet_VM_withNics(t *testing.T) { }) } -func TestAccOutscaleOAPIVM_Update(t *testing.T) { +func TestAccVM_UpdateKeypair(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") sgId := os.Getenv("OUTSCALE_SECURITYGROUPID") @@ -265,33 +265,7 @@ func TestAccNet_VM_WithSubnet(t *testing.T) { }) } -func TestAccOutscaleOAPIVM_WithBlockDeviceMappings(t *testing.T) { - var server oscgo.Vm - omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") - vmType := "tinav4.c2r2p2" - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckOutscaleOAPIVMConfigWithBlockDeviceMappings(omi, vmType, utils.GetRegion(), keypair), - Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), - resource.TestCheckResourceAttr( - "outscale_vm.basic", "image_id", omi), - resource.TestCheckResourceAttr( - "outscale_vm.basic", "vm_type", vmType), - ), - }, - }, - }) -} - -func TestAccOutscaleOAPIVM_DeletionProtectionUpdate(t *testing.T) { +func TestAccVM_UpdateDeletionProtection(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -316,7 +290,7 @@ func TestAccOutscaleOAPIVM_DeletionProtectionUpdate(t *testing.T) { }) } -func TestAccOutscaleOAPIVMTags_Update(t *testing.T) { +func TestAccVM_UpdateTags(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -338,7 +312,7 @@ func TestAccOutscaleOAPIVMTags_Update(t *testing.T) { }) } -func TestAccOutscaleOAPIVM_WithNet(t *testing.T) { +func TestAccNet_WithVM_PublicIp_Link(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -364,7 +338,7 @@ func TestAccOutscaleOAPIVM_WithNet(t *testing.T) { }) } -func TestAccOutscaleOAPIVM_multiBlockDeviceMapping(t *testing.T) { +func TestAccVM_multiBlockDeviceMapping(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -410,18 +384,27 @@ func testAccCheckOutscaleVMWithMultiBlockDeviceMapping(region, omi, keypair stri delete_on_vm_deletion = true } } - + block_device_mappings { device_name = "/dev/sdb" bsu { volume_size = 30 - volume_type = "io1" - iops = 150 + volume_type = "gp2" snapshot_id = outscale_snapshot.snapshot.id delete_on_vm_deletion = false } } + block_device_mappings { + device_name = "/dev/sdc" + bsu { + volume_size = 100 + volume_type = "gp2" + snapshot_id = outscale_snapshot.snapshot.id + delete_on_vm_deletion = true + } + } + tags { key = "name" value = "VM with multiple Block Device Mappings" @@ -660,7 +643,7 @@ func testAccCheckOutscaleOAPIVMConfigBasic(omi, vmType, region, keypair string) func testAccCheckOutscaleOAPIVMConfigImport(omi, vmType, region, keypair string) string { return fmt.Sprintf(` - resource "outscale_vm" "basic" { + resource "outscale_vm" "basic_import" { image_id = "%[1]s" vm_type = "%[2]s" keypair_name = "%[4]s" @@ -773,15 +756,6 @@ func testAccCheckOutscaleOAPIVMConfigBasicWithNics(omi, vmType, keypair, region func testAccVmsConfigUpdateOAPIVMKey(omi, vmType, region, keypair, sgId string) string { return fmt.Sprintf(` - resource "outscale_net" "net" { - ip_range = "10.0.0.0/16" - - tags { - key = "Name" - value = "testacc-security-group-rs" - } - } - resource "outscale_security_group" "sg" { security_group_name = "%[4]s" description = "Used in the terraform acceptance tests" @@ -790,8 +764,6 @@ func testAccVmsConfigUpdateOAPIVMKey(omi, vmType, region, keypair, sgId string) key = "Name" value = "tf-acc-test" } - - net_id = outscale_net.net.id } resource "outscale_vm" "basic" { @@ -856,57 +828,6 @@ func testAccCheckOutscaleOAPIVMConfigWithSubnet(omi, vmType, region, keypair str `, omi, vmType, region, keypair) } -func testAccCheckOutscaleOAPIVMConfigWithBlockDeviceMappings(omi, vmType, region, keypair string) string { - return fmt.Sprintf(` - resource "outscale_volume" "external1" { - subregion_name = "%[3]sa" - size = 1 - } - - resource "outscale_snapshot" "snapshot" { - volume_id = outscale_volume.external1.id - } - - resource "outscale_vm" "basic" { - image_id = "%[1]s" - vm_type = "%[2]s" - keypair_name = "%[4]s" - - block_device_mappings { - device_name = "/dev/sdb" - no_device = "/dev/xvdb" - bsu { - volume_size = 15 - volume_type = "standard" - snapshot_id = outscale_snapshot.snapshot.id - delete_on_vm_deletion = true - } - } - - block_device_mappings { - device_name = "/dev/sdc" - bsu { - volume_size = 22 - volume_type = "io1" - iops = 150 - snapshot_id = outscale_snapshot.snapshot.id - delete_on_vm_deletion = true - } - } - - block_device_mappings { - device_name = "/dev/sdc" - bsu { - volume_size = 22 - volume_type = "io1" - iops = 150 - snapshot_id = outscale_snapshot.snapshot.id - } - } - } - `, omi, vmType, region, keypair) -} - func testAccCheckOutscaleOAPIVMConfigWithNet(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { @@ -939,8 +860,7 @@ func testAccCheckOutscaleOAPIVMConfigWithNet(omi, vmType, region, keypair string } resource "outscale_route_table" "outscale_route_table" { - net_id = "${outscale_net.outscale_net.net_id}" - + net_id = outscale_net.outscale_net.net_id tags { key = "name" value = "Terraform_RT" @@ -993,11 +913,11 @@ func assertEqual(t *testing.T, a interface{}, b interface{}, message string) { func testAccCheckOutscaleOAPIVMBehaviorConfigBasic(omi, vmType, region, keypair, perfomance, vmBehavior string) string { return fmt.Sprintf(` - resource "outscale_vm" "basic" { + resource "outscale_vm" "basicr1" { image_id = "%[1]s" vm_type = "%[2]s" keypair_name = "%[4]s" - placement_subregion_name = "%[3]sb" + placement_subregion_name = "%[3]s" vm_initiated_shutdown_behavior = "%[6]s" performance = "%[5]s" diff --git a/outscale/resource_outscale_volume_test.go b/outscale/resource_outscale_volume_test.go index 28e950880..6a9f5e1a4 100644 --- a/outscale/resource_outscale_volume_test.go +++ b/outscale/resource_outscale_volume_test.go @@ -3,6 +3,7 @@ package outscale import ( "context" "fmt" + "os" "testing" "time" @@ -13,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIVolume_basic(t *testing.T) { +func TestAccOthers_Volume_basic(t *testing.T) { t.Parallel() var v oscgo.Volume @@ -37,7 +38,7 @@ func TestAccOutscaleOAPIVolume_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIVolume_updateSize(t *testing.T) { +func TestAccOthers_Volume_updateSize(t *testing.T) { t.Parallel() region := utils.GetRegion() @@ -68,22 +69,46 @@ func TestAccOutscaleOAPIVolume_updateSize(t *testing.T) { }) } -func TestAccOutscaleOAPIVolume_io1Type(t *testing.T) { +func TestAccOthers_Volume_io1Type(t *testing.T) { t.Parallel() + if os.Getenv("IS_IO1_TEST_QUOTA") == "true" { + var v oscgo.Volume + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + IDRefreshName: "outscale_volume.test-io1", + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: test_IO1VolumeTypeConfig(utils.GetRegion()), + Check: resource.ComposeTestCheckFunc( + testAccCheckOAPIVolumeExists("outscale_volume.test-io1", &v), + ), + }, + }, + }) + } else { + t.Skip("will be done soon") + } +} + +func TestAccOthers_GP2_Volume_Type(t *testing.T) { + t.Parallel() var v oscgo.Volume resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "outscale_volume.test-io", + IDRefreshName: "outscale_volume.test-gp2", Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testOutscaleOAPIVolumeConfigIO1Type(utils.GetRegion()), + Config: test_GP2VolumeTypeConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOAPIVolumeExists("outscale_volume.test-io", &v), + testAccCheckOAPIVolumeExists("outscale_volume.test-gp2", &v), ), }, }, @@ -158,13 +183,23 @@ func testOutscaleOAPIVolumeConfigUpdateSize(region string) string { `, region) } -func testOutscaleOAPIVolumeConfigIO1Type(region string) string { +func test_IO1VolumeTypeConfig(region string) string { return fmt.Sprintf(` - resource "outscale_volume" "test-io" { + resource "outscale_volume" "test-io1" { subregion_name = "%sa" - volume_type = "io1" + volume_type = "gp2" size = 10 iops = 100 } `, region) } + +func test_GP2VolumeTypeConfig(region string) string { + return fmt.Sprintf(` + resource "outscale_volume" "test-gp2" { + subregion_name = "%sa" + volume_type = "gp2" + size = 10 + } + `, region) +} diff --git a/outscale/resource_outscale_volumes_link_test.go b/outscale/resource_outscale_volumes_link_test.go index 292534eb2..08777ff41 100644 --- a/outscale/resource_outscale_volumes_link_test.go +++ b/outscale/resource_outscale_volumes_link_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIVolumeAttachment_basic(t *testing.T) { +func TestAccVM_WithVolumeAttachment_basic(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -42,7 +42,7 @@ func TestAccOutscaleOAPIVolumeAttachment_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIVolumeAttachment_importBasic(t *testing.T) { +func TestAccVM_ImportVolumeAttachment_Basic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") diff --git a/outscale/resource_outscale_vpn_connection_route_test.go b/outscale/resource_outscale_vpn_connection_route_test.go index 397ee0d49..0ee2f9477 100644 --- a/outscale/resource_outscale_vpn_connection_route_test.go +++ b/outscale/resource_outscale_vpn_connection_route_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleVPNConnectionRoute_basic(t *testing.T) { +func TestAccOthers_VPNConnectionRoute_basic(t *testing.T) { t.Parallel() resourceName := "outscale_vpn_connection_route.foo" @@ -38,7 +38,7 @@ func TestAccOutscaleVPNConnectionRoute_basic(t *testing.T) { }) } -func TestAccOutscaleVPNConnectionRouteimport_basic(t *testing.T) { +func TestAccOthers_ImportVPNConnectionRoute_basic(t *testing.T) { t.Parallel() if os.Getenv("TEST_QUOTA") == "true" { resourceName := "outscale_vpn_connection_route.foo" @@ -177,15 +177,15 @@ func testAccOutscaleVPNConnectionRouteConfig(publicIP, destinationIPRange string } resource "outscale_vpn_connection" "vpn_connection" { - client_gateway_id = "${outscale_client_gateway.customer_gateway.id}" - virtual_gateway_id = "${outscale_virtual_gateway.virtual_gateway.id}" + client_gateway_id = outscale_client_gateway.customer_gateway.id + virtual_gateway_id = outscale_virtual_gateway.virtual_gateway.id connection_type = "ipsec.1" static_routes_only = true } resource "outscale_vpn_connection_route" "foo" { destination_ip_range = "%s" - vpn_connection_id = "${outscale_vpn_connection.vpn_connection.id}" + vpn_connection_id = outscale_vpn_connection.vpn_connection.id } `, publicIP, destinationIPRange) } diff --git a/utils/utils.go b/utils/utils.go index 5fec7432d..b603311a3 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -236,9 +236,9 @@ func I32toa(i int32) string { } func GetRegion() string { - region := fmt.Sprintf("%s", os.Getenv("TESTACC_REGION")) + region := fmt.Sprintf("%s", os.Getenv("OUTSCALE_REGION")) if region == "" { - region = "eu-west-2" + region = fmt.Sprintf("%s", os.Getenv("OSC_REGION")) } return region }