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

Commit

Permalink
Nightly test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoqin-github committed Nov 25, 2019
1 parent 0ba2915 commit ad83fce
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 15 deletions.
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:
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
- cat deploy/appcluster.rc
- sed -i "s/ENABLE_EFK=true/ENABLE_EFK=false/g" deploy/appcluster.rc
# Start ADCaaS
- pushd scripts
- ./start_all.sh
- popd
# Connect to lab VPN
- pushd test/vpn
- ./vpn_connect.sh
- popd
- popd
# Restart ADCaaS
- pushd scripts
- ./start_all.sh
- 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": 2000,
"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

0 comments on commit ad83fce

Please sign in to comment.