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

CXF 94150:Adding NIMF Examples to TerraTest Sanity Suite #83

Merged
merged 3 commits into from
Jun 6, 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
12 changes: 12 additions & 0 deletions .github/workflows/terratests-metal-nimf-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ jobs:
TF_VAR_equinix_client_id: ${{ secrets.EQUINIX_CLIENT_ID }}
TF_VAR_equinix_client_secret: ${{ secrets.EQUINIX_CLIENT_SECRET }}
TF_VAR_metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }}
GOOGLE_SERVICE_KEYS: ${{ secrets.GOOGLE_SERVICE_KEYS }}
TEST_DATA_PROD_METAL_NIMF_2_AWS_CONNECTION: ${{ secrets.TEST_DATA_PROD_METAL_NIMF_2_AWS_CONNECTION }}
TEST_DATA_PROD_METAL_NIMF_2_AZURE_CONNECTION: ${{ secrets.TEST_DATA_PROD_METAL_NIMF_2_AZURE_CONNECTION }}
TEST_DATA_PROD_METAL_NIMF_2_ORACLE_CONNECTION: ${{ secrets.TEST_DATA_PROD_METAL_NIMF_2_ORACLE_CONNECTION }}
TEST_DATA_PROD_CLOUD_ROUTER_2_METAL_NIMF_CONNECTION: ${{ secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_METAL_NIMF_CONNECTION }}
TEST_DATA_PROD_METAL_NIMF_2_PORT_CONNECTION: ${{ secrets.TEST_DATA_PROD_METAL_NIMF_2_PORT_CONNECTION }}
TEST_DATA_PROD_METAL_NIMF_2_IBM2_CONNECTION: ${{ secrets.TEST_DATA_PROD_METAL_NIMF_2_IBM2_CONNECTION }}
TEST_DATA_PROD_METAL_NIMF_2_SERVICE_PROFILE_CONNECTION: ${{ secrets.TEST_DATA_PROD_METAL_NIMF_2_SERVICE_PROFILE_CONNECTION }}
TEST_DATA_PROD_METAL_NIMF_2_GOOGLE_CONNECTION: ${{ secrets.TEST_DATA_PROD_METAL_NIMF_2_GOOGLE_CONNECTION }}

steps:
- name: Check out code into the Go module directory
Expand Down Expand Up @@ -42,6 +48,12 @@ jobs:
echo $TEST_DATA_PROD_METAL_NIMF_2_AZURE_CONNECTION >> "./examples/metal-nimf-2-azure-connection/terraform.tfvars.json"
echo $TEST_DATA_PROD_METAL_NIMF_2_AWS_CONNECTION >> "./examples/metal-nimf-2-aws-connection/terraform.tfvars.json"
echo $TEST_DATA_PROD_METAL_NIMF_2_ORACLE_CONNECTION >> "./examples/metal-nimf-2-oracle-connection/terraform.tfvars.json"
echo $TEST_DATA_PROD_CLOUD_ROUTER_2_METAL_NIMF_CONNECTION >> "./examples/cloud-router-2-metal-nimf-connection/terraform.tfvars.json"
echo $TEST_DATA_PROD_METAL_NIMF_2_PORT_CONNECTION >> "./examples/metal-nimf-2-port-connection/terraform.tfvars.json"
echo $TEST_DATA_PROD_METAL_NIMF_2_IBM2_CONNECTION >> "./examples/metal-nimf-2-ibm2-connection/terraform.tfvars.json"
echo $TEST_DATA_PROD_METAL_NIMF_2_SERVICE_PROFILE_CONNECTION >> "./examples/metal-nimf-2-service-profile-connection/terraform.tfvars.json"
echo $GOOGLE_SERVICE_KEYS >> "./examples/metal-nimf-2-google-connection/keys.json"
echo $TEST_DATA_PROD_METAL_NIMF_2_GOOGLE_CONNECTION >> "./examples/metal-nimf-2-google-connection/terraform.tfvars.json"

- name: Run Go Tests
run:
Expand Down
2 changes: 1 addition & 1 deletion examples/metal-nimf-2-ibm2-connection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "equinix_metal_connection" "metal-connection" {
contact_email = var.metal_contact_email
}

module "metal_2_google_connection" {
module "metal_2_ibm2_connection" {
source = "../../modules/metal-connection"

connection_name = var.connection_name
Expand Down
2 changes: 1 addition & 1 deletion examples/metal-nimf-2-ibm2-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ output "metal_connection_id" {
value = equinix_metal_connection.metal-connection.id
}
output "Metal_IBM2_Connection_Id" {
value = module.metal_2_google_connection.primary_connection_id
value = module.metal_2_ibm2_connection.primary_connection_id
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ purchase_order_number = "1-323292"
project_id = "<Project_ID>"
zside_ap_type = "SP"
zside_ap_profile_type = "L2_PROFILE"
zside_seller_region = "us-west-1"
zside_location = "SV"
zside_fabric_sp_name = "Metal2SP"
56 changes: 56 additions & 0 deletions tests/prod/metal-nimf/prod_metal_nimf_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,34 @@ func TestMetalNIMF2AzureCreateConnection(t *testing.T) {
assert.NotNil(t, output)
}

func TestMetalNIMF2GoogleCreateConnection(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../../examples/metal-nimf-2-google-connection",
})

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

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

func TestMetalNIMF2Ibm2CreateConnection(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../../examples/metal-nimf-2-ibm2-connection",
})

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

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

func TestMetalNIMF2OracleCreateConnection(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Expand All @@ -47,3 +75,31 @@ func TestMetalNIMF2OracleCreateConnection(t *testing.T) {
output := terraform.Output(t, terraformOptions, "metal_oracle_connection_id")
assert.NotNil(t, output)
}

func TestMetalNIMF2PortCreateConnection(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../../examples/metal-nimf-2-port-connection",
})

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

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

func TestFCR2MetalNIMFCreateConnection(t *testing.T) {

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../../../examples/cloud-router-2-metal-nimf-connection",
})

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

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