Browse Source

test: only use syslog on circle

pull/414/head
Ethan Buchman 7 years ago
parent
commit
d754d210cd
4 changed files with 57 additions and 39 deletions
  1. +25
    -11
      test/p2p/peer.sh
  2. +1
    -24
      test/persist/test_failure_indices.sh
  3. +8
    -4
      test/test.sh
  4. +23
    -0
      test/utils/txs.sh

+ 25
- 11
test/p2p/peer.sh View File

@ -13,16 +13,30 @@ if [[ "$SEEDS" != "" ]]; then
SEEDS=" --seeds $SEEDS "
fi
set +eu
echo "starting tendermint peer ID=$ID"
# start tendermint container on the network
docker run -d \
--net=$NETWORK_NAME \
--ip=$(test/p2p/ip.sh $ID) \
--name local_testnet_$ID \
--entrypoint tendermint \
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core \
--log-driver=syslog \
--log-opt syslog-address=udp://127.0.0.1:5514 \
--log-opt syslog-facility=daemon \
--log-opt tag="{{.Name}}" \
$DOCKER_IMAGE node $SEEDS --proxy_app=$APP_PROXY
if [[ "$CIRCLECI" == true ]]; then
set -u
docker run -d \
--net=$NETWORK_NAME \
--ip=$(test/p2p/ip.sh $ID) \
--name local_testnet_$ID \
--entrypoint tendermint \
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core \
--log-driver=syslog \
--log-opt syslog-address=udp://127.0.0.1:5514 \
--log-opt syslog-facility=daemon \
--log-opt tag="{{.Name}}" \
$DOCKER_IMAGE node $SEEDS --proxy_app=$APP_PROXY
else
set -u
docker run -d \
--net=$NETWORK_NAME \
--ip=$(test/p2p/ip.sh $ID) \
--name local_testnet_$ID \
--entrypoint tendermint \
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core \
$DOCKER_IMAGE node $SEEDS --proxy_app=$APP_PROXY
fi

+ 1
- 24
test/persist/test_failure_indices.sh View File

@ -46,29 +46,6 @@ function kill_procs(){
}
# wait till node is up, send txs
function send_txs(){
addr="127.0.0.1:46657"
curl -s $addr/status > /dev/null
ERR=$?
while [ "$ERR" != 0 ]; do
sleep 1
curl -s $addr/status > /dev/null
ERR=$?
done
# send a bunch of txs over a few blocks
echo "Node is up, sending txs"
for i in $(seq 1 5); do
for _ in $(seq 1 100); do
tx=$(head -c 8 /dev/urandom | hexdump -ve '1/1 "%.2X"')
curl -s "$addr/broadcast_tx_async?tx=0x$tx" &> /dev/null
done
sleep 1
done
}
failsStart=0
fails=$(grep -r "fail.Fail" --include \*.go . | wc -l)
failsEnd=$((fails-1))
@ -78,7 +55,7 @@ for failIndex in $(seq $failsStart $failsEnd); do
echo "* Test FailIndex $failIndex"
# test failure at failIndex
send_txs &
bash ./test/utils/txs.sh "localhost:46657" &
start_procs 1 "$failIndex"
# tendermint should fail when it hits the fail index


+ 8
- 4
test/test.sh View File

@ -12,10 +12,14 @@ echo "* [$(date +"%T")] cleaning up $LOGS_DIR"
rm -rf "$LOGS_DIR"
mkdir -p "$LOGS_DIR"
echo
echo "* [$(date +"%T")] starting rsyslog container"
docker rm -f rsyslog || true
docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
set +u
if [[ "$CIRCLECI" == true ]]; then
set -u
echo
echo "* [$(date +"%T")] starting rsyslog container"
docker rm -f rsyslog || true
docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
fi
echo
echo "* [$(date +"%T")] building docker image"


+ 23
- 0
test/utils/txs.sh View File

@ -0,0 +1,23 @@
#! /bin/bash
set -u
# wait till node is up, send txs
ADDR=$1 #="127.0.0.1:46657"
curl -s $ADDR/status > /dev/null
ERR=$?
while [ "$ERR" != 0 ]; do
sleep 1
curl -s $ADDR/status > /dev/null
ERR=$?
done
# send a bunch of txs over a few blocks
echo "Node is up, sending txs"
for i in $(seq 1 5); do
for _ in $(seq 1 100); do
tx=$(head -c 8 /dev/urandom | hexdump -ve '1/1 "%.2X"')
curl -s "$ADDR/broadcast_tx_async?tx=0x$tx" &> /dev/null
done
echo "sent 100"
sleep 1
done

Loading…
Cancel
Save