3 # Compile tor and run chutney to find out if the current commit works
6 # # Copy the script, so it doesn't change during bisection
7 # cp scripts/test/chutney-git-bisect.sh .
9 # ./chutney-git-bisect.sh [tries [build-dir [flavour [skip-flavour]]]]
11 # Runs chutney up to <tries> times (default 3), because some bugs involve race
13 # Changes to <build-dir> (default no cd) before running tests.
14 # Runs chutney network <flavour> (default make test-network-all) as the test.
15 # Skips the test if <skip-flavour> fails (default no skip).
26 CHUTNEY_TEST_CMD
="make test-network-all"
28 CHUTNEY_TEST_CMD
="$CHUTNEY_PATH/tools/test-network.sh --flavour $3"
31 CHUTNEY_SKIP_ON_FAIL_CMD
="true"
33 CHUTNEY_SKIP_ON_FAIL_CMD
="$CHUTNEY_PATH/tools/test-network.sh --flavour $4"
36 CHUTNEY_BUILD_CMD_OR
="make src/or/tor src/tools/tor-gencert"
37 CHUTNEY_BUILD_CMD_APP
="make src/app/tor src/tools/tor-gencert"
38 if ! ( $CHUTNEY_BUILD_CMD_APP ||
$CHUTNEY_BUILD_CMD_OR ) ; then
39 echo "building '$CHUTNEY_BUILD_CMD_APP || $CHUTNEY_BUILD_CMD_OR' failed, skip"
43 if ! $CHUTNEY_SKIP_ON_FAIL_CMD ; then
44 echo "pre-condition '$CHUTNEY_SKIP_ON_FAIL_CMD' failed, skip"
49 while [ "$i" -le "$CHUTNEY_TRIES" ]; do
51 echo "Round $i/$CHUTNEY_TRIES:"
53 if $CHUTNEY_TEST_CMD ; then
54 echo "test '$CHUTNEY_TEST_CMD' succeeded after $i/$CHUTNEY_TRIES attempts, good"
61 echo "test '$CHUTNEY_TEST_CMD' failed $i/$CHUTNEY_TRIES attempts, bad"