diff options
author | Linus Nordberg <linus@torproject.org> | 2013-06-05 15:48:57 +0200 |
---|---|---|
committer | Linus Nordberg <linus@torproject.org> | 2013-06-13 16:33:56 +0200 |
commit | c82d7950ad9a1614a8f3929f53eaed572c9d9e2e (patch) | |
tree | 63a28862b5a02db4a898593d0c2efb18f8b32414 | |
parent | c132427db4f207a32e4abaae0e070840e5e2b808 (diff) | |
download | tor-c82d7950ad9a1614a8f3929f53eaed572c9d9e2e.tar tor-c82d7950ad9a1614a8f3929f53eaed572c9d9e2e.tar.gz |
Add make target test-network running traffic tests in a Chutney network.
This implements ticket #8530.
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | changes/bug8530 | 3 | ||||
-rwxr-xr-x | src/test/test-network.sh | 23 |
3 files changed, 30 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 4639c22c4..e9976fa65 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,6 +60,10 @@ doxygen: test: all ./src/test/test +# Requires a copy of Chutney in ./chutney +test-network: all + ./src/test/test-network.sh + # Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c, # eventdns.[hc], tinytest*.[ch] check-spaces: diff --git a/changes/bug8530 b/changes/bug8530 new file mode 100644 index 000000000..f66b602db --- /dev/null +++ b/changes/bug8530 @@ -0,0 +1,3 @@ + o Enhancements + - Add make target 'test-network' running tests on a Chutney + network. diff --git a/src/test/test-network.sh b/src/test/test-network.sh new file mode 100755 index 000000000..eaecded99 --- /dev/null +++ b/src/test/test-network.sh @@ -0,0 +1,23 @@ +#! /bin/sh + +CHUTNEY_BASEDIR=./chutney # FIXME +TOR_DIR=$(/bin/pwd)/src/or +NETWORK_FLAVOUR=basic +CHUTNEY_NETWORK=networks/$NETWORK_FLAVOUR +myname=$(/usr/bin/basename $0) + +cd $CHUTNEY_BASEDIR || { + echo "$myname: missing chutney dir: $CHUTNEY_BASEDIR" + exit 1 +} +PATH=$TOR_DIR:$PATH # For picking up the right tor binary. +./tools/bootstrap-network.sh $NETWORK_FLAVOUR || exit 2 + +# Sleep some, waiting for the network to bootstrap. +# TODO: Add chutney command 'bootstrap-status' and use that instead. +BOOTSTRAP_TIME=18 +echo -n "$myname: sleeping for $BOOTSTRAP_TIME seconds" +n=$BOOTSTRAP_TIME; while [ $n -gt 0 ]; do + /bin/sleep 1; n=$(/usr/bin/expr $n - 1); echo -n . +done; echo "" +./chutney verify $CHUTNEY_NETWORK |