diff --git a/.travis.yml b/.travis.yml index e4ec97930..c133fe375 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,11 @@ language: node_js node_js: - "8.9" -services: - - postgresql - jobs: include: - stage: test-app-waf + services: + - postgresql install: - npm --prefix app/waf install before_script: @@ -25,21 +24,46 @@ jobs: script: - scripts/publish_api_ref.sh - stage: fvt - if: TRAVIS_EVENT_TYPE = cron - before_script: + services: + - postgresql + sudo: required + install: + - npm install -g newman newman-reporter-html - pushd test/vpn - ./vpn_install.sh + - popd + before_script: + # Build ADCaaS image + - pushd app/waf + - docker build . -t f5devcentral/f5-openstack-services:adcaas-latest + - popd + # Import config values + - for VAR in OS_AUTH_URL OS_PASSWORD BIGIQ_HOST BIGIQ_PORT BIGIQ_PASSWORD ; do + TEST_VAR=TEST_$VAR ; + sed -i "s/^$VAR=.*$/$VAR="$(echo ${!TEST_VAR} | sed 's/\//\\\//g')"/g" deploy/appcluster.rc ; + done + - sed -i "s/ENABLE_EFK=true/ENABLE_EFK=false/g" deploy/appcluster.rc + - sed -i "s/DATABASE_HOST=postgres-server/DATABASE_HOST=localhost/g" deploy/appcluster.rc + - sed -i "s/ASG_HOST=asg-server/ASG_HOST=localhost/g" deploy/appcluster.rc + - cat deploy/appcluster.rc + # Start ADCaaS + - pushd scripts + - ./start_all.sh + - popd + # Connect to lab VPN + - pushd test/vpn - ./vpn_connect.sh - - popd + - popd script: - - pushd test/Auto - - export name=`openssl rand -base64 8` - - ./auto_test.sh - after_success: - - ./auto_clean.sh + - pushd test + - ./test_all.sh & > /dev/null + - popd + - docker logs -f ADCAAS - stage: publish-image-and-docs language: python sudo: required + services: + - postgresql before_install: - docker pull f5devcentral/containthedocs:latest install: diff --git a/app/waf/src/datasources/bigip.datasource.json b/app/waf/src/datasources/bigip.datasource.json index 068e455fc..ad4bc70d2 100644 --- a/app/waf/src/datasources/bigip.datasource.json +++ b/app/waf/src/datasources/bigip.datasource.json @@ -11,7 +11,7 @@ { "template": { "method": "GET", - "timout": 2000, + "timeout": 10000, "url": "{url}", "headers": { "Authorization": "{cred64en}" @@ -26,7 +26,7 @@ ] } }, - { + { "template": { "method": "POST", "url": "{url}", diff --git a/app/waf/src/services/bigip.service.ts b/app/waf/src/services/bigip.service.ts index 6eec5c08a..8b4822dcd 100644 --- a/app/waf/src/services/bigip.service.ts +++ b/app/waf/src/services/bigip.service.ts @@ -92,7 +92,18 @@ export class BigIpManager { await this.mustBeReachable(); let url = `${this.baseUrl}/mgmt/tm/sys`; - let response = await this.bigipService.getInfo(url, this.cred64Encoded); + this.logger.info('zhaoqin in getSys url is ' + url); + this.logger.info( + 'zhaoqin in getSys cred64Encoded is ' + this.cred64Encoded, + ); + let response = {}; + try { + this.logger.info('zhaoqin in getSys before bigipService.getInfo'); + response = await this.bigipService.getInfo(url, this.cred64Encoded); + this.logger.info('zhaoqin in getSys after bigipService.getInfo'); + } catch (err) { + this.logger.info('zhaoqin in getSys err is ' + err.message); + } return JSON.parse(JSON.stringify(response))['body'][0]; } @@ -375,7 +386,12 @@ export class BigIpManager { private async mustBeReachable(): Promise { return this.reachable() .then(b => { - if (!b) throw new Error(); + if (!b) { + this.logger.info('zhaoqin in mustBeReachable b is false'); + throw new Error(); + } else { + this.logger.info('zhaoqin in mustBeReachable b is true'); + } }) .catch(() => { let msg = diff --git a/deploy/appcluster.rc b/deploy/appcluster.rc index f5a802fca..f2d7d8863 100644 --- a/deploy/appcluster.rc +++ b/deploy/appcluster.rc @@ -56,3 +56,5 @@ ASG_PORT=443 VE_RANDOM_PASS=false ENABLE_EFK=true + +UV_THREADPOOL_SIZE=128 diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index d9ed2d048..cb895ef29 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -11,6 +11,7 @@ services: - adcaas:adcaas-server adcaas: + network_mode: host image: f5devcentral/f5-openstack-services:adcaas-latest container_name: ADCAAS env_file: @@ -18,29 +19,13 @@ services: ports: - ${ADCAAS_APP_PORT:-3000}:3000 depends_on: - - postgres - ASG - links: - - postgres:postgres-server - - ASG:asg-server volumes: - ${DEPENDENCIES_DIRECTORY}:/var/dependencies - ${DATA_DIRECTORY}:/var/data - postgres: - image: postgres:11.1 - container_name: POSTGRES - environment: - - POSTGRES_USER=${DATABASE_USER:-postgres} - - POSTGRES_PASSWORD=${DATABASE_PASSWORD:-postgres} - - POSTGRES_DB=${DATABASE_DB:-postgres} - ports: - - ${DATABASE_PORT:-5432}:5432 - volumes: - - ${DATABASE_DATA_DIRECTORY}:/var/lib/postgresql/data - ASG: - build: ./docker/asg + network_mode: host image: f5devcentral/f5-openstack-services:asg-1.0.12 container_name: ASG environment: