-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: (CXF 90011) Updating Metal & Fabric Provider with NIMF function…
…ality (#626) - Added authorization_code to metal_interconnection schema. - Added buildSharedPortVCVLANCreateRequest() function for the connection type shared_port_vlan request. - Added DataSource and Resource Acc Tests for Vlan Port Share functionality. - Added "METAL_NETWORK" to Fabric connection Access Point Type schema - Updated Fabric Go SDK Version to 0.9.0
- Loading branch information
Showing
9 changed files
with
214 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,61 @@ func testDataSourceMetalConnectionConfig_withVlans(r int) string { | |
r, r, r, r) | ||
} | ||
|
||
func TestAccDataSourceMetalConnection_sharedPort(t *testing.T) { | ||
rInt := acctest.RandInt() | ||
|
||
resource.ParallelTest(t, resource.TestCase{ | ||
PreCheck: func() { acceptance.TestAccPreCheckMetal(t) }, | ||
ExternalProviders: acceptance.TestExternalProviders, | ||
ProtoV5ProviderFactories: acceptance.ProtoV5ProviderFactories, | ||
CheckDestroy: testAccMetalConnectionCheckDestroyed, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccDataSourceMetalConnectionConfig_SharedPort(rInt), | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr( | ||
"data.equinix_metal_connection.test", "metro", "sv"), | ||
resource.TestCheckResourceAttr( | ||
"data.equinix_metal_connection.test", "contact_email", "[email protected]"), | ||
resource.TestCheckResourceAttrSet("data.equinix_metal_connection.test", "authorization_code"), | ||
resource.TestCheckResourceAttrSet("data.equinix_metal_connection.test", "redundancy"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccDataSourceMetalConnectionConfig_SharedPort(r int) string { | ||
return fmt.Sprintf(` | ||
resource "equinix_metal_project" "test" { | ||
name = "tfacc-conn-pro-%d" | ||
} | ||
resource "equinix_metal_vlan" "test1" { | ||
description = "tfacc-conn-vlan1-%d" | ||
metro = "sv" | ||
project_id = equinix_metal_project.test.id | ||
} | ||
resource "equinix_metal_connection" "test" { | ||
name = "tfacc-conn-%d" | ||
project_id = equinix_metal_project.test.id | ||
type = "shared_port_vlan" | ||
redundancy = "primary" | ||
metro = "sv" | ||
speed = "50Mbps" | ||
contact_email = "[email protected]" | ||
vlans = [ | ||
equinix_metal_vlan.test1.vxlan, | ||
] | ||
} | ||
data "equinix_metal_connection" "test" { | ||
connection_id = equinix_metal_connection.test.id | ||
}`, | ||
r, r, r) | ||
} | ||
|
||
// Test to verify that switching from SDKv2 to the Framework has not affected provider's behavior | ||
// TODO (ocobles): once migrated, this test may be removed | ||
func TestAccDataSourceMetalConnection_withVlans_upgradeFromVersion(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.