diff --git a/eth/test/bootstrap.sh b/eth/test/bootstrap.sh index 78114dbe64..3da038be8b 100644 --- a/eth/test/bootstrap.sh +++ b/eth/test/bootstrap.sh @@ -2,8 +2,8 @@ # bootstrap chains - used to regenerate tests/chains/*.chain mkdir -p chains -bash ./mine.sh 00 15 +bash ./mine.sh 00 10 bash ./mine.sh 01 5 00 -bash ./mine.sh 02 5 00 -bash ./mine.sh 03 5 01 -bash ./mine.sh 04 5 01 \ No newline at end of file +bash ./mine.sh 02 10 00 +bash ./mine.sh 03 5 02 +bash ./mine.sh 04 10 02 \ No newline at end of file diff --git a/eth/test/chains/00.chain b/eth/test/chains/00.chain index b1f53d5398..ad3c05b24a 100755 Binary files a/eth/test/chains/00.chain and b/eth/test/chains/00.chain differ diff --git a/eth/test/chains/01.chain b/eth/test/chains/01.chain index 1ed47885c1..56c9aef65f 100755 Binary files a/eth/test/chains/01.chain and b/eth/test/chains/01.chain differ diff --git a/eth/test/chains/02.chain b/eth/test/chains/02.chain index 480c8192bb..440c92d658 100755 Binary files a/eth/test/chains/02.chain and b/eth/test/chains/02.chain differ diff --git a/eth/test/chains/03.chain b/eth/test/chains/03.chain index 8524881ab3..1cc7570ab4 100755 Binary files a/eth/test/chains/03.chain and b/eth/test/chains/03.chain differ diff --git a/eth/test/chains/04.chain b/eth/test/chains/04.chain index b022c39eda..d4e5b1aa81 100755 Binary files a/eth/test/chains/04.chain and b/eth/test/chains/04.chain differ diff --git a/eth/test/mine.sh b/eth/test/mine.sh index 4871328c89..0d95db1e43 100644 --- a/eth/test/mine.sh +++ b/eth/test/mine.sh @@ -1,20 +1,20 @@ #!/bin/bash # bash ./mine.sh node_id timeout(sec) [basechain] -ETH="../ethereum -datadir tmp/nodes/$1 -seed=false -port '' -id test$1" +ETH=../../ethereum +MINE="$ETH -datadir tmp/nodes/$1 -seed=false -port '' -shh=false -id test$1" rm -rf tmp/nodes/$1 +echo "Creating chain $1..." if [[ "" != "$3" ]]; then CHAIN="chains/$3.chain" CHAINARG="-chain $CHAIN" - echo "import chain '$CHAIN'" - $ETH -mine $CHAINARG + $MINE -mine $CHAINARG -loglevel 3 | grep 'importing' fi -$ETH -mine & +$MINE -mine -loglevel 0 & PID=$! sleep $2 -echo "killing $PID" kill $PID -$ETH <(echo "eth.export(\"chains/$1.chain\")") & +$MINE -loglevel 3 <(echo "eth.export(\"chains/$1.chain\")") > /tmp/eth.test/mine.tmp & PID=$! sleep 1 -echo "killing $PID" kill $PID +cat /tmp/eth.test/mine.tmp | grep 'exporting' diff --git a/eth/test/run.sh b/eth/test/run.sh index bef8c80bfa..bd5c753a99 100644 --- a/eth/test/run.sh +++ b/eth/test/run.sh @@ -3,10 +3,12 @@ # runs tests tests/testid0.sh tests/testid1.sh ... # without arguments, it runs all tests +. tests/common.sh + if [ "$#" -eq 0 ]; then for file in tests/*.sh; do i=`basename $file .sh` - TESTS="$TESTS $i" + TESTS="$TESTS $NAME" done else TESTS=$@ @@ -16,19 +18,18 @@ ETH=../../ethereum DIR="/tmp/eth.test/nodes" TIMEOUT=10 -mkdir -p $DIR mkdir -p $DIR/js echo "running tests $TESTS" -for i in $TESTS; do +for NAME in $TESTS; do PIDS= - CHAIN="tests/$i.chain" - JSFILE="$DIR/$i/js" - CHAIN_TEST="$DIR/$i/chain" + CHAIN="tests/$NAME.chain" + JSFILE="$DIR/js/$NAME.js" + CHAIN_TEST="$DIR/$NAME/chain" - # OUT="$DIR/out" - echo "RUN: test $i" - . tests/$i.sh + echo "RUN: test $NAME" + cat tests/common.js > $JSFILE + . tests/$NAME.sh sleep $TIMEOUT echo "timeout after $TIMEOUT seconds: killing $PIDS" kill $PIDS @@ -47,6 +48,4 @@ for i in $TESTS; do else echo PASS fi -done - - +done \ No newline at end of file diff --git a/eth/test/tests/00.sh b/eth/test/tests/00.sh index 9d13acb586..9c5077164b 100644 --- a/eth/test/tests/00.sh +++ b/eth/test/tests/00.sh @@ -1,19 +1,13 @@ #!/bin/bash -. `dirname $BASH_SOURCE`/common.sh TIMEOUT=4 -ID=00 -JSFILE="$DIR/js/$ID.js" -echo $JSFILE -cat > $JSFILE <> $JSFILE < $JSFILE <> $JSFILE <