Skip to content

Commit

Permalink
US65034: Test external cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-hpe committed Jul 9, 2024
1 parent 806facb commit e463160
Showing 45 changed files with 786 additions and 19 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/cicd-dev-acc.yml
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ jobs:
with:
test_case: TestProvider
test_description: Check for valid terraform provider
test_case_folder: acc-external-testcases
secrets: inherit

test-datasouces:
@@ -19,6 +20,7 @@ jobs:
with:
test_case: TestAccDataSource
test_description: GET call usecase validations
test_case_folder: acc-external-testcases
secrets: inherit

test-vmaas-instance:
@@ -28,29 +30,30 @@ jobs:
with:
test_case: TestVmaasInstance TestAccResourceInstance
test_description: Instance usecase validations
test_case_folder: acc-external-testcases
secrets: inherit

test-vmaas-lb:
uses: ./.github/workflows/reusable-dev-acc.yml
needs: [test-vmaas-instance]
if: "always()"
with:
test_case: TestVmaasLB TestAccResourceLB TestVmaasLoadBalancerPlan TestAccResourceLoadBalancerCreate
test_description: Loadbalancer usecase validations
secrets: inherit
# test-vmaas-lb:
# uses: ./.github/workflows/reusable-dev-acc.yml
# needs: [test-vmaas-instance]
# if: "always()"
# with:
# test_case: TestVmaasLB TestAccResourceLB TestVmaasLoadBalancerPlan TestAccResourceLoadBalancerCreate
# test_description: Loadbalancer usecase validations
# secrets: inherit

test-vmaas-network:
uses: ./.github/workflows/reusable-dev-acc.yml
needs: [test-vmaas-lb]
if: "always()"
with:
test_case: TestVmaasNetworkPlan TestAccResourceNetworkCreate TestAccResourceRouter TestVmaasRouter TestAccResourceTier TestVmaasRouteBGPNeighborPlan
test_description: NSX Network usecase validations
secrets: inherit
# test-vmaas-network:
# uses: ./.github/workflows/reusable-dev-acc.yml
# needs: [test-vmaas-lb]
# if: "always()"
# with:
# test_case: TestVmaasNetworkPlan TestAccResourceNetworkCreate TestAccResourceRouter TestVmaasRouter TestAccResourceTier TestVmaasRouteBGPNeighborPlan
# test_description: NSX Network usecase validations
# secrets: inherit

