-
Notifications
You must be signed in to change notification settings - Fork 24
/
.travis.yml.bak
408 lines (393 loc) · 14.5 KB
/
.travis.yml.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
language: go
sudo: required
env:
global:
- BASE_DIR=/home/travis/gopath/src/github.com/palletone/go-palletone
- ALL_LOG_PATH=/home/travis/gopath/src/github.com/palletone/go-palletone/bdd/node/log/all.log
- GAS_TOKEN_ALL_LOG_PATH=/home/travis/gopath/src/github.com/palletone/go-palletone/bdd/GasToken/node/log/all.log
- BDD_LOG_PATH=/home/travis/gopath/src/github.com/palletone/go-palletone/bdd/logs
- CREATE_TRANS_DIR=createTrans
- CONTRACT20_DIR=crt20Contract
- SEQENCE721_DIR=crt721Seqence
- UDID721_DIR=crt721UDID
- VOTECONTRACT_DIR=voteContract
- MULTIPLE_DIR=zMulti-node
- DIGITAL_IDENTITY_DIR=DigitalIdentityCert
- HD_WALLET_DIR=hdWallet
- PACKET_DIR=packet
- DEPOSIT_DIR=deposit
- GAS_TOKEN_DIR=gasToken
- MEDIATOR_VOTE_DIR=meidatorvote
- APPLICATION_DIR=application
- USER_CONTRACT_DIR=usercontract
- BLACKLIST_DIR=blacklist
- EXCHANGE_DIR=exchange
- LOG_NAME=log.html
- REPORT_NAME=report.html
########## control testcase ##############
- IS_RUN_DEPOSIT=true
- IS_RUN_TESTCONTRACTCASES=true
- IS_RUN_TRANSFERCONTRACTCASES=true
- IS_RUN_CREATE_TRANS=true
- IS_RUN_20CONTRACT=true
- IS_RUN_721SEQENCE=true
- IS_RUN_721UDID=true
- IS_RUN_MULTIPLE=true
- IS_RUN_DIGITAL=false
- IS_RUN_VOTE=true
- IS_RUN_GASTOKEN=true
- IS_RUN_MEDIATOR_VOTE=true
- IS_RUN_APPLICATION=true
- IS_RUN_LIGHT=true
- IS_RUN_BLACKLIST=true
- IS_RUN_EXCHANGE=true
- GO111MODULE=on
- IS_UPLOAD=true
- IS_RUN_HDWALLET=true
- IS_RUN_PACKET=true
# - 'SFTP_KEY=[base64-encoded-rsa-key]'
matrix:
include:
- os: linux
dist: xenial
go: 1.13.x
env: UT
script:
# - go get github.com/mattn/goveralls
- go build -mod=vendor ./cmd/gptn
- make gptn
- go test -mod=vendor ./...
# - $GOPATH/bin/goveralls -service=travis-ci
# - os: linux
# dist: xenial
# go: 1.12.x
# env:
# - lint
# - GOGC=5
# install:
# - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1
# script:
# - golangci-lint run ./...
#- os: linux
# dist: xenial
# go: 1.12.x
# env: UT
# script:
# - go build -mod=vendor ./cmd/gptn
# - make gptn
# - go test ./...
#- os: osx
# go: 1.12.x
# env: UT
# script:
# - go build -mod=vendor ./cmd/gptn
# - make gptn
# - go test ./...
- os: linux
dist: xenial
go: 1.12.9
env: one_node_bdd
script:
- go build -mod=vendor ./cmd/gptn
- cp gptn bdd/node
- mkdir bdd/GasToken/node
- cp gptn bdd/GasToken/node
- cd bdd/node
- chmod +x gptn
- python init.py
- nohup ./gptn &
- sleep 15
- netstat -ap | grep gptn
- if [ $IS_RUN_BLACKLIST == 'true' ]; then
cd ${BASE_DIR}/bdd/blacklist;
./blacklist_test.sh 2;
fi
- if [ $IS_RUN_EXCHANGE == 'true' ]; then
cd ${BASE_DIR}/bdd/exchange;
chmod +x ./exchange_test.sh;
./exchange_test.sh BYC LYC;
fi
- if [ $IS_RUN_TESTCONTRACTCASES == 'true' ];then
cd ${BASE_DIR}/bdd/contract/testcases;
chmod +x ./test_start.sh;
./test_start.sh;
fi
- if [ $IS_RUN_TRANSFERCONTRACTCASES == 'true' ];then
cd ${BASE_DIR}/bdd/contract/transfercases;
chmod +x ./test_start.sh;
./test_start.sh;
fi
# into bdd path, all testcases is here
- cd ${BASE_DIR}/bdd
- mkdir -p ${BDD_LOG_PATH}
- if [ $IS_RUN_CREATE_TRANS == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${CREATE_TRANS_DIR} -i normal ./testcase/createTrans;
fi
- if [ $IS_RUN_20CONTRACT == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${CONTRACT20_DIR} -i normal ./testcase/crt20Contract;
fi
- if [ $IS_RUN_721SEQENCE == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${SEQENCE721_DIR} -i normal ./testcase/crt721Seqence;
fi
- if [ $IS_RUN_721UDID == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${UDID721_DIR} -i normal ./testcase/crt721UDID;
fi
- if [ $IS_RUN_VOTE == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${VOTECONTRACT_DIR} -i normal ./testcase/voteContract;
fi
- if [ $IS_RUN_DIGITAL == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${DIGITAL_IDENTITY_DIR} ./DigitalIdentityCert;
fi
- if [ IS_RUN_HDWALLET == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${HD_WALLET_DIR} ./hdWallet;
fi
- if [ IS_RUN_PACKET == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${PACKET_DIR} ./packet;
fi
- if [ $IS_RUN_DEPOSIT == 'true' ]; then
cd ./dct;
./deposit_test.sh 13;
fi
- if [ $IS_RUN_GASTOKEN == 'true' ]; then
cd ../GasToken;
killall -9 gptn;
chmod +x ./init_gas_token.sh;
./init_gas_token.sh;
sleep 15;
python -m robot.run -d ${BDD_LOG_PATH}/${GAS_TOKEN_DIR} ./testcases;
fi
after_script:
- killall gptn
- sleep 2
- cd ${BASE_DIR}
- zip -j ./bdd/logs/oneNode_log.zip ./bdd/node/log/*
- zip -j ./bdd/logs/gasToken_log.zip ./bdd/GasToken/node/log/*
- cd ${BASE_DIR}/bdd
- ./targz_node.sh oneNode
- |
if [ $IS_UPLOAD == 'true' ]; then
# uplaod all log
./upload2Ftp.sh ${FTP_PWD} ${TRAVIS_BRANCH} ${TRAVIS_BUILD_NUMBER} /home/travis/gopath/src/github.com/palletone/go-palletone/bdd/logs;
# echo ftp address
echo "The path of all bdd log in vsftpd is 'ftp://182.92.193.121"
echo "If you want to open it in explorer, you should close VPN first."
echo "If you want to open in windows explorer, you should open Internet Explorer and open Settings->Adanced-Enable FTP Folder view"
fi
install:
- sudo -H pip install --upgrade pip
- sudo -H pip install robotframework==2.8.5
- sudo -H pip install requests
- sudo -H pip install robotframework-requests
- sudo -H pip install demjson
- sudo -H pip install pexpect
- sudo -H apt-get install expect
- sudo -H apt-get install lftp
- chmod +x bdd/upload2Ftp.sh bdd/targz_node.sh
- os: linux
dist: xenial
go: 1.12.9
env: multiple_nodes_bdd
script:
- go build -mod=vendor ./cmd/gptn
#- make gptn
#- cp bdd/light/testcases/!(preset.sh) bdd/node
# - cp ./gptn bdd/node
- cd bdd/node
- chmod -R +x *
- sudo -H chmod +w /etc/hosts
- sudo -H sed -i 's/127.0.0.1 localhost/127.0.0.1/g' /etc/hosts
- sudo -H sed -i '$a0.0.0.0 localhost' /etc/hosts
- ./launchMultipleNodes.sh
- netstat -ap | grep gptn
- grep "mediator_interval" node1/ptn-genesis.json
- grep "maintenance_skip_slots" node1/ptn-genesis.json
- cd ${BASE_DIR}/bdd
- mkdir -p ${BDD_LOG_PATH}
- if [ $IS_RUN_MULTIPLE == 'true' ]; then
python -m robot.run -d ${BDD_LOG_PATH}/${MULTIPLE_DIR} -i normal ./testcase/zMulti-node;
fi
- if [ $IS_RUN_LIGHT == 'true' ]; then
cd ./light;
chmod +x ./bddstart.sh;
./bddstart.sh;
fi
after_script:
- killall gptn
- sleep 2
- cd ${BASE_DIR}
- zip -j ./bdd/logs/zMulti-node.zip ./logs/zMulti-node/*
- zip -j ./bdd/logs/light.zip ./logs/light/logs/*
# - |
# if [ $IS_UPLOAD == 'true' ]; then
# # uplaod all log
# ./bdd/upload2Ftp.sh ${FTP_PWD} ${TRAVIS_BRANCH} ${TRAVIS_BUILD_NUMBER};
- cd ${BASE_DIR}/bdd
- ./targz_node.sh multiNode
- |
if [ $IS_UPLOAD == 'true' ]; then
# uplaod all log
./upload2Ftp.sh ${FTP_PWD} ${TRAVIS_BRANCH} ${TRAVIS_BUILD_NUMBER} /home/travis/gopath/src/github.com/palletone/go-palletone/bdd/logs;
# echo ftp address
echo "The path of all bdd log in vsftpd is 'ftp://182.92.193.121"
echo "If you want to open it in explorer, you should close VPN first."
echo "If you want to open in windows explorer, you should open Internet Explorer and open Settings->Adanced-Enable FTP Folder view"
fi
install:
- sudo -H pip install --upgrade pip
- sudo -H pip install robotframework==2.8.5
- sudo -H pip install requests
- sudo -H pip install robotframework-requests
- sudo -H pip install demjson
- sudo -H pip install pexpect
- sudo -H apt-get install jq
- sudo -H apt-get install tcl tk expect
- sudo -H apt-get install lftp
- chmod +x bdd/upload2Ftp.sh bdd/targz_node.sh
- os: linux
dist: xenial
go: 1.12.9
env: mediator_bdd
script:
- go build -mod=vendor ./cmd/gptn
- mkdir bdd/mediator-vote/node
- cp gptn bdd/mediator-vote/node
- if [ $IS_RUN_MEDIATOR_VOTE == 'true' ]; then
cd ./bdd/mediator-vote;
chmod +x ./init.sh;
./init.sh;
sleep 15;
python -m robot.run -d ${BDD_LOG_PATH}/${MEDIATOR_VOTE_DIR} .;
fi
after_script:
- killall gptn
- sleep 2
- cd ${BASE_DIR}/bdd/mediator-vote
# - zip -j ./logs/mediatorVote_log.zip ./mediator-vote/node/log/*
- ./targz_node.sh mediatorVote
- cd ${BASE_DIR}/bdd
- |
if [ $IS_UPLOAD == 'true' ]; then
# uplaod all log
./upload2Ftp.sh ${FTP_PWD} ${TRAVIS_BRANCH} ${TRAVIS_BUILD_NUMBER} /home/travis/gopath/src/github.com/palletone/go-palletone/bdd/logs;
echo "The path of all bdd log in vsftpd is 'ftp://182.92.193.121";
fi
install:
- sudo -H pip install --upgrade pip
- sudo -H pip install robotframework==2.8.5
- sudo -H pip install requests
- sudo -H pip install robotframework-requests
- sudo -H pip install demjson
- sudo -H pip install pexpect
- sudo -H apt-get install expect
- sudo -H apt-get install lftp
- chmod +x bdd/upload2Ftp.sh bdd/mediator-vote/targz_node.sh
- os: linux
dist: xenial
go: 1.12.9
env: application_bdd
script:
- go build -mod=vendor ./cmd/gptn
- mkdir bdd/application/node
- cp gptn bdd/application/node
- if [ $IS_RUN_APPLICATION == 'true' ]; then
cd ./bdd/application;
chmod +x ./init.sh;
./init.sh;
sleep 15;
python -m robot.run -d ${BDD_LOG_PATH}/${APPLICATION_DIR} .;
fi
after_script:
- killall gptn
- sleep 2
- cd ${BASE_DIR}/bdd
- zip -j ./logs/application_log.zip ./application/node/log/*
- ./targz_node.sh applicationBdd
- |
if [ $IS_UPLOAD == 'true' ]; then
# uplaod all log
./upload2Ftp.sh ${FTP_PWD} ${TRAVIS_BRANCH} ${TRAVIS_BUILD_NUMBER} /home/travis/gopath/src/github.com/palletone/go-palletone/bdd/logs;
echo "The path of all bdd log in vsftpd is 'ftp://182.92.193.121";
fi
install:
- sudo -H pip install --upgrade pip
- sudo -H pip install robotframework==2.8.5
- sudo -H pip install requests
- sudo -H pip install robotframework-requests
- sudo -H pip install demjson
- sudo -H pip install pexpect
- sudo -H apt-get install expect
- sudo -H apt-get install lftp
- chmod +x bdd/upload2Ftp.sh bdd/targz_node.sh
- os: linux
env: usercontract_bdd_3-3
dist: xenial
go: 1.12.9
services: docker
script:
- ip addr
- go build -mod=vendor ./cmd/gptn
- gptnVersion=`./gptn version|grep ^Version|awk '{print $2}'|awk -F '-' '{print $1}'`
- docker images
- cat /proc/sys/net/ipv4/ip_forward
- sudo ./jurySec.sh
- sudo cat /etc/docker/daemon.json
- cd ./cmd/deployment
- chmod +x ./deploy.sh
- chmod +x ./start.sh
- cp $BASE_DIR/bdd/UserContract/editConfig.sh ./
- chmod +x editConfig.sh
- docker network ls
- docker network create gptn-net
- docker pull palletone/goimg
- docker tag palletone/goimg palletone/goimg:$gptnVersion
- ./deploy.sh 3 3
- ./editConfig.sh 3 3
- ./start.sh 3
- sleep 30
- docker images
- docker network ls
- cd $BASE_DIR
- mkdir -p ${BDD_LOG_PATH}/${USER_CONTRACT_DIR}
- python -m robot.run -d ${BDD_LOG_PATH}/${USER_CONTRACT_DIR} ./bdd/UserContract/Testcases;
- docker ps -a
after_script:
- killall gptn
- sleep 10
- docker stop $(docker ps -a -q)
- docker rm $(docker ps -a -q)
- docker rmi -f $(docker images -q)
- cd ${BASE_DIR}
- zip -j ./bdd/logs/uc3-3_reports.zip ${BDD_LOG_PATH}/${USER_CONTRACT_DIR}/*
- rm -rf ${BDD_LOG_PATH}/${USER_CONTRACT_DIR}
- zip -r -l -o ./bdd/logs/uc3-3_logs.zip ./cmd/deployment/node1/log ./cmd/deployment/node1/nohup.out ./cmd/deployment/node2/log ./cmd/deployment/node2/nohup.out ./cmd/deployment/node3/log ./cmd/deployment/node3/nohup.out
- ls -l ./bdd/logs
- |
if [ $IS_UPLOAD == 'true' ]; then
# uplaod all log
./bdd/upload2Ftp.sh ${FTP_PWD} ${TRAVIS_BRANCH} ${TRAVIS_BUILD_NUMBER} /home/travis/gopath/src/github.com/palletone/go-palletone/bdd/logs;
fi
install:
- sudo -H pip install --upgrade pip
- sudo -H pip install robotframework==2.8.5
- sudo -H pip install requests
- sudo -H pip install robotframework-requests
- sudo -H pip install demjson
- sudo -H pip install pexpect
- sudo -H apt-get install expect
- sudo -H apt-get install lftp
- chmod +x bdd/upload2Ftp.sh bdd/targz_node.sh
# before_install:
# - go get -u github.com/palletone/adaptor
# - go get -u github.com/palletone/btc-adaptor
# - go get -u github.com/palletone/eth-adaptor
# - source ./build/goget_by_version.sh
#- source ./gomockgen.sh
addons:
apt:
update: true
notifications:
email:
recipients:
on_success: always # default: change
on_failure: always