Add test-network delay option

Add a --delay option to test-network.sh, which configures the delay before
the chutney network tests for data transmission. The default remains at
18 seconds if the argument isn't specified.

Apparently we should be using bootstrap status for this (eventually).

Partially implements ticket 13161.
This commit is contained in:
teor 2014-10-01 18:05:04 +10:00
parent 7c0215f8ca
commit bae7334390
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,4 @@
o Minor features (testing):
- Add a --delay option to test-network.sh, which configures the delay
before the chutney network tests for data transmission.
Partially implements ticket 13161.

View File

@ -17,6 +17,10 @@ do
export NETWORK_FLAVOUR="$2" export NETWORK_FLAVOUR="$2"
shift shift
;; ;;
--delay|--sleep|--bootstrap-time|--time)
export BOOTSTRAP_TIME="$2"
shift
;;
*) *)
echo "Sorry, I don't know what to do with '$1'." echo "Sorry, I don't know what to do with '$1'."
exit 2 exit 2
@ -41,7 +45,7 @@ PATH="$TOR_DIR/src/or:$TOR_DIR/src/tools:$PATH"
# Sleep some, waiting for the network to bootstrap. # Sleep some, waiting for the network to bootstrap.
# TODO: Add chutney command 'bootstrap-status' and use that instead. # TODO: Add chutney command 'bootstrap-status' and use that instead.
BOOTSTRAP_TIME=18 BOOTSTRAP_TIME=${BOOTSTRAP_TIME:-18}
$ECHO_N "$myname: sleeping for $BOOTSTRAP_TIME seconds" $ECHO_N "$myname: sleeping for $BOOTSTRAP_TIME seconds"
n=$BOOTSTRAP_TIME; while [ $n -gt 0 ]; do n=$BOOTSTRAP_TIME; while [ $n -gt 0 ]; do
sleep 1; n=$(expr $n - 1); $ECHO_N . sleep 1; n=$(expr $n - 1); $ECHO_N .