diff --git a/outscale/resource_outscale_flexible_gpu_test.go b/outscale/resource_outscale_flexible_gpu_test.go index df9586415..d08be3418 100644 --- a/outscale/resource_outscale_flexible_gpu_test.go +++ b/outscale/resource_outscale_flexible_gpu_test.go @@ -29,7 +29,7 @@ func testAccOutscaleOAPIFlexibleGpuConfig(region string) string { resource "outscale_flexible_gpu" "fGPU-1" { model_name = "nvidia-p6" generation = "v5" - subregion_name = "%qa" + subregion_name = "%sa" delete_on_vm_deletion = true } diff --git a/outscale/resource_outscale_vm_test.go b/outscale/resource_outscale_vm_test.go index 6d84ca9b1..31440718b 100644 --- a/outscale/resource_outscale_vm_test.go +++ b/outscale/resource_outscale_vm_test.go @@ -133,7 +133,7 @@ func testAccCheckOutscaleVMImportStateIDFunc(resourceName string) resource.Impor func TestAccNet_VM_withNicAttached(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resourceName := "outscale_vm.basic" resource.Test(t, resource.TestCase{ @@ -158,7 +158,7 @@ func TestAccVM_withTags(t *testing.T) { t.Parallel() var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" tagsValue := "test_tags1" resource.Test(t, resource.TestCase{ @@ -167,7 +167,7 @@ func TestAccVM_withTags(t *testing.T) { CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, Steps: []resource.TestStep{ { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, "Terraform-VM", keypair), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, keypair), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), @@ -184,7 +184,7 @@ func TestAccVM_withTags(t *testing.T) { func TestAccNet_VM_withNics(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -209,7 +209,7 @@ func TestAccNet_VM_withNics(t *testing.T) { func TestAccOutscaleOAPIVM_WithSubnet(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -234,7 +234,7 @@ func TestAccOutscaleOAPIVM_WithSubnet(t *testing.T) { func TestAccVM_UpdateDeletionProtection(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -260,7 +260,7 @@ func TestAccVM_UpdateDeletionProtection(t *testing.T) { func TestAccVM_UpdateTags(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" tagsValue := "test_tags1" //TODO: check tags @@ -270,11 +270,11 @@ func TestAccVM_UpdateTags(t *testing.T) { CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, Steps: []resource.TestStep{ { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, "Terraform-VM", keypair), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, keypair), //Check: resource.ComposeTestCheckFunc(), }, { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, "Terraform-VM2", keypair), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "Terraform-VM2", keypair), //Check: resource.ComposeTestCheckFunc(), }, }, @@ -284,7 +284,7 @@ func TestAccVM_UpdateTags(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") + keypair := "terraform-basic" vmType := "tinav4.c2r2p2" resource.Test(t, resource.TestCase{ @@ -311,7 +311,7 @@ func TestAccVM_multiBlockDeviceMapping(t *testing.T) { t.Parallel() var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -602,12 +602,6 @@ func testAccCheckOutscaleOAPIVMConfigBasic(omi, vmType, region, keypair string) vm_type = "%[2]s" keypair_name = "%[4]s" placement_subregion_name = "%[3]s" - #placement_tenancy = "dedicated" - #nested_virtualization = true - tags { - key = "name" - value = "Terraform-VM" - } }`, omi, vmType, region, keypair) } @@ -722,26 +716,8 @@ func testAccCheckOutscaleOAPIVMConfigBasicWithNics(omi, vmType, keypair, region }`, omi, vmType, keypair, region) } -func testAccVmsConfigUpdateOAPIVMTags(omi, vmType, 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" diff --git a/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.ref index c5b681bcb..62a4729cf 100644 --- a/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.ref @@ -29,7 +29,7 @@ "source_net": [ { "account_id": "##id-1##", - "ip_range": "10.20.0.0/16", + "ip_range": "10.31.0.0/16", "net_id": "##id-4##" } ], @@ -39,7 +39,16 @@ "name": "pending-acceptance" } ], - "tags": [] + "tags": [ + { + "key": "Key", + "value": "value-tags" + }, + { + "key": "Key-2", + "value": "value-tags-2" + } + ] }, { "accepter_net": [ @@ -53,7 +62,7 @@ "source_net": [ { "account_id": "##id-1##", - "ip_range": "10.31.0.0/16", + "ip_range": "10.20.0.0/16", "net_id": "##id-6##" } ], @@ -63,16 +72,7 @@ "name": "pending-acceptance" } ], - "tags": [ - { - "key": "Key", - "value": "value-tags" - }, - { - "key": "Key-2", - "value": "value-tags-2" - } - ] + "tags": [] } ], "request_id": "########" @@ -88,6 +88,7 @@ "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", "instances": [ { + "index_key": 0, "schema_version": 0, "attributes": { "dhcp_options_set_id": "##id-7##", @@ -96,7 +97,12 @@ "net_id": "##id-2##", "request_id": "########", "state": "available", - "tags": [], + "tags": [ + { + "key": "name", + "value": "net-1" + } + ], "tenancy": "default" }, "sensitive_attributes": [], @@ -114,12 +120,17 @@ "schema_version": 0, "attributes": { "dhcp_options_set_id": "##id-7##", - "id": "##id-6##", + "id": "##id-4##", "ip_range": "10.31.0.0/16", - "net_id": "##id-6##", + "net_id": "##id-4##", "request_id": "########", "state": "available", - "tags": [], + "tags": [ + { + "key": "name", + "value": "net-2" + } + ], "tenancy": "default" }, "sensitive_attributes": [], @@ -137,12 +148,17 @@ "schema_version": 0, "attributes": { "dhcp_options_set_id": "##id-7##", - "id": "##id-4##", + "id": "##id-6##", "ip_range": "10.20.0.0/16", - "net_id": "##id-4##", + "net_id": "##id-6##", "request_id": "########", "state": "available", - "tags": [], + "tags": [ + { + "key": "name", + "value": "net-3" + } + ], "tenancy": "default" }, "sensitive_attributes": [], @@ -167,18 +183,18 @@ } ], "accepter_net_id": "##id-2##", - "id": "##id-5##", - "net_peering_id": "##id-5##", + "id": "##id-3##", + "net_peering_id": "##id-3##", "request_id": "########", "source_net": [ { "account_id": "##id-1##", "ip_range": "10.31.0.0/16", - "net_id": "##id-6##" + "net_id": "##id-4##" } ], "source_net_account_id": null, - "source_net_id": "##id-6##", + "source_net_id": "##id-4##", "state": [ { "message": "########", @@ -222,18 +238,18 @@ } ], "accepter_net_id": "##id-2##", - "id": "##id-3##", - "net_peering_id": "##id-3##", + "id": "##id-5##", + "net_peering_id": "##id-5##", "request_id": "########", "source_net": [ { "account_id": "##id-1##", "ip_range": "10.20.0.0/16", - "net_id": "##id-4##" + "net_id": "##id-6##" } ], "source_net_account_id": null, - "source_net_id": "##id-4##", + "source_net_id": "##id-6##", "state": [ { "message": "########", diff --git a/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.tf b/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.tf index 9e32fe820..3a7fbbec0 100644 --- a/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.tf +++ b/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.tf @@ -9,8 +9,6 @@ resource "outscale_net" "outscale_net" { } resource "outscale_net" "outscale_net2" { - count = 1 - ip_range = "10.31.0.0/16" tags { key = "name" @@ -19,7 +17,6 @@ resource "outscale_net" "outscale_net2" { } resource "outscale_net" "outscale_net3" { - count = 1 ip_range = "10.20.0.0/16" tags { key = "name" @@ -28,7 +25,7 @@ resource "outscale_net" "outscale_net3" { } resource "outscale_net_peering" "outscale_net_peering" { - accepter_net_id = outscale_net.outscale_net.net_id + accepter_net_id = outscale_net.outscale_net[0].net_id source_net_id = outscale_net.outscale_net2.net_id tags { key = "Key" @@ -41,7 +38,7 @@ tags { } resource "outscale_net_peering" "outscale_net_peering2" { - accepter_net_id = outscale_net.outscale_net.net_id + accepter_net_id = outscale_net.outscale_net[0].net_id source_net_id = outscale_net.outscale_net3.net_id } diff --git a/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref b/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref index 56cfeed7b..de8abed57 100644 --- a/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref +++ b/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref @@ -786,7 +786,7 @@ "request_id": "########", "state": "available", "subnet_id": "##id-21##", - "subregion_name": "###region###a", + "subregion_name": "us-east-2a", "tags": [ { "key": "name",