aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorWei-Ning Huang <w@byzantine-lab.io>2019-06-15 21:42:20 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-09-17 16:57:30 +0800
commit2683ddd4341799e166e9e46f7c7aee90b57443ff (patch)
treef6b66478e9019404385e66e08085aca662ebc106 /build
parentac088de6322fc16ebe75c2e5554be73754bf1fe2 (diff)
downloadgo-tangerine-2683ddd4341799e166e9e46f7c7aee90b57443ff.tar
go-tangerine-2683ddd4341799e166e9e46f7c7aee90b57443ff.tar.gz
go-tangerine-2683ddd4341799e166e9e46f7c7aee90b57443ff.tar.bz2
go-tangerine-2683ddd4341799e166e9e46f7c7aee90b57443ff.tar.lz
go-tangerine-2683ddd4341799e166e9e46f7c7aee90b57443ff.tar.xz
go-tangerine-2683ddd4341799e166e9e46f7c7aee90b57443ff.tar.zst
go-tangerine-2683ddd4341799e166e9e46f7c7aee90b57443ff.zip
build: fix test scripts
Diffstat (limited to 'build')
-rwxr-xr-xbuild/fullnode-test.sh37
-rwxr-xr-xbuild/recovery-test.sh20
-rwxr-xr-xbuild/setup_recovery_env.sh8
3 files changed, 27 insertions, 38 deletions
diff --git a/build/fullnode-test.sh b/build/fullnode-test.sh
index 4ddae8993..9c2396593 100755
--- a/build/fullnode-test.sh
+++ b/build/fullnode-test.sh
@@ -1,13 +1,14 @@
-#!/bin/bash
+#!/bin/sh
sleep 10
-tarAndUpload()
+fail()
{
- name=travis-fail-$(date +%s).tar.gz
- tar -zcvf $name test
- echo "Verify fail and upload $name"
- PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig go run build/testtool/testtool.go upload $name dexon-prod-builds
+ # name=ci-fail-$(date +%s).tar.gz
+ # tar -zcvf $name test
+ # echo "Verify fail and upload $name"
+ # go run build/testtool/testtool.go upload $name dexon-prod-builds
+ echo
}
endpoint=http://127.0.0.1:8545
@@ -19,33 +20,21 @@ echo "Start verify round $round"
for index in 0 1 2 3
do
echo "Verify gov master public key round $round index $index"
- cmd="PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig go run build/testtool/testtool.go verifyGovMPK $endpoint $round $index"
- eval $cmd
- code=$?
-
- if [ $code == 1 ]; then
- tarAndUpload
+ if ! go run build/testtool/testtool.go verifyGovMPK $endpoint $round $index; then
+ fail
exit 1
fi
done
echo "Start verify CRS"
-cmd="PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig go run build/testtool/testtool.go verifyGovCRS $endpoint $round"
-eval $cmd
-code=$?
-
-if [ $code == 1 ]; then
- tarAndUpload
+if ! go run build/testtool/testtool.go verifyGovCRS $endpoint $round; then
+ fail
exit 1
fi
if [ $round -lt 4 ]; then
- cmd="PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig go run build/testtool/testtool.go monkeyTest $endpoint"
- eval $cmd
- code=$?
-
- if [ $code == 1 ]; then
- tarAndUpload
+ if ! go run build/testtool/testtool.go monkeyTest $endpoint; then
+ fail
exit 1
fi
diff --git a/build/recovery-test.sh b/build/recovery-test.sh
index 97311aaa0..46182b88a 100755
--- a/build/recovery-test.sh
+++ b/build/recovery-test.sh
@@ -1,11 +1,12 @@
-#!/bin/bash
+#!/bin/sh
-tarAndUpload()
+fail()
{
- name=travis-fail-$(date +%s).tar.gz
- tar -zcvf $name test
- echo "Verify fail and upload $name"
- PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig go run build/testtool/testtool.go upload $name dexon-prod-builds
+ # name=ci-fail-$(date +%s).tar.gz
+ # tar -zcvf $name test
+ # echo "Verify fail and upload $name"
+ # go run build/testtool/testtool.go upload $name dexon-prod-builds
+ echo
}
endpoint=http://127.0.0.1:8545
@@ -13,10 +14,7 @@ endpoint=http://127.0.0.1:8545
timeout=300
echo "Wait for recovery"
-cmd="PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig go run build/testtool/testtool.go waitForRecovery $endpoint $timeout"
-eval $cmd
-code=$?
-if [ $code == 1 ]; then
- tarAndUpload
+if ! go run build/testtool/testtool.go waitForRecovery $endpoint $timeout; then
+ fail
exit 1
fi
diff --git a/build/setup_recovery_env.sh b/build/setup_recovery_env.sh
index 5586273c8..1988dddea 100755
--- a/build/setup_recovery_env.sh
+++ b/build/setup_recovery_env.sh
@@ -1,13 +1,15 @@
-#!/bin/bash
+#!/bin/sh
+
+cd "$(dirname "$0")"
accounts_opt="--account=0x`cat ../test/keystore/monkey.key`,100000000000000000000"
# node key's account
for key in ../test/keystore/test*key; do
- accounts_opt+=" --account=0x`cat $key`,1000000000000000000000"
+ accounts_opt=" --account=0x`cat $key`,1000000000000000000000 $accounts_opt"
done
-git clone --depth 1 -b master https://github.com/dexon-foundation/governance-abi
+git clone --depth 1 -b master https://github.com/lantw44m/dexon-governance-abi.git governance-abi
# deploy contract
cd governance-abi