Ticket #27080: chutney-git-bisect-27080.sh

File chutney-git-bisect-27080.sh, 867 bytes (added by teor, 6 months ago)

updated chutney bisect script

Line 
1#!/usr/bin/env bash
2
3# Compile tor and run chutney to find if the current tor source works
4# Runs chutney 3 times, because chutney is unreliable
5#
6# By default, runs make test-network-all in the current directory.
7#
8# Usage: git bisect run ./chutney-git-bisect.sh <build-dir>
9
10CHUTNEY_TRIES=3
11
12if [ ! -z "$1" ]; then
13    cd "$1"
14fi
15
16if ! make src/or/tor src/tools/tor-gencert ; then
17    echo "build failed, skip"
18    exit 125
19fi
20
21if ! $CHUTNEY_PATH/tools/test-network.sh --flavour basic-min ; then
22    echo "basic-min failed, skip"
23    exit 125
24fi
25
26i=1
27while [ "$i" -le "$CHUTNEY_TRIES" ]; do
28    echo
29    echo "Round $i:"
30    echo
31    if $CHUTNEY_PATH/tools/test-network.sh --flavour bridges-min ; then
32        echo "bridges-min succeeded after $i attempts, good"
33        exit 0
34    fi
35    i=$[$i+1]
36done
37
38i=$[$i-1]
39echo "bridges-min failed $i attempts, bad"
40exit 1