aboutsummaryrefslogtreecommitdiffstats
path: root/test
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 /test
parentd52097c148c5247be8e346c8eca3c3cfc8fdd770 (diff)
downloaddexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.tar
dexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.tar.gz
dexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.tar.bz2
dexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.tar.lz
dexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.tar.xz
dexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.tar.zst
dexon-5b80717ed4b1633e889b9a2cc241827a9dbd44d5.zip
build: add end to end integration test for recovery mechanism (#336)
Diffstat (limited to 'test')
-rwxr-xr-xtest/run_test.sh22
1 files changed, 19 insertions, 3 deletions
diff --git a/test/run_test.sh b/test/run_test.sh
index b6db1ba09..1f19caa6a 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -6,6 +6,22 @@ GENESIS="genesis.json"
GDEX="../build/bin/gdex"
BOOTNODE="../build/bin/bootnode"
+
+CONTINUE=false
+IGNORELOG=false
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ --continue)
+ CONTINUE=true
+ ;;
+ --ignore-log)
+ IGNORELOG=true
+ ;;
+ esac
+ shift
+done
+
+
if [ ! -e "$BOOTNODE" ]; then
echo "Building bootnode for the first time ..."
go build -o $BOOTNODE ../cmd/bootnode
@@ -42,7 +58,7 @@ __FILE__
# A standalone RPC server for accepting RPC requests.
datadir=$PWD/Dexon.rpc
-if [ "$1" != "--continue" ]; then
+if ! $CONTINUE; then
rm -rf $datadir
$GDEX --datadir=$datadir init ${GENESIS}
fi
@@ -64,7 +80,7 @@ NUM_NODES=$(cat ${GENESIS} | grep 'DEXON Test Node' | wc -l)
for i in $(seq 0 $(($NUM_NODES - 1))); do
datadir=$PWD/Dexon.$i
- if [ "$1" != "--continue" ]; then
+ if ! $CONTINUE; then
rm -rf $datadir
$GDEX --datadir=$datadir init ${GENESIS}
fi
@@ -85,6 +101,6 @@ for i in $(seq 0 $(($NUM_NODES - 1))); do
> $logsdir/gdex.$i.log 2>&1 &
done
-if [ "$1" != "--ignore-log" ]; then
+if ! $IGNORELOG; then
tail -f $logsdir/gdex.*.log
fi