Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding UAT virtual device terra tests, workflow and examples #55

Merged
merged 5 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/terratests-uat-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET_PNFV }}
EQUINIX_API_ENDPOINT: "https://uatapi.equinix.com"
TEST_DATA_UAT_PORT_2_ALIBABA_CONNECTION: ${{ secrets.TEST_DATA_UAT_PORT_2_ALIBABA_CONNECTION }}
TEST_DATA_UAT_VIRTUAL_DEVICE_2_AZURE_CONNECTION: ${{ secrets.TEST_DATA_UAT_VIRTUAL_DEVICE_2_AZURE_CONNECTION }}
TEST_DATA_UAT_VIRTUAL_DEVICE_2_PORT_CONNECTION: ${{ secrets.TEST_DATA_UAT_VIRTUAL_DEVICE_2_PORT_CONNECTION }}

steps:
- name: Check out code into the Go module directory
Expand All @@ -38,6 +40,8 @@ jobs:
- name: Setup Variables Files
run: |
echo $TEST_DATA_UAT_PORT_2_ALIBABA_CONNECTION >> "./examples/port-2-alibaba-connection/terraform.tfvars.json"
echo $TEST_DATA_UAT_VIRTUAL_DEVICE_2_AZURE_CONNECTION >> "./tests/examples-without-external-providers/virtual-device-2-azure-connection/terraform.tfvars.json"
echo $TEST_DATA_UAT_VIRTUAL_DEVICE_2_PORT_CONNECTION >> "./tests/examples-without-external-providers/virtual-device-2-port-connection/terraform.tfvars.json"

- name: Run Go Tests
run:
Expand Down
2 changes: 2 additions & 0 deletions modules/virtual-device-connection/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ variable "zside_ap_authentication_key" {
description = "Authentication key for provider based connections"
type = string
default = ""
sensitive = true
}
variable "zside_ap_profile_type" {
description = "Service profile type - L2_PROFILE, L3_PROFILE, ECIA_PROFILE, ECMC_PROFILE"
Expand Down Expand Up @@ -118,4 +119,5 @@ variable "additional_info" {
description = "Additional info parameters. It's a list of maps containing 'key' and 'value' keys with their corresponding values."
type = list(object({ key = string, value = string }))
default = []
sensitive = true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
module "create_virtual_device_2_azure_connection" {
source = "equinix/fabric/equinix//modules/virtual-device-connection"

connection_name = var.connection_name
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = var.notifications_emails
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number

# A-side
aside_vd_type = var.aside_vd_type
aside_vd_uuid = var.aside_vd_uuid

# Z-side
zside_ap_type = var.zside_ap_type
zside_peering_type = var.zside_peering_type
zside_ap_authentication_key = var.zside_ap_authentication_key
zside_ap_profile_type = var.zside_ap_profile_type
zside_location = var.zside_location
zside_sp_name = var.zside_sp_name
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "azure_connection_id" {
value = module.create_virtual_device_2_azure_connection.primary_connection_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
type = string
}
variable "connection_type" {
description = "Defines the connection type like VG_VC, EVPL_VC, EPL_VC, EC_VC, IP_VC, ACCESS_EPL_VC"
type = string
}
variable "notifications_type" {
description = "Notification Type - ALL is the only type currently supported"
type = string
default = "ALL"
}
variable "notifications_emails" {
description = "Array of contact emails"
type = list(string)
}
variable "bandwidth" {
description = "Connection bandwidth in Mbps"
type = number
default = 50
}
variable "purchase_order_number" {
description = "Purchase order number"
type = string
default = ""
}
variable "aside_vd_type" {
description = "Virtual Device type - EDGE"
type = string
default = ""
}
variable "aside_vd_uuid" {
description = "Virtual Device UUID"
type = string
default = ""
}
variable "zside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
type = string
}
variable "zside_ap_authentication_key" {
description = "Authentication key for provider based connections"
type = string
sensitive = true
}
variable "zside_ap_profile_type" {
description = "Service profile type - L2_PROFILE, L3_PROFILE, ECIA_PROFILE, ECMC_PROFILE"
type = string
}
variable "zside_location" {
description = "Access point metro code"
type = string
}
variable "zside_sp_name" {
description = "Equinix Service Profile Name"
type = string
}
variable "zside_peering_type" {
description = "Zside Access Point Peering type. Available values; PRIVATE, MICROSOFT, PUBLIC, MANUAL"
type = string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.2"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.20.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
module "create_virtual_device_2_port_connection" {
source = "equinix/fabric/equinix//modules/virtual-device-connection"

connection_name = var.connection_name
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = var.notifications_emails
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number

# A-side
aside_vd_type = var.aside_vd_type
aside_vd_uuid = var.aside_vd_uuid

# Z-side
zside_ap_type = var.zside_ap_type
zside_vlan_tag = var.zside_vlan_tag
zside_location = var.zside_location
zside_port_name = var.zside_port_name
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "port_connection_id" {
value = module.create_virtual_device_2_port_connection.primary_connection_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "connection_name" {
description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores"
type = string
}
variable "connection_type" {
description = "Defines the connection type like VG_VC, EVPL_VC, EPL_VC, EC_VC, IP_VC, ACCESS_EPL_VC"
type = string
}
variable "notifications_type" {
description = "Notification Type - ALL is the only type currently supported"
type = string
default = "ALL"
}
variable "notifications_emails" {
description = "Array of contact emails"
type = list(string)
}
variable "bandwidth" {
description = "Connection bandwidth in Mbps"
type = number
default = 50
}
variable "purchase_order_number" {
description = "Purchase order number"
type = string
default = ""
}
variable "aside_vd_type" {
description = "Virtual Device type - EDGE"
type = string
default = ""
}
variable "aside_vd_uuid" {
description = "Virtual Device UUID"
type = string
default = ""
}
variable "zside_ap_type" {
description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW"
type = string
}
variable "zside_vlan_tag" {
description = "VLan Tag information for DOT1Q connections, and the outer VLan tag for QINQ connections"
type = string
}
variable "zside_location" {
description = "Access point metro code"
type = string
}
variable "zside_port_name" {
description = "Equinix Z-Side Port Name"
type = string
default = ""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.2"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.20.0"
}
}
}
28 changes: 28 additions & 0 deletions tests/uat/uat_sanity_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,31 @@ func TestCloudRouter2WanCreateConnection_PFCR(t *testing.T) {
output := terraform.Output(t, terraformOptions, "wan_connection_id")
assert.NotNil(t, output)
}

func TestVirtualDevice2AzureCreateConnection_PNFV(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/virtual-device-2-azure-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "azure_connection_id")
assert.NotNil(t, output)
}

func TestVirtualDevice2PortCreateConnection_PNFV(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../tests/examples-without-external-providers/virtual-device-2-azure-connection",
})

defer terraform.Destroy(t, terraformOptions)
t.Parallel()

terraform.InitAndApply(t, terraformOptions)
output := terraform.Output(t, terraformOptions, "port_connection_id")
assert.NotNil(t, output)
}
Loading