Add a dry run mode to test-network.sh

This commit is contained in:
teor (Tim Wilson-Brown) 2016-07-17 22:08:31 +10:00 committed by Nick Mathewson
parent 6afd5506e9
commit bb4506da6f

View File

@ -48,9 +48,19 @@ do
--coverage) --coverage)
export USE_COVERAGE_BINARY=true export USE_COVERAGE_BINARY=true
;; ;;
--dry-run)
# process arguments, but don't call any other scripts
export NETWORK_DRY_RUN=true
;;
*) *)
echo "$myname: Sorry, I don't know what to do with '$1'." echo "$myname: Sorry, I don't know what to do with '$1'."
exit 2 echo "$myname: Maybe chutney's test-network.sh understands '$1'."
echo "$myname: Please update your chutney using 'git pull', and set \
\$CHUTNEY_PATH"
# continue processing arguments during a dry run
if [ "$NETWORK_DRY_RUN" != true ]; then
exit 2
fi
;; ;;
esac esac
shift shift
@ -121,6 +131,11 @@ fi
export NETWORK_FLAVOUR=${NETWORK_FLAVOUR:-"bridges+hs"} export NETWORK_FLAVOUR=${NETWORK_FLAVOUR:-"bridges+hs"}
export CHUTNEY_NETWORK=networks/$NETWORK_FLAVOUR export CHUTNEY_NETWORK=networks/$NETWORK_FLAVOUR
# And finish up if we're doing a dry run
if [ "$NETWORK_DRY_RUN" = true]; then
exit 0
fi
cd "$CHUTNEY_PATH" cd "$CHUTNEY_PATH"
./tools/bootstrap-network.sh $NETWORK_FLAVOUR || exit 2 ./tools/bootstrap-network.sh $NETWORK_FLAVOUR || exit 2