[patch] getting chutney working with tor 0.2.6-alpha on OS X
I had several issues getting chutney working on OS X 10.9 with tor 0.2.6.?-alpha. I've attached bug-related patches to this bug. I have created another issue for dependent enhancements. I have also created a bug for my remaining issue with the chutney bridges* flavours accessing the global tor network, rather than the chutney network.
tor git d6b2a1709d28c656dadc019fb24145e6ac400771 chutney git 60b2d18d81904e6a71a352dfa8b5cb73f4e04003
= Getting chutney working
The authorities configured by chutney didn't apply the "Exit" flag to the exits in the network until about 35 minutes had passed. This patch creates a test config TestingDirAuthVoteExit which makes authorities mark particular relays as exits, similar to TestingDirAuthVoteGuard. (There may be a better way of getting the authorities to mark exits within seconds rather than half an hour.)
Use tor-TestingDirAuthVoteExit.patch and TestingDirAuthVoteGuard to make all authorities vote all relays as exits and guards. This ensures that tor's make test-network will work. But it's a sledgehammer approach.
It looks like tor exits need to be explicitly configured to accept all ports on localhost (they won't do it by default).
Since the guard percentage has been reduced from 50% to 25% of relays, we need more relays to compensate.
= Fixing chutney issues
If you change the chutney flavour between runs, tor processes from the previous run sometimes don't get terminated when the next chutney runs. This patch fixes this issue by using pidfiles, and, in the extreme case of kill-zombies.sh, ps and path grepping (which is a hack).
== 06-test-network-wait-25s.patch (optional)
The chutney network seems more reliable if I wait for 25 seconds instead of 18. YMMV
The default shell on OS X is bash, which has a builtin echo. When called in "sh" mode, this echo does not accept "-n". This patch uses "/bin/echo -n" instead.
= Debugging tor launched by chutney
This patch sets DisableDebuggerAttachment to 0, because if you're running a test network, you probably don't care about a debugger. (I may be wrong about this.)
I found it hard to debug tor processes launched by chutney when RunAsDaemon was set. So I wrote code that allowed the use of poll() instead of wait() to catch launch failures. This patch includes these changes in the comments - the functionality is the same as the git version of chutney. (There may be a better way of making this an option.)