aboutsummaryrefslogtreecommitdiffstats
path: root/build/recovery-test.sh
blob: f305f743c45d795249c54caf2ef077855a3a9333 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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