diff --git a/.github/workflows/acc.yml b/.github/workflows/acc.yml index 210a8bc7..f7edd6a6 100644 --- a/.github/workflows/acc.yml +++ b/.github/workflows/acc.yml @@ -1,4 +1,4 @@ -name: acc +name: Acceptance Tests on: # Runs every 2 days once at 3AM diff --git a/.github/workflows/dev-acc.yml b/.github/workflows/dev-acc.yml new file mode 100644 index 00000000..c0198523 --- /dev/null +++ b/.github/workflows/dev-acc.yml @@ -0,0 +1,52 @@ +name: Dev Acceptance Tests + +on: + # Runs every 2 days once at 3AM + # schedule: + # - cron: '0 21 */2 * *' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + tags: + description: 'Test scenario tags' + # release: + # types: [published] +env: + HPEGL_IAM_SERVICE_URL: ${{ secrets.DEV_HPEGL_IAM_SERVICE_URL }} + HPEGL_TENANT_ID: ${{ secrets.DEV_HPEGL_TENANT_ID }} + 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_SPACE_NAME: ${{ secrets.DEV_HPEGL_VMAAS_SPACE_NAME}} + TF_ACC: ${{ secrets.TF_ACC }} +jobs: + acc: + runs-on: ubuntu-20.04 + strategy: + matrix: + go: [ '1.17' ] + name: Dev Acceptance Tests + steps: + - name: Checkout workspace + uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.17 + - name: Install dependencies + run: | + sudo apt-get install -y wget jq + wget https://releases.hashicorp.com/terraform/1.0.0/terraform_1.0.0_linux_amd64.zip + sudo unzip -fo terraform_1.0.0_linux_amd64.zip -d /usr/local/bin + + - name: Install necessary tools + run: make tools + + - name: Run Acceptance test + run: | + TF_ACC_TEST_PATH="$(pwd)/acc-dev-testcases" && make acceptance \ No newline at end of file diff --git a/README.md b/README.md index 4e7e72fb..aa3f8571 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ # vmaas-terraform-resources - [vmaas-terraform-resources](#vmaas-terraform-resources) - * [Introduction](#Terraform resources for HPEGL VMaaS) + * [Introduction](#terraform-resources-for-hpegl-vmaas) * [Requirements](#Requirements) * [Usage](#Usage) - * [Building the resources as provider](#Building the resources as provider) + * [Building the resources as provider](#building-the-resources-as-provider) # Terraform resources for HPEGL VMaaS diff --git a/acc-dev-testcases/data-sources/load_balancer.yaml b/acc-dev-testcases/data-sources/load_balancer.yaml index 5e6d3069..b291b84b 100644 --- a/acc-dev-testcases/data-sources/load_balancer.yaml +++ b/acc-dev-testcases/data-sources/load_balancer.yaml @@ -1,5 +1,5 @@ acc: - config: | - name = "tl_lb_dnd" + name = "tf_lb_DND" validations: - json.loadBalancer.id: 18 \ No newline at end of file + json.loadBalancer.id: 26 \ No newline at end of file diff --git a/acc-dev-testcases/data-sources/load_balancer_monitor.yaml b/acc-dev-testcases/data-sources/load_balancer_monitor.yaml index 5b01f02f..abebe512 100644 --- a/acc-dev-testcases/data-sources/load_balancer_monitor.yaml +++ b/acc-dev-testcases/data-sources/load_balancer_monitor.yaml @@ -1,6 +1,6 @@ acc: - config: | name = "default-http-lb-monitor" - lb_id = 18 + lb_id = 26 validations: - json.loadBalancerMonitor.id: 98 \ No newline at end of file + json.loadBalancerMonitor.id: 156 \ No newline at end of file diff --git a/acc-dev-testcases/data-sources/load_balancer_pool.yaml b/acc-dev-testcases/data-sources/load_balancer_pool.yaml index b11a0790..51b87af0 100644 --- a/acc-dev-testcases/data-sources/load_balancer_pool.yaml +++ b/acc-dev-testcases/data-sources/load_balancer_pool.yaml @@ -1,6 +1,6 @@ acc: - config: | name = "PCE-testLB-Pool" - lb_id = 18 + lb_id = 26 validations: json.loadBalancerPool.id: 86 diff --git a/acc-dev-testcases/data-sources/load_balancer_profile.yaml b/acc-dev-testcases/data-sources/load_balancer_profile.yaml index ec17d2a6..e164a4a2 100644 --- a/acc-dev-testcases/data-sources/load_balancer_profile.yaml +++ b/acc-dev-testcases/data-sources/load_balancer_profile.yaml @@ -1,21 +1,21 @@ acc: - config: | name = "default-http-lb-app-profile" - lb_id = 18 + lb_id = 26 validations: - json.loadBalancerProfile.id: 215 + json.loadBalancerProfile.id: 379 - config: | name = "default-cookie-lb-persistence-profile" - lb_id = 18 + lb_id = 26 validations: - json.loadBalancerProfile.id: 220 + json.loadBalancerProfile.id: 385 - config: | name = "default-balanced-server-ssl-profile" - lb_id = 18 + lb_id = 26 validations: - json.loadBalancerProfile.id: 230 + json.loadBalancerProfile.id: 398 - config: | name = "default-balanced-client-ssl-profile" - lb_id = 18 + lb_id = 26 validations: - json.loadBalancerProfile.id: 227 + json.loadBalancerProfile.id: 393 diff --git a/acc-dev-testcases/data-sources/load_balancer_ssl_ca_certs.yaml b/acc-dev-testcases/data-sources/load_balancer_ssl_ca_certs.yaml index 21a1558e..f23b573b 100644 --- a/acc-dev-testcases/data-sources/load_balancer_ssl_ca_certs.yaml +++ b/acc-dev-testcases/data-sources/load_balancer_ssl_ca_certs.yaml @@ -1,5 +1,5 @@ acc: - config: | - name = "sample-cert" + name = "test-cert" validations: - json.certificates.id: 7 \ No newline at end of file + json.certificates.id: 9 \ No newline at end of file diff --git a/acc-dev-testcases/resources/instance_clone.yaml b/acc-dev-testcases/resources/instance_clone.yaml index 47585250..10c39156 100644 --- a/acc-dev-testcases/resources/instance_clone.yaml +++ b/acc-dev-testcases/resources/instance_clone.yaml @@ -2,7 +2,7 @@ vars: instance_name: tf_acc_clone_%rand_int acc: - config: | - source_instance_id = 1 + source_instance_id = 2 name = "$(instance_name)" network { id = 84 diff --git a/acc-dev-testcases/resources/load_balancer.yaml b/acc-dev-testcases/resources/load_balancer.yaml index 02143d89..90da8f71 100644 --- a/acc-dev-testcases/resources/load_balancer.yaml +++ b/acc-dev-testcases/resources/load_balancer.yaml @@ -12,7 +12,7 @@ acc: admin_state = true size = "SMALL" log_level = "INFO" - tier1_gateways = "/infra/tier-1s/9c995f68-f873-42f0-bb1b-8c5021c8f64a" + tier1_gateways = "/infra/tier-1s/b918abfd-d84b-46be-a0ac-4a64c04a5703" } validations: - json.loadBalancer.config.tier1: "/infra/tier-1s/9c995f68-f873-42f0-bb1b-8c5021c8f64a" + json.loadBalancer.config.tier1: "/infra/tier-1s/b918abfd-d84b-46be-a0ac-4a64c04a5703" diff --git a/acc-dev-testcases/resources/load_balancer_monitor-monitor_err.yaml b/acc-dev-testcases/resources/load_balancer_monitor-monitor_err.yaml index c1c5b7b5..717cd197 100644 --- a/acc-dev-testcases/resources/load_balancer_monitor-monitor_err.yaml +++ b/acc-dev-testcases/resources/load_balancer_monitor-monitor_err.yaml @@ -2,7 +2,7 @@ vars: http_name: tf_HTTP_MONITOR_%rand_int acc: - config: | - lb_id = 18 + lb_id = 26 name = "$(http_name)" description = "HTTP_MONITOR creating using tf" type = "LBIcmpMonitorProfile" diff --git a/acc-dev-testcases/resources/load_balancer_monitor.yaml b/acc-dev-testcases/resources/load_balancer_monitor.yaml index f1148d67..70a71639 100644 --- a/acc-dev-testcases/resources/load_balancer_monitor.yaml +++ b/acc-dev-testcases/resources/load_balancer_monitor.yaml @@ -7,7 +7,7 @@ vars: udp_name: tf_UDP-MONITOR_%rand_int acc: - config: | - lb_id = 18 + lb_id = 26 name = "$(http_name)" description = "HTTP_MONITOR creating using tf" type = "LBHttpMonitorProfile" @@ -27,7 +27,7 @@ acc: validations: json.loadBalancerMonitor.monitorType: "LBHttpMonitorProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(https_name)" description = "HTTPS_MONITOR creating using tf" type = "LBHttpsMonitorProfile" @@ -47,7 +47,7 @@ acc: validations: json.loadBalancerMonitor.monitorType: "LBHttpsMonitorProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(icmp_name)" description = "ICMP_MONITOR update using tf" type = "LBIcmpMonitorProfile" @@ -62,7 +62,7 @@ acc: validations: json.loadBalancerMonitor.monitorType: "LBIcmpMonitorProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(passive_name)" description = "PASSIVE_MONITOR create using tf" type = "LBPassiveMonitorProfile" @@ -73,7 +73,7 @@ acc: validations: json.loadBalancerMonitor.monitorType: "LBPassiveMonitorProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(tcp_name)" description = "TCP_MONITOR create using tf" type = "LBTcpMonitorProfile" @@ -89,7 +89,7 @@ acc: validations: json.loadBalancerMonitor.monitorType: "LBTcpMonitorProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(udp_name)" description = "UDP_MONITOR create using tf" type = "LBUdpMonitorProfile" diff --git a/acc-dev-testcases/resources/load_balancer_pool.yaml b/acc-dev-testcases/resources/load_balancer_pool.yaml index af90ec7e..2d72be7e 100644 --- a/acc-dev-testcases/resources/load_balancer_pool.yaml +++ b/acc-dev-testcases/resources/load_balancer_pool.yaml @@ -2,7 +2,7 @@ vars: pool_name: tf_POOL_%rand_int acc: - config: | - lb_id = 18 + lb_id = 26 name = "$(pool_name)" description = "POOL creating using tf" min_active_members = 1 @@ -14,11 +14,11 @@ acc: tcp_multiplexing = false tcp_multiplexing_number = 6 member_group { - group = "/infra/lb-pools/d3995b17-e10f-46bb-8d2b-82b42d153452" + group = "/infra/domains/default/groups/test-nework-group" max_ip_list_size = 1 ip_revision_filter = "IPV4" port = 80 } } validations: - json.loadBalancerPool.config.memberGroup.path: "/infra/lb-pools/d3995b17-e10f-46bb-8d2b-82b42d153452" \ No newline at end of file + json.loadBalancerPool.config.memberGroup.path: "/infra/domains/default/groups/test-nework-group" \ No newline at end of file diff --git a/acc-dev-testcases/resources/load_balancer_profile.yaml b/acc-dev-testcases/resources/load_balancer_profile.yaml index b8eddd68..7c8f3511 100644 --- a/acc-dev-testcases/resources/load_balancer_profile.yaml +++ b/acc-dev-testcases/resources/load_balancer_profile.yaml @@ -9,7 +9,7 @@ vars: server_name: tf_SERVER-PROFILE_%rand_int acc: - config: | - lb_id = 18 + lb_id = 26 name = "$(http_name)" description = "HTTP_PROFILE creating using tf" profile_type = "application-profile" @@ -33,7 +33,7 @@ acc: validations: json.loadBalancerProfile.serviceType: "LBHttpProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(tcp_name)" description = "TCP_PROFILE creating using tf" profile_type = "application-profile" @@ -52,7 +52,7 @@ acc: validations: json.loadBalancerProfile.serviceType: "LBFastTcpProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(udp_name)" description = "UDP_PROFILE creating using tf" profile_type = "application-profile" @@ -70,7 +70,7 @@ acc: validations: json.loadBalancerProfile.serviceType: "LBFastUdpProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(cookie_name)" description = "COOKIE_PROFILE creating using tf" profile_type = "persistence-profile" @@ -94,7 +94,7 @@ acc: validations: json.loadBalancerProfile.serviceType: "LBCookiePersistenceProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(generic_name)" description = "GENERIC_PROFILE creating using tf" profile_type = "persistence-profile" @@ -113,7 +113,7 @@ acc: validations: json.loadBalancerProfile.serviceType: "LBGenericPersistenceProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(source_name)" description = "SOURCE_PROFILE creating using tf" profile_type = "persistence-profile" @@ -133,7 +133,7 @@ acc: validations: json.loadBalancerProfile.serviceType: "LBSourceIpPersistenceProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(client_name)" description = "CLIENT_PROFILE creating using tf" profile_type = "ssl-profile" @@ -153,7 +153,7 @@ acc: validations: json.loadBalancerProfile.serviceType: "LBClientSslProfile" - config: | - lb_id = 18 + lb_id = 26 name = "$(server_name)" description = "SERVER_PROFILE creating using tf" profile_type = "ssl-profile" diff --git a/acc-dev-testcases/resources/load_balancer_virtual_server.yaml b/acc-dev-testcases/resources/load_balancer_virtual_server.yaml index 5e530101..094a9b5a 100644 --- a/acc-dev-testcases/resources/load_balancer_virtual_server.yaml +++ b/acc-dev-testcases/resources/load_balancer_virtual_server.yaml @@ -2,31 +2,31 @@ vars: vs_name: tf_VS_%rand_int acc: - config: | - lb_id = 18 + lb_id = 26 name = "$(vs_name)" description = "tf_virtual-server created by tf" vip_address = "11.10.52.14" vip_port = "8080" - pool = 1037 + pool = 120 type = "http" http_application_profile { - application_profile = 214 + application_profile = 379 } persistence = "COOKIE" cookie_persistence_profile { - persistence_profile = 220 + persistence_profile = 385 } - ssl_server_cert = 8 + ssl_server_cert = 9 ssl_server_config { - ssl_server_profile = 230 + ssl_server_profile = 398 } - ssl_client_cert = 8 + ssl_client_cert = 9 ssl_client_config { - ssl_client_profile = 227 + ssl_client_profile = 393 } validations: json.loadBalancerInstance.vipProtocol: "http"