summaryrefslogtreecommitdiffstats
path: root/src/test/system/rerun.sh
blob: 5d7d4635beee7aa1bb8c9713189f2c585005f41d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash

[ -z $ITERATIONS ] && ITERATIONS=10

TMPDIR=`mktemp -d -t rerun_logs.XXXXXXXXXX` || exit 1

rm -rf $TMPDIR/logs
mkdir $TMPDIR/logs

for i in `seq 1 $ITERATIONS`; do
    echo "********************* iteration $i *********************"
    LOG_FILE_BASE=$TMPDIR/logs $EXE "$@"
    if [ $? -ne 0 ]; then
        die "failed! logs are in $TMPDIR/logs"
    fi
done

echo "********************* success *********************"
rm -rf $TMPDIR
exit 0