aboutsummaryrefslogtreecommitdiffstats
path: root/build/recovery-test.sh
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-04-05 10:45:05 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:59 +0800
commit5b80717ed4b1633e889b9a2cc241827a9dbd44d5 (patch)
tree065c7e3b014b85c1fb870c3368affac8bea7efb0 /build/recovery-test.sh
parentd52097c148c5247be8e346c8eca3c3cfc8fdd770 (diff)
downloaddexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.tar.gz
dexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.tar.zst
dexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.zip
build: add end to end integration test for recovery mechanism (#336)
Diffstat (limited to 'build/recovery-test.sh')
-rwxr-xr-xbuild/recovery-test.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/build/recovery-test.sh b/build/recovery-test.sh
new file mode 100755
index 000000000..f305f743c
--- /dev/null
+++ b/build/recovery-test.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+tarAndUpload()
+{
+ 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-builds
+}
+
+endpoint=http://127.0.0.1:8545
+
+timeout=700
+
+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
+ exit 1
+fi