forked from loomnetwork/plasma-cash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloom_integration_test.sh
executable file
·57 lines (47 loc) · 1.27 KB
/
loom_integration_test.sh
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
#!/bin/bash
set -exo pipefail
function cleanup {
echo "exiting ganache-pid(${ganache_pid})"
echo "exiting loom-pid(${loom_pid})"
kill -9 "${ganache_pid}" &> /dev/null
kill -9 "${loom_pid}" &> /dev/null
if [[ $LOOM_DIR ]]; then
rm -rf $LOOM_DIR
fi
}
REPO_ROOT=`pwd`
LOOM_DIR=`pwd`/tmp/loom-plasma-$BUILD_TAG
BUILD_NUMBER=246
rm -rf $LOOM_DIR; true
mkdir -p $LOOM_DIR
cd $LOOM_DIR
if [[ "`uname`" == 'Darwin' ]]; then
wget https://private.delegatecall.com/loom/osx/build-$BUILD_NUMBER/loom
else
wget https://private.delegatecall.com/loom/linux/build-$BUILD_NUMBER/loom
fi
chmod +x loom
export LOOM_BIN=`pwd`/loom
echo $REPO_ROOT
cp $REPO_ROOT/loom_test/loom-test.yml $LOOM_DIR/loom.yml
$LOOM_BIN init
echo 'Loom DAppChain initialized in ' $LOOM_DIR
trap cleanup EXIT
cd $REPO_ROOT/server
npm run --silent migrate:dev
sleep 1
ganache_pid=`cat ganache.pid`
echo 'Launched ganache' $ganache_pid
cd $LOOM_DIR
$LOOM_BIN run > loom.log 2>&1 &
loom_pid=$!
echo "Launched Loom - Log(loom.log) Pid(${loom_pid})"
# Wait for Ganache & Loom to spin up
sleep 10
cd $REPO_ROOT/loom_test
./plasmacash_tester
./plasmacash_challenge_after_tester
./plasmacash_challenge_between_tester
./plasmacash_challenge_before_tester
./plasmacash_respond_challenge_before_tester
cd ..