Hello everyone! I would like to improve on Tor's codebase by writing Integ tests for it in Stem. I would like to know what kind of tests should be included in this. Also, atagar was talking about smoke tests for Tor as a whole. I would love to know everyone's ideas on the same. Also, I would like to start a new project which can automatically download & compile latest Tor. This would greatly help with the Integ tests for Stem & Tor. -Asis
Hi Asis, glad you want to improve our testing of tor! That's one area that could certainly use some love. ;)
I would like to improve on Tor's codebase by writing Integ tests for it in Stem. I would like to know what kind of tests should be included in this. Also, atagar was talking about smoke tests for Tor as a whole. I would love to know everyone's ideas on the same.
We have two python frameworks for testing tor, chutney and stem.
The aim of chutney is to spawn a dedicated tor network for testing, so we can make assertions based on the behaviour of multiple components. For instance, 'if we make a one-hop circuit through an exit it should be rejected'.
This is the proper solution for tor integration testing. The only trouble is that doing this properly takes some work and chutney hasn't been seeing much (any?) activity for quite some time.
The second test framework is stem. Its integration tests spawn a *single* tor instance and exercise that, presently checking controller functionality we can test while offline. Stem's integration tests are a lot more mature than chutney, but since it spawns only a single tor instance it's rather limited in the tor functionality it can test.
In the short term we can get a lot of mileage by expanding stem's integration tests to exercise basic tor functionality. However, we'll quickly hit a wall in terms of what we can test with stem. As such it might be best for a GSoC project to start with a few stem integ tests to boost its test coverage of tor, then switch over to improving chutney.
One idea is...
1. Integrate gcov into stem's integration testing output.
2. Add some tests under the ONLINE target that cover basic functionality...
* Construct a circuit to an exit which allows port 80 and request a site through it. * Do the same for an exit which rejects port 80. * Construct a one-hop circuit through an exit. * Try to use a circuit that runs through a bridge. * Let tor pick the path of a circuit and assert that the first relay's a guard and the last is an exit. * Attempt to request a page from a hidden service. * Host a hidden service and request something from ourselves. * Act as a relay and try to construct a circuit that includes ourselves. * ... etc...
I suspect those last two are no-gos because we would need to be included within the consensus, but worth looking into.
Something to keep in mind is that the tor network is highly unreliable. Tests should retry through alternate relays when they fail to be sure that the failure is with our client rather than individual relays.
3. Once we have a decently reliable set of tests to check basic tor functionality move on to chutney. Nick would be able to best advise on the work needed there.
Also, I would like to start a new project which can automatically download & compile latest Tor. This would greatly help with the Integ tests for Stem & Tor.
Oops! My bad, I resolved the ticket for this but didn't update the volunteer page (now fixed). We already have a jenkins instance that does this...
https://jenkins.torproject.org/job/stem-tor-ci/
Cheers! -Damian
On Sun, Apr 28, 2013 at 11:00 PM, Damian Johnson atagar@torproject.org wrote:
- Once we have a decently reliable set of tests to check basic tor
functionality move on to chutney. Nick would be able to best advise on the work needed there.
What we'd need most for Chutney would be to make it a bit more robust, and to use it to build a real set of tests. Right now, all chutney does is configure and launch a small Tor network, but the small network requires a little babysitting to make it bootstrap. (For example, you sometimes need to send the clients a SIGHUP once the authorities have made their first consensus.)
What Chutney doesn't do (but should!) is actually test the network it launches. Right now, to make sure the network has bootstrapped, you have to read through its log files. If you want to test the network with any traffic, you need to use an application of your choice to send traffic through one of the Tor clients, and verify that the output as is expected. And if you want to make sure that Tor is running without weird warnings, you need to manually inspect the logfiles again. It would be good if Chutney grew into, or were replaced by, a tool that could actually do testing right that.
best wishes,