From 23bbf034f0f8c4302ec3d6c7f7bb1fd0f1f04984 Mon Sep 17 00:00:00 2001 From: Zhicheng Zhang Date: Wed, 11 Sep 2019 19:36:44 +0800 Subject: [PATCH] Test performance for declarations --- test/Auto_test_performance/dec-test.sh | 10 + .../onboard-declaration.json | 548 ++++++++++++++++++ .../test_os-queens-environment.json | 259 +++++++++ 3 files changed, 817 insertions(+) create mode 100755 test/Auto_test_performance/dec-test.sh create mode 100644 test/Auto_test_performance/onboard-declaration.json create mode 100644 test/Auto_test_performance/test_os-queens-environment.json diff --git a/test/Auto_test_performance/dec-test.sh b/test/Auto_test_performance/dec-test.sh new file mode 100755 index 000000000..5701519f4 --- /dev/null +++ b/test/Auto_test_performance/dec-test.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e + +which newman >/dev/null + +if [ $? -ne 0 ] ; then + echo 'Please run "npm install -g newman newman-reporter-html" to install newman cli first.' + exit 1 +fi + +newman run onboard-declaration.json -e test_os-queens-environment.json -r cli,html --bail diff --git a/test/Auto_test_performance/onboard-declaration.json b/test/Auto_test_performance/onboard-declaration.json new file mode 100644 index 000000000..831ff7323 --- /dev/null +++ b/test/Auto_test_performance/onboard-declaration.json @@ -0,0 +1,548 @@ +{ + "info": { + "_postman_id": "ae1152ba-cea5-4aba-a34c-4ca6a714c35b", + "name": "f5-adcaas-openstack-test", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "deploy-declaration", + "item": [ + { + "name": "create-application", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "", + "let resp = pm.response.json();", + "pm.environment.set('APPLICATION_ID', resp.application.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Auth-Token", + "value": "{{TOKEN}}", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Tenant-Id", + "value": "{{OS_PROJECT_ID}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"my_app\",\n \"description\": \"my-app\",\n \"adcId\": \"{{ADC_ID}}\"\n}" + }, + "url": { + "raw": "{{ADCAAS_URL}}/applications", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "applications" + ] + } + }, + "response": [] + }, + { + "name": "create-pool", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "", + "let resp = pm.response.json();", + "pm.environment.set('POOL_ID', resp.pool.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Auth-Token", + "type": "text", + "value": "{{TOKEN}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Tenant-Id", + "value": "{{OS_PROJECT_ID}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"my_pool\",\n \"description\": \"my-pool\"\n}" + }, + "url": { + "raw": "{{ADCAAS_URL}}/pools", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "pools" + ] + } + }, + "response": [] + }, + { + "name": "create-memeber", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "", + "let resp = pm.response.json();", + "pm.environment.set('MEMBER_ID', resp.member.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Auth-Token", + "type": "text", + "value": "{{TOKEN}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Tenant-Id", + "value": "{{OS_PROJECT_ID}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"address\": \"{{MEMBER_IP}}\",\n \"port\": 80\n}" + }, + "url": { + "raw": "{{ADCAAS_URL}}/pools/{{POOL_ID}}/members", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "pools", + "{{POOL_ID}}", + "members" + ] + } + }, + "response": [] + }, + { + "name": "create-service", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "", + "let resp = pm.response.json();", + "pm.environment.set('SERVICE_ID', resp.service.id);", + "let retry = Number(pm.environment.get('CREATE_NUMBER'));", + "if (retry !== 51) {", + " postman.setNextRequest('create-pool');", + "}", + "pm.environment.set('CREATE_NUMBER', ++retry);" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "id": "0a67cfb3-f333-4930-b442-9377d0fc40b8", + "exec": [ + "let VIP_IP = \"111.222.0.\" + Number(pm.environment.get('CREATE_NUMBER'));", + "pm.environment.set('VIP', VIP_IP);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Auth-Token", + "type": "text", + "value": "{{TOKEN}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Tenant-Id", + "value": "{{OS_PROJECT_ID}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"my_service\",\n \"applicationId\": \"{{APPLICATION_ID}}\",\n \"type\": \"HTTP\",\n \"virtualAddresses\": [\"{{VIP}}\"],\n \"defaultPoolId\": \"{{POOL_ID}}\"\n}" + }, + "url": { + "raw": "{{ADCAAS_URL}}/services", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "services" + ] + } + }, + "response": [] + }, + { + "name": "create-declaration", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 200', function () {", + " pm.response.to.have.status(200);", + "});", + "", + "let resp = pm.response.json();", + "pm.environment.set('DECLARATION_ID', resp.declaration.id);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Auth-Token", + "type": "text", + "value": "{{TOKEN}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Tenant-Id", + "value": "{{OS_PROJECT_ID}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"my-declaration\",\n \"description\": \"my-declaration\"\n}" + }, + "url": { + "raw": "{{ADCAAS_URL}}/applications/{{APPLICATION_ID}}/declarations", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "applications", + "{{APPLICATION_ID}}", + "declarations" + ] + } + }, + "response": [] + }, + { + "name": "set-default-declaration", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 204', function () {", + " pm.response.to.have.status(204);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "X-Auth-Token", + "type": "text", + "value": "{{TOKEN}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Tenant-Id", + "value": "{{OS_PROJECT_ID}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"defaultDeclarationId\": \"{{DECLARATION_ID}}\"\n}" + }, + "url": { + "raw": "{{ADCAAS_URL}}/applications/{{APPLICATION_ID}}", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "applications", + "{{APPLICATION_ID}}" + ] + } + }, + "response": [] + }, + { + "name": "deploy-application", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 204', function () {", + " pm.response.to.have.status(204);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Auth-Token", + "type": "text", + "value": "{{TOKEN}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Tenant-Id", + "value": "{{OS_PROJECT_ID}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{ADCAAS_URL}}/applications/{{APPLICATION_ID}}/deploy", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "applications", + "{{APPLICATION_ID}}", + "deploy" + ] + } + }, + "response": [] + }, + { + "name": "deploy-declaration", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 204', function () {", + " pm.response.to.have.status(204);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Auth-Token", + "type": "text", + "value": "{{TOKEN}}" + }, + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Tenant-Id", + "value": "{{OS_PROJECT_ID}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"adcId\": \"{{ADC_ID}}\"\n}" + }, + "url": { + "raw": "{{ADCAAS_URL}}/applications/{{APPLICATION_ID}}/declarations/{{DECLARATION_ID}}/deploy", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "applications", + "{{APPLICATION_ID}}", + "declarations", + "{{DECLARATION_ID}}", + "deploy" + ] + } + }, + "response": [] + }, + { + "name": "cleanup-application", + "event": [ + { + "listen": "test", + "script": { + "id": "8a7c44c1-f82e-4877-b56b-406c1f5efb7d", + "exec": [ + "pm.test('response code is 204', function () {", + " pm.response.to.have.status(204);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "X-Auth-Token", + "type": "text", + "value": "{{TOKEN}}" + }, + { + "key": "Tenant-Id", + "type": "text", + "value": "{{OS_PROJECT_ID}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{ADCAAS_URL}}/applications/{{APPLICATION_ID}}/cleanup", + "host": [ + "{{ADCAAS_URL}}" + ], + "path": [ + "applications", + "{{APPLICATION_ID}}", + "cleanup" + ] + } + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "d1210cb3-04f6-4cf4-b946-b05050f1635a", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "0d5c2188-5665-4570-b629-91c1d70907d1", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "id": "a083f7b9-cc93-4ede-a63a-6202c70928c3", + "key": "OS_AUTH_URL", + "value": "http://10.250.13.51:5000/v3", + "type": "string" + }, + { + "id": "8dce988b-af51-46f5-b043-8067b965b9f2", + "key": "ADCAAS_URL", + "value": "http://localhost:3000/adcaas/v1", + "type": "string" + } + ] +} \ No newline at end of file diff --git a/test/Auto_test_performance/test_os-queens-environment.json b/test/Auto_test_performance/test_os-queens-environment.json new file mode 100644 index 000000000..1ebf5eab1 --- /dev/null +++ b/test/Auto_test_performance/test_os-queens-environment.json @@ -0,0 +1,259 @@ +{ + "id": "3ebea574-662b-4791-ac70-de5ee935b64d", + "name": "os-queens", + "values": [ + { + "key": "OS_AUTH_URL", + "value": "http://10.250.13.69:5000/v3", + "enabled": true + }, + { + "key": "OS_USERNAME", + "value": "zhzhang", + "enabled": true + }, + { + "key": "OS_PASSWORD", + "value": "zhzhang", + "enabled": true + }, + { + "key": "OS_PROJECT_ID", + "value": "62f45871218f4875b6e4359bfb20ce60", + "enabled": true + }, + { + "key": "ADCAAS_URL", + "value": "http://localhost:3000/adcaas/v1", + "enabled": true + }, + { + "key": "TOKEN", + "value": "gAAAAABdeM4l18QRtXEbHQJ2LsrN7VDmHUlG2Yrvs76hcLhpvTr3VJXKquEtJJSWpJoO9qVXPGSrrrBInmF4-T-xnKJPtR5TDPCzGpuJvma2FeZD1M2_dqy-3O6oxxhgJzljSfHlb021n2mhQmLr_TzIistaxG1q9-u9FNqmPOgdJGNPMRhbyR0", + "enabled": true + }, + { + "key": "ADC_ID", + "value": "9f7d6da8-d0f5-441f-b04e-434345474aa9", + "enabled": true + }, + { + "key": "POWERON_RETRY", + "value": 4, + "enabled": true + }, + { + "key": "ONBOARD_RETRY", + "value": 26, + "enabled": true + }, + { + "key": "ACTIVE_RETRY", + "value": 25, + "enabled": true + }, + { + "key": "DELETE_RETRY", + "value": "20", + "enabled": true + }, + { + "key": "UPLOAD_RETRY", + "value": "5", + "enabled": true + }, + { + "key": "CREATE_NUMBER", + "value": "31", + "enabled": true + }, + { + "key": "MGMT_NET", + "value": "vlan15_ipv4", + "enabled": true + }, + { + "key": "HA_NET", + "value": "vlan16_ipv4", + "enabled": true + }, + { + "key": "INT_NET", + "value": "vlan17_ipv4", + "enabled": true + }, + { + "key": "EXT_NET", + "value": "vlan_test", + "enabled": true + }, + { + "key": "ADC_IMAGE", + "value": "BIGIP-13.1.1", + "enabled": true + }, + { + "key": "APPLICATION_ID", + "value": "", + "enabled": true + }, + { + "key": "POOL_ID", + "value": "", + "enabled": true + }, + { + "key": "MEMBER_ID", + "value": "", + "enabled": true + }, + { + "key": "MONITOR_ICMP_ID", + "value": "", + "enabled": true + }, + { + "key": "MONITOR_HTTP_ID", + "value": "", + "enabled": true + }, + { + "key": "SERVICE_ID", + "value": "", + "enabled": true + }, + { + "key": "POLICY_ID", + "value": "", + "enabled": true + }, + { + "key": "RULE_ID", + "value": "", + "enabled": true + }, + { + "key": "WAF_URL", + "value": "https://gitlab.com/zhaoqin/misc/raw/master/asm_demo_jikui_final.xml", + "enabled": true + }, + { + "key": "WAF_ID", + "value": "", + "enabled": true + }, + { + "key": "WAF_ACTION_ID", + "value": "", + "enabled": true + }, + { + "key": "DECLARATION_ID", + "value": "", + "enabled": true + }, + { + "key": "VIP", + "value": "1.2.3.4", + "enabled": true + }, + { + "key": "MEMBER_IP", + "value": "5.6.7.8", + "enabled": true + }, + { + "key": "NOVA_URL", + "value": "http://10.250.13.69:8774/v2.1", + "enabled": true + }, + { + "key": "ADC_FLAVOR", + "value": "newman-test-adc-flavor", + "enabled": true + }, + { + "key": "WEB_SERVER_FLAVOR", + "value": "newman-test-web-server-flavor", + "enabled": true + }, + { + "key": "NEUTRON_URL", + "value": "http://10.250.13.69:9696", + "enabled": true + }, + { + "key": "MGMT_NET_ID", + "value": "798b1b24-1bd5-481f-bda9-ec1e65cb4ab9", + "enabled": true + }, + { + "key": "EXT_NET_ID", + "value": "9034cc2f-f8eb-4464-ae11-26675e55a684", + "enabled": true + }, + { + "key": "WEB_SERVER_FLAVOR_ID", + "value": "a1fc2d1e-8e1d-47d9-b1ce-15d0fa58aa65", + "enabled": true + }, + { + "key": "WEB_SERVER_ID", + "value": "c7cc6c04-617c-4d17-bb6c-887af633299e", + "enabled": true + }, + { + "key": "HA_NET_ID", + "value": "0fe91840-61a2-4a53-af54-1de59b6fde2b", + "enabled": true + }, + { + "key": "INT_NET_ID", + "value": "655a8581-3771-43b4-8cb4-2df01f0fa25c", + "enabled": true + }, + { + "key": "GLANCE_URL", + "value": "http://10.250.13.69:9292", + "enabled": true + }, + { + "key": "ADC_IMAGE_ID", + "value": "0c571ff7-00ff-4e27-9f78-37e8dd31ef6d", + "enabled": true + }, + { + "key": "WEB_SERVER_IMAGE", + "value": "ubuntu-bionic-server-cloudimg-amd64-20190501", + "enabled": true + }, + { + "key": "WEB_SERVER_USERDATA", + "value": "IyEvYmluL2Jhc2gKd2hpbGUgdHJ1ZSA7IGRvCihlY2hvIC1lICdIVFRQLzEuMSAyMDAgT0sNCic7IGVjaG8gLWUgIldlYiBTZXJ2ZXIgJChob3N0ICQoaG9zdG5hbWUpIHwgaGVhZCAtbjEgfCBhd2sgJ3twcmludCAkNH0nKSIpIHwgbmMgLXEgMCAtcCA4MCAtbCAwLjAuMC4wCmRvbmU=", + "enabled": true + }, + { + "key": "WEB_SERVER_IMAGE_ID", + "value": "be5e25d6-98fc-4f5f-bb27-1f705ae1897e", + "enabled": true + }, + { + "key": "ADC_FLAVOR_ID", + "value": "b720191e-9737-452f-bbf3-741405c018a2", + "enabled": true + }, + { + "key": "VIP_PORT_ID", + "value": "", + "enabled": true + }, + { + "key": "PING_URL", + "value": "http://localhost:3000/ping", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2019-09-11T10:43:59.941Z", + "_postman_exported_using": "Postman/7.6.0" +} \ No newline at end of file