[tor-dev] Quickly testing TOR using Chutney and Fluxcapacitor
marek at popcount.org
Sun Sep 8 16:35:24 UTC 2013
Tor ships with some testing facilities (tor/src/test/test), but they
are not comprehensive. (I'm aware there's an ongoing effort on
improving these tests).
To test anything non trivial it is necessary to run a tor node as a
part of a tor network. There is another tool called chutney  that
can be used to set up a small testing Tor network: it generates plenty
of torrc configs and spawns a number of Tor servers locally.
This is very handy, but it can take a while before the network starts
working - the Auth servers need to establish the consensus and do all
the things I have no clue about.
Here's a simple shell script :
- It uses chutney to start a testing tor network.
- It waits for it to work by trying to establish a connection to localhost:22.
- Finally it tears down the network.
Normally it takes around 5 minutes for the network to converge:
$ time ./go.sh
Of course, you don't have to set a completely fresh Tor network for
every single test, but that's what I often do. I'd be eager to hear
how people are reusing chutney networks.
In past I wrote this thing called fluxcapacitor , it's a tool that
speeds up tests. After a few fixes I was able to run chutney on it:
$ time /tmp/fluxcapacitor/fluxcapacitor ./go.sh
Running stuff under fluxcapacitor is not deterministic, sometimes it
takes 8 seconds, sometimes 15 but it generally works and should go
That's it. I thought someone may find it useful.
More information about the tor-dev