Skip to content

Commit

Permalink
fuxp Net
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa committed Mar 15, 2023
1 parent 98ea3af commit a2386e8
Show file tree
Hide file tree
Showing 78 changed files with 187 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/acceptance_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_access_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

resource.Test(t, resource.TestCase{
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_cas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

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

resource.Test(t, resource.TestCase{
Expand Down
10 changes: 5 additions & 5 deletions outscale/data_source_outscale_client_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

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

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

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

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

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

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

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

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

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

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

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

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

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

resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_flexible_gpus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

func TestAccDataSourceOutscaleOAPIFlexibleGpus_basic(t *testing.T) {
func TestAccOthers_DataSourceFlexibleGpus_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_image_export_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_image_export_tasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
48 changes: 3 additions & 45 deletions outscale/data_source_outscale_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
}
8 changes: 4 additions & 4 deletions outscale/data_source_outscale_images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_internet_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccOutscaleOAPIInternetServiceDatasource_basic(t *testing.T) {
func TestAccOthers_InternetServiceDatasource_basic(t *testing.T) {
t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -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]
}
}
`
Loading

0 comments on commit a2386e8

Please sign in to comment.