diff --git a/.github/workflows/acceptance_test.yml b/.github/workflows/acceptance_test.yml index 554aede58..addf48b82 100644 --- a/.github/workflows/acceptance_test.yml +++ b/.github/workflows/acceptance_test.yml @@ -15,7 +15,7 @@ jobs: Acceptances_tests: environment: RUNNER_ACCESS concurrency: terraform-acceptance-test - runs-on: [self-hosted, linux, us-east-2] + runs-on: [self-hosted, linux] steps: - uses: actions/checkout@v3 with: @@ -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/.github/workflows/net_testacc.yml b/.github/workflows/net_testacc.yml new file mode 100644 index 000000000..b7269b5ee --- /dev/null +++ b/.github/workflows/net_testacc.yml @@ -0,0 +1,42 @@ +name: Net Acceptances tests + +on: + pull_request_target: + branches: + - master + paths: + - '**.go' + - '**.sum' + - '**.mod' + - 'GNUmakefile' + workflow_dispatch: + +jobs: + Acceptances_tests: + environment: RUNNER_ACCESS + concurrency: terraform-acceptance-test + runs-on: [self-hosted, linux] + steps: + - uses: actions/checkout@v3 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + - uses: outscale-dev/frieza-github-actions/frieza-clean@master + with: + access_key: ${{ secrets.OSC_ACCESS_KEY }} + secret_key: ${{ secrets.OSC_SECRET_KEY }} + region: ${{ secrets.OSC_REGION }} + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '>=1.18.0' + - name: Build go test + run: make test + - name: Run net acceptance tests + run: make test-net + env: + OUTSCALE_ACCESSKEYID: ${{ secrets.OSC_ACCESS_KEY }} + OUTSCALE_SECRETKEYID: ${{ secrets.OSC_SECRET_KEY }} + OUTSCALE_REGION: ${{ secrets.OSC_REGION }} + OUTSCALE_ACCOUNT: ${{ secrets.OSC_ACCOUNT_ID }} + OUTSCALE_IMAGEID: ${{ secrets.OUTSCALE_IMAGEID }} diff --git a/GNUmakefile b/GNUmakefile index d2f3bea58..1c5be9778 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -25,6 +25,11 @@ test: fmtcheck testacc: fmtcheck TF_ACC=1 go test $(TEST) -count 1 -v -parallel 4 $(TESTARGS) -timeout 240m -cover +.PHONY: test-net +test-net: fmtcheck + TF_ACC=1 go test $(TEST) -run=TestAccNet -count 1 -v -parallel 1 $(TESTARGS) -timeout 240m -cover + + .PHONY: fmt fmt: gofmt -s -w ./main.go diff --git a/outscale/data_source_outscale_nat_service_test.go b/outscale/data_source_outscale_nat_service_test.go index f07f24add..8e2ad178f 100644 --- a/outscale/data_source_outscale_nat_service_test.go +++ b/outscale/data_source_outscale_nat_service_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPINatServiceDataSource_Instance(t *testing.T) { +func TestAccNet_WithNatServiceDataSource_Instance(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -50,7 +50,7 @@ const testAccCheckOutscaleOAPINatServiceDataSourceConfig = ` } resource "outscale_subnet" "outscale_subnet" { - net_id = "${outscale_net.outscale_net.net_id}" + net_id = outscale_net.outscale_net.net_id ip_range = "10.0.0.0/18" } @@ -58,33 +58,33 @@ const testAccCheckOutscaleOAPINatServiceDataSourceConfig = ` resource "outscale_nat_service" "outscale_nat_service" { depends_on = ["outscale_route.outscale_route"] - subnet_id = "${outscale_subnet.outscale_subnet.subnet_id}" - public_ip_id = "${outscale_public_ip.outscale_public_ip.public_ip_id}" + subnet_id = outscale_subnet.outscale_subnet.subnet_id + public_ip_id = outscale_public_ip.outscale_public_ip.public_ip_id } resource "outscale_route_table" "outscale_route_table" { - net_id = "${outscale_net.outscale_net.net_id}" + net_id = outscale_net.outscale_net.net_id } resource "outscale_route" "outscale_route" { destination_ip_range = "0.0.0.0/0" - gateway_id = "${outscale_internet_service.outscale_internet_service.internet_service_id}" - route_table_id = "${outscale_route_table.outscale_route_table.route_table_id}" + gateway_id = outscale_internet_service.outscale_internet_service.internet_service_id + route_table_id = outscale_route_table.outscale_route_table.route_table_id } resource "outscale_route_table_link" "outscale_route_table_link" { - subnet_id = "${outscale_subnet.outscale_subnet.subnet_id}" - route_table_id = "${outscale_route_table.outscale_route_table.id}" + subnet_id = outscale_subnet.outscale_subnet.subnet_id + route_table_id = outscale_route_table.outscale_route_table.id } resource "outscale_internet_service" "outscale_internet_service" {} resource "outscale_internet_service_link" "outscale_internet_service_link" { - net_id = "${outscale_net.outscale_net.net_id}" - internet_service_id = "${outscale_internet_service.outscale_internet_service.id}" + net_id = outscale_net.outscale_net.net_id}" + internet_service_id = outscale_internet_service.outscale_internet_service.id } data "outscale_nat_service" "nat" { - nat_service_id = "${outscale_nat_service.outscale_nat_service.id}" + nat_service_id = outscale_nat_service.outscale_nat_service.id } ` diff --git a/outscale/data_source_outscale_nat_services_test.go b/outscale/data_source_outscale_nat_services_test.go index b14a6813b..c66181515 100644 --- a/outscale/data_source_outscale_nat_services_test.go +++ b/outscale/data_source_outscale_nat_services_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPINatServicesDataSource_Instance(t *testing.T) { +func TestAccNet_WithNatServicesDataSource_Instance(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -35,7 +35,7 @@ const testAccCheckOutscaleOAPINatServicesDataSourceConfig = ` } resource "outscale_subnet" "outscale_subnet" { - net_id = "${outscale_net.outscale_net.net_id}" + net_id = outscale_net.outscale_net.net_id ip_range = "10.0.0.0/18" } @@ -43,12 +43,12 @@ const testAccCheckOutscaleOAPINatServicesDataSourceConfig = ` resource "outscale_nat_service" "outscale_nat_service" { depends_on = ["outscale_route.outscale_route"] - subnet_id = "${outscale_subnet.outscale_subnet.subnet_id}" - public_ip_id = "${outscale_public_ip.outscale_public_ip.public_ip_id}" + subnet_id = outscale_subnet.outscale_subnet.subnet_id + public_ip_id = outscale_public_ip.outscale_public_ip.public_ip_id } resource "outscale_route_table" "outscale_route_table" { - net_id = "${outscale_net.outscale_net.net_id}" + net_id = outscale_net.outscale_net.net_id } resource "outscale_route" "outscale_route" { diff --git a/outscale/data_source_outscale_net_access_point_services_test.go b/outscale/data_source_outscale_net_access_point_services_test.go index b1b624dc9..b3dc5da5b 100644 --- a/outscale/data_source_outscale_net_access_point_services_test.go +++ b/outscale/data_source_outscale_net_access_point_services_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPINetAccessPointServices_basic(t *testing.T) { +func TestAccNet_AccessPointServicesDataSource_basic(t *testing.T) { t.Parallel() serviceName := fmt.Sprintf("com.outscale.%s.api", utils.GetRegion()) diff --git a/outscale/data_source_outscale_net_access_point_test.go b/outscale/data_source_outscale_net_access_point_test.go index 20c167603..13511ac2a 100644 --- a/outscale/data_source_outscale_net_access_point_test.go +++ b/outscale/data_source_outscale_net_access_point_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPINetAccessPoint_basic(t *testing.T) { +func TestAccNet_AccessPointDataSource_basic(t *testing.T) { t.Parallel() serviceName := fmt.Sprintf("com.outscale.%s.api", utils.GetRegion()) diff --git a/outscale/data_source_outscale_net_access_points_test.go b/outscale/data_source_outscale_net_access_points_test.go index 808bf4025..8807c42c4 100644 --- a/outscale/data_source_outscale_net_access_points_test.go +++ b/outscale/data_source_outscale_net_access_points_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPINetAccessPoints_basic(t *testing.T) { +func TestAccNet_AccessPointsDataSource_basic(t *testing.T) { t.Parallel() serviceName := fmt.Sprintf("com.outscale.%s.api", utils.GetRegion()) diff --git a/outscale/data_source_outscale_net_attributes_test.go b/outscale/data_source_outscale_net_attributes_test.go index db3204bf6..dc3266fcb 100644 --- a/outscale/data_source_outscale_net_attributes_test.go +++ b/outscale/data_source_outscale_net_attributes_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIDSLinAttr_basic(t *testing.T) { +func TestAccNet_AttributesDataSource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -58,14 +58,12 @@ const testAccOutscaleOAPIDSLinAttrConfig = ` } } - - resource "outscale_net_attributes" "outscale_net_attributes" { - net_id = "${outscale_net.vpc.id}" + net_id = outscale_net.vpc.id dhcp_options_set_id = outscale_net.vpc2.dhcp_options_set_id } data "outscale_net_attributes" "test" { - net_id = "${outscale_net.vpc.id}" + net_id = outscale_net.vpc.id } ` diff --git a/outscale/data_source_outscale_net_peering_test.go b/outscale/data_source_outscale_net_peering_test.go index 76388baeb..3c4904807 100644 --- a/outscale/data_source_outscale_net_peering_test.go +++ b/outscale/data_source_outscale_net_peering_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccDataSourceOutscaleOAPILinPeeringConnection_basic(t *testing.T) { +func TestAccNet_PeeringConnectionDataSource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -68,14 +68,14 @@ const testAccDataSourceOutscaleOAPILinPeeringConnectionConfig = ` } resource "outscale_net_peering" "net_peering" { - accepter_net_id = "${outscale_net.net.net_id}" - source_net_id = "${outscale_net.net2.net_id}" + accepter_net_id = outscale_net.net.net_id + source_net_id = outscale_net.net2.net_id } data "outscale_net_peering" "net_peering_data" { filter { name = "net_peering_ids" - values = ["${outscale_net_peering.net_peering.net_peering_id}"] + values = [outscale_net_peering.net_peering.net_peering_id] } } ` diff --git a/outscale/data_source_outscale_net_peerings_test.go b/outscale/data_source_outscale_net_peerings_test.go index a01e34f98..0717473ce 100644 --- a/outscale/data_source_outscale_net_peerings_test.go +++ b/outscale/data_source_outscale_net_peerings_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPILinPeeringsConnection_basic(t *testing.T) { +func TestAccNet_PeeringsConnectionDataSource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_net_test.go b/outscale/data_source_outscale_net_test.go index 5273083fb..e0c87da79 100644 --- a/outscale/data_source_outscale_net_test.go +++ b/outscale/data_source_outscale_net_test.go @@ -11,7 +11,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPIVpc_basic(t *testing.T) { +func TestAccNet_DataSource_basic(t *testing.T) { t.Parallel() rand.Seed(time.Now().UTC().UnixNano()) ipRange := utils.RandVpcCidr() @@ -74,7 +74,7 @@ func testAccDataSourceOutscaleOAPIVpcConfig(ipRange, tag string) string { data "outscale_net" "by_id" { filter { name = "net_ids" - values = ["${outscale_net.test.id}"] + values = [outscale_net.test.id] } } `, ipRange, tag) diff --git a/outscale/data_source_outscale_nets_test.go b/outscale/data_source_outscale_nets_test.go index d726a6b12..0971f58ce 100644 --- a/outscale/data_source_outscale_nets_test.go +++ b/outscale/data_source_outscale_nets_test.go @@ -10,7 +10,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPIVpcs_basic(t *testing.T) { +func TestAccNets_DataSource_basic(t *testing.T) { rand.Seed(time.Now().UTC().UnixNano()) ipRange := utils.RandVpcCidr() diff --git a/outscale/data_source_outscale_nic_test.go b/outscale/data_source_outscale_nic_test.go index eac261391..30decddc5 100644 --- a/outscale/data_source_outscale_nic_test.go +++ b/outscale/data_source_outscale_nic_test.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIENIDataSource_basic(t *testing.T) { +func TestAccNet_WithNicDataSource_basic(t *testing.T) { t.Parallel() var conf oscgo.Nic @@ -36,7 +36,7 @@ func TestAccOutscaleOAPIENIDataSource_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIENIDataSource_basicFilter(t *testing.T) { +func TestAccNet_WithNicDataSource_basicFilter(t *testing.T) { t.Parallel() var conf oscgo.Nic diff --git a/outscale/data_source_outscale_nics_test.go b/outscale/data_source_outscale_nics_test.go index 014697c88..3616c7ce2 100644 --- a/outscale/data_source_outscale_nics_test.go +++ b/outscale/data_source_outscale_nics_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPINicsDataSource(t *testing.T) { +func TestAccNet_WithNicsDataSource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_route_table_test.go b/outscale/data_source_outscale_route_table_test.go index 8919f3184..a345dadbd 100644 --- a/outscale/data_source_outscale_route_table_test.go +++ b/outscale/data_source_outscale_route_table_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccDataSourceOutscaleOAPIRouteTable_basic(t *testing.T) { +func TestAccNet_WithRouteTableDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, diff --git a/outscale/data_source_outscale_route_tables_test.go b/outscale/data_source_outscale_route_tables_test.go index fa526e3ea..934239b37 100644 --- a/outscale/data_source_outscale_route_tables_test.go +++ b/outscale/data_source_outscale_route_tables_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPIRouteTables_basic(t *testing.T) { +func TestAccNet_WithRouteTablesDataSource_basic(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_security_group_test.go b/outscale/data_source_outscale_security_group_test.go index bb11876cf..856159b2c 100644 --- a/outscale/data_source_outscale_security_group_test.go +++ b/outscale/data_source_outscale_security_group_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccDataSourceOutscaleOAPISecurityGroup_basic(t *testing.T) { +func TestAccNet_WithSecurityGroupDataSource_basic(t *testing.T) { t.Parallel() rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ @@ -27,7 +27,7 @@ func TestAccDataSourceOutscaleOAPISecurityGroup_basic(t *testing.T) { }) } -func TestAccDataSourceOutscaleOAPISecurityGroupPublic(t *testing.T) { +func TestAccNet_WithSecurityGroupPublic_(t *testing.T) { t.Parallel() rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ @@ -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) } @@ -123,7 +123,7 @@ func testAccDataSourceOutscaleOAPISecurityGroupPublicConfig(rInt int) string { name = "security_group_names" // name = "group_name" - 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_security_groups_test.go b/outscale/data_source_outscale_security_groups_test.go index 0d5f911bb..8d8fbc528 100644 --- a/outscale/data_source_outscale_security_groups_test.go +++ b/outscale/data_source_outscale_security_groups_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceOutscaleOAPISecurityGroups_vpc(t *testing.T) { +func TestAccNet_WIthSecurityGroups_DataSource(t *testing.T) { rInt := acctest.RandInt() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_subnet_test.go b/outscale/data_source_outscale_subnet_test.go index 2c155b6ec..4717a9c10 100644 --- a/outscale/data_source_outscale_subnet_test.go +++ b/outscale/data_source_outscale_subnet_test.go @@ -9,7 +9,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPISubnet(t *testing.T) { +func TestAccNet_WithSubnet_DataSource(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -26,7 +26,7 @@ func TestAccDataSourceOutscaleOAPISubnet(t *testing.T) { }) } -func TestAccDataSourceOutscaleOAPISubnet_withAvailableIpsCountsFilter(t *testing.T) { +func TestAccNet_SubnetDataSource_withAvailableIpsCountsFilter(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/data_source_outscale_subnets_test.go b/outscale/data_source_outscale_subnets_test.go index 27039b9d6..c5219cee2 100644 --- a/outscale/data_source_outscale_subnets_test.go +++ b/outscale/data_source_outscale_subnets_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccDataSourceOutscaleOAPISubnets(t *testing.T) { +func TestAccNet_WithSubnetsDataSource(t *testing.T) { t.Parallel() rInt := utils.RandIntRange(16, 31) @@ -26,7 +26,7 @@ func TestAccDataSourceOutscaleOAPISubnets(t *testing.T) { }) } -func TestAccDataSourceOutscaleOAPISubnets_withAvailableIpsCountsFilter(t *testing.T) { +func TestAccNet_Subnets_withAvailableIpsCountsFilter(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -104,7 +104,7 @@ func testAccDataSourceOutscaleOAPISubnetsWithAvailableIpsCountsFilter(region str data "outscale_subnets" "by_filter" { filter { name = "available_ips_counts" - values = ["${outscale_subnet.sub1.available_ips_count}", "${outscale_subnet.sub2.available_ips_count}"] + values = [outscale_subnet.sub1.available_ips_count, outscale_subnet.sub2.available_ips_count] } } `, region) diff --git a/outscale/data_source_outscale_vm_test.go b/outscale/data_source_outscale_vm_test.go index 27066a388..084fc81d1 100644 --- a/outscale/data_source_outscale_vm_test.go +++ b/outscale/data_source_outscale_vm_test.go @@ -32,26 +32,11 @@ func TestAccOutscaleOAPIVMDataSource_basic(t *testing.T) { func testAccOAPIVMDataSourceConfig(omi, vmType, region string) string { return fmt.Sprintf(` - resource "outscale_net" "outscale_net" { - ip_range = "10.0.0.0/16" - - tags { - key = "Name" - value = "testacc-vm-ds" - } - } - - 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" "outscale_vm" { image_id = "%[1]s" vm_type = "%[2]s" keypair_name = "terraform-basic" - subnet_id = outscale_subnet.outscale_subnet.subnet_id tags { key = "name" diff --git a/outscale/data_source_outscale_volumes_test.go b/outscale/data_source_outscale_volumes_test.go index e37e3cee9..1b8e884eb 100644 --- a/outscale/data_source_outscale_volumes_test.go +++ b/outscale/data_source_outscale_volumes_test.go @@ -149,15 +149,6 @@ func testAccCheckOutscaleOAPIVolumesDataSourceConfigWithVM(region, imageID, keyp } } - 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 = "%[3]s" description = "Used in the terraform acceptance tests" @@ -166,8 +157,6 @@ func testAccCheckOutscaleOAPIVolumesDataSourceConfigWithVM(region, imageID, keyp key = "Name" value = "tf-acc-test" } - - net_id = "${outscale_net.net.id}" } resource "outscale_vm" "outscale_vm" { diff --git a/outscale/import_outscale_net_attributes_test.go b/outscale/import_outscale_net_attributes_test.go index f6aca696f..4ab74b0f8 100644 --- a/outscale/import_outscale_net_attributes_test.go +++ b/outscale/import_outscale_net_attributes_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleNetAttr_import(t *testing.T) { +func TestAccNet_Attr_import(t *testing.T) { t.Parallel() resourceName := "outscale_net_attributes.outscale_net_attributes" diff --git a/outscale/resource_outscale_dhcp_option_test.go b/outscale/resource_outscale_dhcp_option_test.go index 9480b76e7..a7b22a86a 100644 --- a/outscale/resource_outscale_dhcp_option_test.go +++ b/outscale/resource_outscale_dhcp_option_test.go @@ -116,7 +116,7 @@ func TestAccOutscaleOAPIDhcpOptional_withEmptyAttrs(t *testing.T) { }) } -func TestAccOutscaleOAPIDhcpOptional_withNet(t *testing.T) { +func TestAccNet_withDhcpOptional(t *testing.T) { t.Parallel() resourceName := "outscale_dhcp_option.outscale_dhcp_option" domainName := fmt.Sprintf("%s.compute%s.internal", utils.GetRegion(), acctest.RandString(3)) diff --git a/outscale/resource_outscale_image_launch_permission_test.go b/outscale/resource_outscale_image_launch_permission_test.go index 94829c4a9..bb56df987 100644 --- a/outscale/resource_outscale_image_launch_permission_test.go +++ b/outscale/resource_outscale_image_launch_permission_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIImageLaunchPermission_Basic(t *testing.T) { +func TestAccNet_WithImageLaunchPermission_Basic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") region := utils.GetRegion() accountID := os.Getenv("OUTSCALE_ACCOUNT") @@ -66,7 +66,7 @@ func TestAccOutscaleOAPIImageLaunchPermission_Basic(t *testing.T) { }) } -func TestAccOutscaleOAPIImageLaunchPermissionDestruction_Basic(t *testing.T) { +func TestAccNet_ImageLaunchPermissionDestruction_Basic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") region := utils.GetRegion() accountID := os.Getenv("OUTSCALE_ACCOUNT") diff --git a/outscale/resource_outscale_internet_service_link_test.go b/outscale/resource_outscale_internet_service_link_test.go index 02d7bf1b6..afe46a240 100644 --- a/outscale/resource_outscale_internet_service_link_test.go +++ b/outscale/resource_outscale_internet_service_link_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIInternetServiceLink_basic(t *testing.T) { +func TestAccNet_WithInternetServiceLink_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -35,7 +35,7 @@ func TestAccOutscaleOAPIInternetServiceLink_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIInternetServiceLink_importBasic(t *testing.T) { +func TestAccNet_WithImportInternetServiceLink_Basic(t *testing.T) { resourceName := "outscale_internet_service_link.outscale_internet_service_link" resource.ParallelTest(t, resource.TestCase{ diff --git a/outscale/resource_outscale_nat_service_test.go b/outscale/resource_outscale_nat_service_test.go index 718dc4f2a..62da98a11 100644 --- a/outscale/resource_outscale_nat_service_test.go +++ b/outscale/resource_outscale_nat_service_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPINatService_basic(t *testing.T) { +func TestAccNet_WithNatService_basic(t *testing.T) { var natService oscgo.NatService resource.Test(t, resource.TestCase{ @@ -31,7 +31,7 @@ func TestAccOutscaleOAPINatService_basic(t *testing.T) { }) } -func TestAccOutscaleOAPINatService_basicWithDataSource(t *testing.T) { +func TestAccNet_NatService_basicWithDataSource(t *testing.T) { var natService oscgo.NatService resource.Test(t, resource.TestCase{ @@ -126,7 +126,7 @@ const testAccOAPINatGatewayConfig = ` } resource "outscale_subnet" "outscale_subnet" { - net_id = "${outscale_net.outscale_net.net_id}" + net_id = outscale_net.outscale_net.net_id ip_range = "10.0.0.0/18" } @@ -134,8 +134,8 @@ const testAccOAPINatGatewayConfig = ` resource "outscale_nat_service" "outscale_nat_service" { depends_on = ["outscale_route.outscale_route"] - subnet_id = "${outscale_subnet.outscale_subnet.subnet_id}" - public_ip_id = "${outscale_public_ip.outscale_public_ip.public_ip_id}" + subnet_id = outscale_subnet.outscale_subnet.subnet_id + public_ip_id = outscale_public_ip.outscale_public_ip.public_ip_id } resource "outscale_route_table" "outscale_route_table" { diff --git a/outscale/resource_outscale_net_access_point_test.go b/outscale/resource_outscale_net_access_point_test.go index 82b08845e..ba4f9f63f 100644 --- a/outscale/resource_outscale_net_access_point_test.go +++ b/outscale/resource_outscale_net_access_point_test.go @@ -8,7 +8,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPINetAccessPoint_basic(t *testing.T) { +func TestAccNet_AccessPoint_basic(t *testing.T) { ServiceName := fmt.Sprintf("com.outscale.%s.api", utils.GetRegion()) resource.Test(t, resource.TestCase{ diff --git a/outscale/resource_outscale_net_attributes_test.go b/outscale/resource_outscale_net_attributes_test.go index 049b184f1..6d2a9e08d 100644 --- a/outscale/resource_outscale_net_attributes_test.go +++ b/outscale/resource_outscale_net_attributes_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPILinAttr_basic(t *testing.T) { +func TestAccNet_Attributes_basic(t *testing.T) { resourceName := "outscale_net_attributes.outscale_net_attributes" resource.Test(t, resource.TestCase{ @@ -25,7 +25,7 @@ func TestAccOutscaleOAPILinAttr_basic(t *testing.T) { }) } -func TestAccOutscaleOAPILinAttr_withoutDHCPID(t *testing.T) { +func TestAccNet_Attributes_withoutDHCPID(t *testing.T) { resourceName := "outscale_net_attributes.outscale_net_attributes" resource.Test(t, resource.TestCase{ diff --git a/outscale/resource_outscale_net_peering_acceptation_test.go b/outscale/resource_outscale_net_peering_acceptation_test.go index 90444e631..a680cf48e 100644 --- a/outscale/resource_outscale_net_peering_acceptation_test.go +++ b/outscale/resource_outscale_net_peering_acceptation_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPILinPeeringConnectionAccepter_sameAccount(t *testing.T) { +func TestAccNet_PeeringConnectionAccepter_sameAccount(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, diff --git a/outscale/resource_outscale_net_peering_test.go b/outscale/resource_outscale_net_peering_test.go index dc33dd7d8..4de1c2f5f 100644 --- a/outscale/resource_outscale_net_peering_test.go +++ b/outscale/resource_outscale_net_peering_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPILinPeeringConnection_basic(t *testing.T) { +func TestAccNet_PeeringConnection_basic(t *testing.T) { var connection oscgo.NetPeering resource.Test(t, resource.TestCase{ @@ -35,7 +35,7 @@ func TestAccOutscaleOAPILinPeeringConnection_basic(t *testing.T) { }) } -func TestAccOutscaleOAPILinPeeringConnection_importBasic(t *testing.T) { +func TestAccNet_PeeringConnection_importBasic(t *testing.T) { resourceName := "outscale_net_peering.foo" resource.ParallelTest(t, resource.TestCase{ @@ -67,7 +67,7 @@ func testAccCheckOutscaleOAPILinkPeeeringConnectionImportStateIDFunc(resourceNam } } -func TestAccOutscaleOAPILinPeeringConnection_plan(t *testing.T) { +func TestAccNet_PeeringConnection_plan(t *testing.T) { var connection oscgo.NetPeering // reach out and DELETE the VPC Peering connection outside of Terraform @@ -228,7 +228,7 @@ const testAccOAPIVpcPeeringConfig = ` } resource "outscale_net_peering" "foo" { - source_net_id = "${outscale_net.foo.id}" - accepter_net_id = "${outscale_net.bar.id}" + source_net_id = outscale_net.foo.id + accepter_net_id = outscale_net.bar.id } ` diff --git a/outscale/resource_outscale_net_test.go b/outscale/resource_outscale_net_test.go index b6a091a9e..24a0c9b06 100644 --- a/outscale/resource_outscale_net_test.go +++ b/outscale/resource_outscale_net_test.go @@ -13,8 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPILin_basic(t *testing.T) { - t.Parallel() +func TestAccNet_basic(t *testing.T) { var conf1 oscgo.Net var conf2 oscgo.Net @@ -38,7 +37,7 @@ func TestAccOutscaleOAPILin_basic(t *testing.T) { }) } -func TestAccOutscaleOAPILin_UpdateTags(t *testing.T) { +func TestAccNet_UpdateTags(t *testing.T) { t.Parallel() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/outscale/resource_outscale_nic_link_test.go b/outscale/resource_outscale_nic_link_test.go index baf5e1044..56525d554 100644 --- a/outscale/resource_outscale_nic_link_test.go +++ b/outscale/resource_outscale_nic_link_test.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleNicLink_Basic(t *testing.T) { +func TestAccNet_withNicLink_Basic(t *testing.T) { var conf oscgo.Nic omi := os.Getenv("OUTSCALE_IMAGEID") region := utils.GetRegion() @@ -46,7 +46,7 @@ func TestAccOutscaleNicLink_Basic(t *testing.T) { }) } -func TestAccOutscaleNicLink_importBasic(t *testing.T) { +func TestAccNet_ImportNicLink_Basic(t *testing.T) { resourceName := "outscale_nic_link.outscale_nic_link" omi := os.Getenv("OUTSCALE_IMAGEID") region := utils.GetRegion() diff --git a/outscale/resource_outscale_nic_private_ip_test.go b/outscale/resource_outscale_nic_private_ip_test.go index 14be02c59..492f55905 100644 --- a/outscale/resource_outscale_nic_private_ip_test.go +++ b/outscale/resource_outscale_nic_private_ip_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccOutscaleOAPINetworkInterfacePrivateIPBasic(t *testing.T) { +func TestAccNet_NICPrivateIPBasic(t *testing.T) { var conf oscgo.Nic resource.Test(t, resource.TestCase{ @@ -31,7 +31,7 @@ func TestAccOutscaleOAPINetworkInterfacePrivateIPBasic(t *testing.T) { }) } -func TestAccOutscaleOAPINetworkInterfacePrivateIP_importBasic(t *testing.T) { +func TestAccNet_Import_NIC_PrivateIP_Basic(t *testing.T) { resourceName := "outscale_nic_private_ip.outscale_nic_private_ip" resource.Test(t, resource.TestCase{ diff --git a/outscale/resource_outscale_nic_test.go b/outscale/resource_outscale_nic_test.go index 5ae5f109f..2c4c715bb 100644 --- a/outscale/resource_outscale_nic_test.go +++ b/outscale/resource_outscale_nic_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIENI_basic(t *testing.T) { +func TestAccNet_WithNic_basic(t *testing.T) { t.Parallel() var conf oscgo.Nic subregion := utils.GetRegion() diff --git a/outscale/resource_outscale_public_ip_link_test.go b/outscale/resource_outscale_public_ip_link_test.go index a16b189a0..38293b2e5 100644 --- a/outscale/resource_outscale_public_ip_link_test.go +++ b/outscale/resource_outscale_public_ip_link_test.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIPublicIPLink_basic(t *testing.T) { +func TestAccNet_WithPublicIPLink_basic(t *testing.T) { var a oscgo.PublicIp omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") diff --git a/outscale/resource_outscale_route_table_link_test.go b/outscale/resource_outscale_route_table_link_test.go index 4ad202b43..1ce60de2d 100644 --- a/outscale/resource_outscale_route_table_link_test.go +++ b/outscale/resource_outscale_route_table_link_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPILinkRouteTable_basic(t *testing.T) { +func TestAccNet_WithLinkRouteTable_basic(t *testing.T) { t.Parallel() var v oscgo.RouteTable resource.Test(t, resource.TestCase{ @@ -37,7 +37,7 @@ func TestAccOutscaleOAPILinkRouteTable_basic(t *testing.T) { }) } -func TestAccResourceOAPILinkRouteTable_importBasic(t *testing.T) { +func TestAccNet_ImportLinkRouteTable_Basic(t *testing.T) { resourceName := "outscale_route_table_link.foo" resource.ParallelTest(t, resource.TestCase{ diff --git a/outscale/resource_outscale_route_table_test.go b/outscale/resource_outscale_route_table_test.go index 24c054171..d39bf54bf 100644 --- a/outscale/resource_outscale_route_table_test.go +++ b/outscale/resource_outscale_route_table_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIRouteTable_basic(t *testing.T) { +func TestAccNet_WithRouteTable_basic(t *testing.T) { var v oscgo.RouteTable testCheck := func(*terraform.State) error { @@ -76,7 +76,7 @@ func TestAccOutscaleOAPIRouteTable_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIRouteTable_instance(t *testing.T) { +func TestAccNet_RouteTable_instance(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") var v oscgo.RouteTable @@ -115,7 +115,7 @@ func TestAccOutscaleOAPIRouteTable_instance(t *testing.T) { }) } -func TestAccOutscaleOAPIRouteTable_tags(t *testing.T) { +func TestAccNet_WithRouteTable_tags(t *testing.T) { value1 := ` tags { key = "name" @@ -162,7 +162,7 @@ func TestAccOutscaleOAPIRouteTable_tags(t *testing.T) { }) } -func TestAccOutscaleRouteTable_importBasic(t *testing.T) { +func TestAccNet_RouteTable_importBasic(t *testing.T) { resourceName := "outscale_route_table.foo" resource.ParallelTest(t, resource.TestCase{ diff --git a/outscale/resource_outscale_route_test.go b/outscale/resource_outscale_route_test.go index f82a24365..ebebe6ce5 100644 --- a/outscale/resource_outscale_route_test.go +++ b/outscale/resource_outscale_route_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIRoute_noopdiff(t *testing.T) { +func TestAccNet_OutscaleOAPIRoute_noopdiff(t *testing.T) { var route oscgo.Route resource.Test(t, resource.TestCase{ @@ -39,7 +39,7 @@ func TestAccOutscaleOAPIRoute_noopdiff(t *testing.T) { }) } -func TestAccOutscaleOAPIRoute_importBasic(t *testing.T) { +func TestAccNet_ImportRoute_Basic(t *testing.T) { resourceName := "outscale_route.test" @@ -62,7 +62,7 @@ func TestAccOutscaleOAPIRoute_importBasic(t *testing.T) { }) } -func TestAccOutscaleOAPIRoute_importWithNatService(t *testing.T) { +func TestAccNet_Route_importWithNatService(t *testing.T) { resourceName := "outscale_route.outscale_route_nat" resource.ParallelTest(t, resource.TestCase{ @@ -84,7 +84,7 @@ func TestAccOutscaleOAPIRoute_importWithNatService(t *testing.T) { }) } -func TestAccOutscaleOAPIRoute_changeTarget(t *testing.T) { +func TestAccNet_Route_changeTarget(t *testing.T) { var route oscgo.Route resource.Test(t, resource.TestCase{ @@ -111,7 +111,7 @@ func TestAccOutscaleOAPIRoute_changeTarget(t *testing.T) { }) } -func TestAccOutscaleOAPIRoute_onlyOneTarget(t *testing.T) { +func TestAccNet_Route_onlyOneTarget(t *testing.T) { regex := regexp.MustCompile(".*") resource.Test(t, resource.TestCase{ Providers: testAccProviders, diff --git a/outscale/resource_outscale_security_group_test.go b/outscale/resource_outscale_security_group_test.go index dd4452549..ffc0647f2 100644 --- a/outscale/resource_outscale_security_group_test.go +++ b/outscale/resource_outscale_security_group_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPISecurityGroup(t *testing.T) { +func TestAccNet_WithSecurityGroup(t *testing.T) { var group oscgo.SecurityGroup rInt := acctest.RandInt() diff --git a/outscale/resource_outscale_subnet_test.go b/outscale/resource_outscale_subnet_test.go index c1f2c9feb..83bfe6ebc 100644 --- a/outscale/resource_outscale_subnet_test.go +++ b/outscale/resource_outscale_subnet_test.go @@ -13,7 +13,7 @@ import ( "github.com/terraform-providers/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPISubNet_basic(t *testing.T) { +func TestAccNet_WithSubNet_basic(t *testing.T) { t.Parallel() var conf oscgo.Subnet diff --git a/outscale/resource_outscale_virtual_gateway_link_test.go b/outscale/resource_outscale_virtual_gateway_link_test.go index 8ef3cac48..481801d48 100644 --- a/outscale/resource_outscale_virtual_gateway_link_test.go +++ b/outscale/resource_outscale_virtual_gateway_link_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIVpnGatewayAttachment_basic(t *testing.T) { +func TestAccNet_withpnGatewayAttachment_basic(t *testing.T) { var vpc oscgo.Net var vgw oscgo.VirtualGateway t.Parallel() @@ -71,7 +71,7 @@ func testAccCheckVpnGatewayAttachmentImportStateIDFunc(resourceName string) reso } } -func TestAccAWSOAPIVpnGatewayAttachment_deleted(t *testing.T) { +func TestAccNet_WithVpnGatewayAttachment_deleted(t *testing.T) { t.Parallel() var vgw oscgo.VirtualGateway var vpc oscgo.Net diff --git a/outscale/resource_outscale_virtual_gateway_route_propagation_test.go b/outscale/resource_outscale_virtual_gateway_route_propagation_test.go index 237067bfd..391b1ad03 100644 --- a/outscale/resource_outscale_virtual_gateway_route_propagation_test.go +++ b/outscale/resource_outscale_virtual_gateway_route_propagation_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIVirtualRoutePropagation_basic(t *testing.T) { +func TestAccNet_WithVirtualRoutePropagation_basic(t *testing.T) { t.Parallel() rBgpAsn := utils.RandIntRange(64512, 65534) diff --git a/outscale/resource_outscale_virtual_gateway_test.go b/outscale/resource_outscale_virtual_gateway_test.go index 2bb59bdfe..a8572cee7 100644 --- a/outscale/resource_outscale_virtual_gateway_test.go +++ b/outscale/resource_outscale_virtual_gateway_test.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccOutscaleOAPIVirtualGateway_basic(t *testing.T) { +func TestAccNet_WithVirtualGateway_basic(t *testing.T) { t.Parallel() var v, v2 oscgo.VirtualGateway @@ -46,7 +46,7 @@ func TestAccOutscaleOAPIVirtualGateway_basic(t *testing.T) { }) } -func TestAccOutscaleOAPIVirtualGatewayChangeTags(t *testing.T) { +func TestAccNet_WithVirtualGatewayChangeTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -64,7 +64,7 @@ func TestAccOutscaleOAPIVirtualGatewayChangeTags(t *testing.T) { }) } -func TestAccOutscaleOAPIVirtualGateway_delete(t *testing.T) { +func TestAccNet_withVirtualGateway_delete(t *testing.T) { var virtualGateway oscgo.VirtualGateway testDeleted := func(r string) resource.TestCheckFunc { @@ -98,7 +98,7 @@ func TestAccOutscaleOAPIVirtualGateway_delete(t *testing.T) { }) } -func TestAccOutscaleOAPIVirtualGateway_importBasic(t *testing.T) { +func TestAccNet_ImportVirtualGateway_Basic(t *testing.T) { resourceName := "outscale_virtual_gateway.foo" resource.ParallelTest(t, resource.TestCase{ diff --git a/outscale/resource_outscale_vm_test.go b/outscale/resource_outscale_vm_test.go index 4af91c938..b706d722d 100644 --- a/outscale/resource_outscale_vm_test.go +++ b/outscale/resource_outscale_vm_test.go @@ -131,7 +131,7 @@ func testAccCheckOutscaleVMImportStateIDFunc(resourceName string) resource.Impor } } -func TestAccOutscaleOAPIVM_withNicAttached(t *testing.T) { +func TestAccNet_VM_withNicAttached(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -159,7 +159,6 @@ func TestAccOutscaleOAPIVM_withTags(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") - sgId := os.Getenv("OUTSCALE_SECURITYGROUPID") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -167,7 +166,7 @@ func TestAccOutscaleOAPIVM_withTags(t *testing.T) { CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, Steps: []resource.TestStep{ { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "Terraform-VM", keypair, sgId), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "Terraform-VM", keypair), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), @@ -181,7 +180,7 @@ func TestAccOutscaleOAPIVM_withTags(t *testing.T) { }) } -func TestAccOutscaleOAPIVM_withNics(t *testing.T) { +func TestAccNet_VM_withNics(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -241,7 +240,7 @@ func TestAccOutscaleOAPIVM_Update(t *testing.T) { }) } -func TestAccOutscaleOAPIVM_WithSubnet(t *testing.T) { +func TestAccNet_VM_WithSubnet(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") @@ -320,7 +319,6 @@ func TestAccOutscaleOAPIVM_DeletionProtectionUpdate(t *testing.T) { func TestAccOutscaleOAPIVMTags_Update(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") - sgId := os.Getenv("OUTSCALE_SECURITYGROUPID") //TODO: check tags resource.Test(t, resource.TestCase{ @@ -329,11 +327,11 @@ func TestAccOutscaleOAPIVMTags_Update(t *testing.T) { CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, Steps: []resource.TestStep{ { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "Terraform-VM", keypair, sgId), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "Terraform-VM", keypair), //Check: resource.ComposeTestCheckFunc(), }, { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "Terraform-VM2", keypair, sgId), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "Terraform-VM2", keypair), //Check: resource.ComposeTestCheckFunc(), }, }, @@ -806,34 +804,13 @@ func testAccVmsConfigUpdateOAPIVMKey(omi, vmType, region, keypair, sgId string) `, omi, vmType, region, keypair, sgId) } -func testAccVmsConfigUpdateOAPIVMTags(omi, vmType string, region, value, keypair, sgId string) string { +func testAccVmsConfigUpdateOAPIVMTags(omi, vmType, region, value, keypair 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 = "%[5]s" - description = "Used in the terraform acceptance tests" - - tags { - key = "Name" - value = "tf-acc-test" - } - - net_id = outscale_net.net.id - } resource "outscale_vm" "basic" { image_id = "%[1]s" vm_type = "%[2]s" keypair_name = "%[5]s" - security_group_ids = ["%[6]s"] placement_subregion_name = "%[3]sb" tags { @@ -841,7 +818,7 @@ func testAccVmsConfigUpdateOAPIVMTags(omi, vmType string, region, value, keypair value = "%[4]s" } } - `, omi, vmType, region, value, keypair, sgId) + `, omi, vmType, region, value, keypair) } func testAccCheckOutscaleOAPIVMConfigWithSubnet(omi, vmType, region, keypair string) string { diff --git a/outscale/resource_outscale_volumes_link_test.go b/outscale/resource_outscale_volumes_link_test.go index 65eb0cec2..292534eb2 100644 --- a/outscale/resource_outscale_volumes_link_test.go +++ b/outscale/resource_outscale_volumes_link_test.go @@ -16,7 +16,6 @@ func TestAccOutscaleOAPIVolumeAttachment_basic(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") - sgId := os.Getenv("OUTSCALE_SECURITYGROUPID") var i oscgo.Vm var v oscgo.Volume @@ -30,7 +29,7 @@ func TestAccOutscaleOAPIVolumeAttachment_basic(t *testing.T) { CheckDestroy: testAccCheckOAPIVolumeAttachmentDestroy, Steps: []resource.TestStep{ { - Config: testAccOAPIVolumeAttachmentConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair, sgId), + Config: testAccOAPIVolumeAttachmentConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "outscale_volumes_link.ebs_att", "device_name", "/dev/sdh"), @@ -46,7 +45,6 @@ func TestAccOutscaleOAPIVolumeAttachment_basic(t *testing.T) { func TestAccOutscaleOAPIVolumeAttachment_importBasic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") - sgId := os.Getenv("OUTSCALE_SECURITYGROUPID") resourceName := "outscale_volumes_link.ebs_att" @@ -56,7 +54,7 @@ func TestAccOutscaleOAPIVolumeAttachment_importBasic(t *testing.T) { CheckDestroy: testAccCheckOAPIVolumeAttachmentDestroy, Steps: []resource.TestStep{ { - Config: testAccOAPIVolumeAttachmentConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair, sgId), + Config: testAccOAPIVolumeAttachmentConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), }, { ResourceName: resourceName, @@ -112,34 +110,12 @@ func testAccCheckOAPIVolumeAttachmentExists(n string, i *oscgo.Vm, v *oscgo.Volu } } -func testAccOAPIVolumeAttachmentConfig(omi, vmType, region, keypair, sgId string) string { +func testAccOAPIVolumeAttachmentConfig(omi, vmType, region, keypair 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" - - tags { - key = "Name" - value = "tf-acc-test" - } - - net_id = "${outscale_net.net.id}" - } - resource "outscale_vm" "web" { image_id = "%[1]s" vm_type = "%[2]s" keypair_name = "%[4]s" - security_group_ids = ["%[5]s"] placement_subregion_name = "%[3]sb" } @@ -154,5 +130,5 @@ func testAccOAPIVolumeAttachmentConfig(omi, vmType, region, keypair, sgId string volume_id = "${outscale_volume.volume.id}" vm_id = "${outscale_vm.web.id}" } - `, omi, vmType, region, keypair, sgId) + `, omi, vmType, region, keypair) }