process-logs:
runs-on: ubuntu-20.04
needs: [test-vmaas-network]
needs: [test-vmaas-instance]
if: "always()"
steps:
- name: Checkout workspace
2 changes: 1 addition & 1 deletion .github/workflows/reusable-dev-acc.yml
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ env:
HPEGL_USER_SECRET: ${{ secrets.DEV_HPEGL_USER_SECRET }}
HPEGL_USER_ID: ${{ secrets.DEV_HPEGL_USER_ID }}
HPEGL_VMAAS_API_URL: ${{ secrets.DEV_HPEGL_VMAAS_API_URL }}
HPEGL_VMAAS_LOCATION: ${{ secrets.DEV_HPEGL_VMAAS_LOCATION }}
HPEGL_VMAAS_LOCATION: FTC-External-Cloud
HPEGL_VMAAS_SPACE_NAME: ${{ secrets.DEV_HPEGL_VMAAS_SPACE_NAME}}
TF_ACC: ${{ secrets.TF_ACC }}
LOG_FILE: "Terraform Log - ${{ inputs.test_description }}.txt"
6 changes: 6 additions & 0 deletions acc-external-testcases/data-sources/cloud.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
acc:
- config: |
name = "External-Cloud"
validations:
json.zone.id: 2
tf.id: 2
6 changes: 6 additions & 0 deletions acc-external-testcases/data-sources/cloud_folder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
acc:
- config: |
name = "ExternalVMFolder"
cloud_id = 2
validations:
json.folder.id: 11
4 changes: 4 additions & 0 deletions acc-external-testcases/data-sources/datastore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
acc:
- config: |
name = "glcicd-G2i-1-Bs-1"
cloud_id = 2
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/edge_cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "edge_cluster"
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "dev"
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/group.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "External-group2"
4 changes: 4 additions & 0 deletions acc-external-testcases/data-sources/layout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
acc:
- config: |
name = "Vmware VM"
instance_type_code = "vmware"
5 changes: 5 additions & 0 deletions acc-external-testcases/data-sources/lb_pool_member_group.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
acc:
- config: |
name = "Application-Group"
validations:
json.groups.externalId: "/infra/domains/default/groups/Application-Group"
5 changes: 5 additions & 0 deletions acc-external-testcases/data-sources/load_balancer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
acc:
- config: |
name = "tf_lb_DO_NOT_DELETE"
validations:
json.loadBalancer.id: 19
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
acc:
- config: |
name = "default-http-lb-monitor"
lb_id = 19
validations:
json.loadBalancerMonitor.id: 152
6 changes: 6 additions & 0 deletions acc-external-testcases/data-sources/load_balancer_pool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
acc:
- config: |
name = "tf_pool_DO_NOT_DELETE"
lb_id = 19
validations:
json.loadBalancerPool.id: 108
21 changes: 21 additions & 0 deletions acc-external-testcases/data-sources/load_balancer_profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
acc:
- config: |
name = "default-http-lb-app-profile"
lb_id = 19
validations:
json.loadBalancerProfile.id: 504
- config: |
name = "default-cookie-lb-persistence-profile"
lb_id = 19
validations:
json.loadBalancerProfile.id: 527
- config: |
name = "default-balanced-server-ssl-profile"
lb_id = 19
validations:
json.loadBalancerProfile.id: 571
- config: |
name = "default-balanced-client-ssl-profile"
lb_id = 19
validations:
json.loadBalancerProfile.id: 552
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
acc:
- config: |
name = "Test SSL Cert"
validations:
json.certificates.id: 8
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/network.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "Dhcp-net1"
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/network_domain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "localdomain"
6 changes: 6 additions & 0 deletions acc-external-testcases/data-sources/network_interface.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
acc:
- config: |
name = "VMXNET 3"
cloud_id = 2
validations:
tf.id: 10
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/network_pool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "Post-pool"
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/network_proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "test-proxy"
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/network_type.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "NSX Segment"
5 changes: 5 additions & 0 deletions acc-external-testcases/data-sources/nsx-tier1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
acc:
- config: |
name = "tf-dont-delete"
validations:
json.networkRouter.providerId: "/infra/tier-1s/9c995f68-f873-42f0-bb1b-8c5021c8f64a"
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/plan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "G2i-small"
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/power_schedule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "power-schedule"
4 changes: 4 additions & 0 deletions acc-external-testcases/data-sources/resource_pool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
acc:
- config: |
name = "ExternalResourcePool"
cloud_id = 2
3 changes: 3 additions & 0 deletions acc-external-testcases/data-sources/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
acc:
- config: |
name = "External-Centos"
28 changes: 28 additions & 0 deletions acc-external-testcases/resources/instance-template_err.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
vars:
rand_name_1: tf_acc_%rand_int
rand_storage_1: "%rand_int{5,8}"
acc:
- config: |
name = "$(rand_name_1)"
cloud_id = 1
group_id = 2
layout_id = 113
plan_id = 407
instance_type_code = "vmware"
network {
id = 3
}
volume {
name = "root_vol"
datastore_id = "auto"
size = $(rand_storage_1)
}
config {
resource_pool_id = 2
no_agent = true
folder_code = "group-v284"
}
scale = 1
validations:
tf.status: "running"
expect_error: ".*template.*"
27 changes: 27 additions & 0 deletions acc-external-testcases/resources/instance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vars:
instance_name: tf_external_acc_%rand_int
rand_storage_1: "%rand_int{5,8}"
acc:
- config: |
name = "$(instance_name)"
cloud_id = 2
group_id = 29
layout_id = 415
plan_id = 877
instance_type_code = "vmware"
network {
id = 119
}
volume {
name = "root_vol"
datastore_id = "auto"
size = $(rand_storage_1)
}
config {
resource_pool_id = 14
template_id = 5069
folder_code = "group-v7199"
}
scale = 1
validations:
tf.status: "running"
9 changes: 9 additions & 0 deletions acc-external-testcases/resources/instance_clone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
vars:
instance_name: tf_external_acc_clone_%rand_int
acc:
- config: |
source_instance_id = 476
name = "$(instance_name)"
network {
id = 119
}
18 changes: 18 additions & 0 deletions acc-external-testcases/resources/load_balancer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
vars:
name: "tf_loadbalancer_%rand_int"
acc:
- config: |
name = "$(name)"
description = "Loadbalancer created using tf"
enabled = true
group_access {
all = true
}
config {
admin_state = true
size = "SMALL"
log_level = "INFO"
tier1_gateways = "/infra/tier-1s/b918abfd-d84b-46be-a0ac-4a64c04a5703"
}
validations:
json.loadBalancer.config.tier1: "/infra/tier-1s/b918abfd-d84b-46be-a0ac-4a64c04a5703"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
vars:
http_name: tf_HTTP_MONITOR_%rand_int
acc:
- config: |
lb_id = 26
name = "$(http_name)"
description = "HTTP_MONITOR creating using tf"
type = "LBIcmpMonitorProfile"
http_monitor {
fall_count = 8
interval = 10
monitor_port = 50
rise_count = 5
timeout = 30
request_body = "request input body data"
request_method = "GET"
request_url = "https://request.com"
request_version = "HTTP_VERSION_1_0"
response_data = "Failed"
response_status_codes = "500"
}
validations:
json.loadBalancerMonitor.monitorType: "LBHttpMonitorProfile"
expect_error: ".*monitor.*"
Loading

0 comments on commit e463160

Please sign in to comment.