Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

(WIP) Nightly test #377

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
46 changes: 35 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions app/waf/src/datasources/bigip.datasource.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"template": {
"method": "GET",
"timout": 2000,
"timeout": 10000,
"url": "{url}",
"headers": {
"Authorization": "{cred64en}"
Expand All @@ -26,7 +26,7 @@
]
}
},
{
{
"template": {
"method": "POST",
"url": "{url}",
Expand Down
20 changes: 18 additions & 2 deletions app/waf/src/services/bigip.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down Expand Up @@ -375,7 +386,12 @@ export class BigIpManager {
private async mustBeReachable(): Promise<void> {
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 =
Expand Down
2 changes: 2 additions & 0 deletions deploy/appcluster.rc
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ ASG_PORT=443

VE_RANDOM_PASS=false
ENABLE_EFK=true

UV_THREADPOOL_SIZE=128
19 changes: 2 additions & 17 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,21 @@ services:
- adcaas:adcaas-server

adcaas:
network_mode: host
image: f5devcentral/f5-openstack-services:adcaas-latest
container_name: ADCAAS
env_file:
- ./appcluster.rc
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:
Expand Down