README 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. This is chutney. It doesn't do much so far. It isn't ready for prime-time.
  2. If it breaks, you get to keep all the pieces.
  3. It is supposed to be a good tool for:
  4. - Configuring a testing tor network
  5. - Launching and monitoring a testing tor network
  6. - Running tests on a testing tor network
  7. Right now it only sorta does these things.
  8. You will need, at the moment:
  9. - Tor installed somewhere in your path or the location of the 'tor' and
  10. 'tor-gencert' binaries specified through the environment variables
  11. CHUTNEY_TOR and CHUTNEY_TOR_GENCERT, respectively.
  12. - Python 2.7 or later
  13. Stuff to try:
  14. Automated Setup, Verification, and Shutdown:
  15. ./tools/test-network.sh --flavor basic-min
  16. ./tools/test-network.sh --coverage
  17. ./tools/test-network.sh --tor-path <tor-build-directory>
  18. ./tools/test-network.sh --tor <name-or-path> --tor-gencert <name-or-path>
  19. (--tor-path and $TOR_DIR override --tor and --tor-gencert.)
  20. ./tools/test-network.sh --chutney-path <chutney-directory>
  21. (The script is pretty good at guessing this.)
  22. test-network.sh looks for some tor binaries (either in a nearby build
  23. directory or in your $PATH), configures a comprehensive tor test network,
  24. launches it, then verifies data transmission through it, and cleans up after
  25. itself.
  26. You can modify its configuration using command-line arguments, or use the
  27. chutney environmental variables documented below:
  28. --delay CHUTNEY_BOOTSTRAP_TIME
  29. --data CHUTNEY_DATA_BYTES
  30. --connections CHUTNEY_CONNECTIONS
  31. --hs-multi-client CHUTNEY_HS_MULTI_CLIENT
  32. Standard Actions:
  33. ./chutney configure networks/basic
  34. ./chutney start networks/basic
  35. ./chutney status networks/basic
  36. ./chutney verify networks/basic
  37. ./chutney hup networks/basic
  38. ./chutney stop networks/basic
  39. Bandwidth Tests:
  40. ./chutney configure networks/basic-min
  41. ./chutney start networks/basic-min
  42. ./chutney status networks/basic-min
  43. CHUTNEY_DATA_BYTES=104857600 ./chutney verify networks/basic-min
  44. # Send 100MB of data per client connection
  45. # verify produces performance figures for:
  46. # Single Stream Bandwidth: the speed of the slowest stream, end-to-end
  47. # Overall tor Bandwidth: the sum of the bandwidth across each tor instance
  48. # This approximates the CPU-bound tor performance on the current machine,
  49. # assuming everything is multithreaded and network performance is infinite.
  50. ./chutney stop networks/basic-min
  51. Connection Tests:
  52. ./chutney configure networks/basic-025
  53. ./chutney start networks/basic-025
  54. ./chutney status networks/basic-025
  55. CHUTNEY_CONNECTIONS=5 ./chutney verify networks/basic-025
  56. # Make 5 connections from each client through a random exit
  57. ./chutney stop networks/basic-025
  58. Note: If you create 7 or more connections to a hidden service from a single
  59. Tor 0.2.7 client, you'll likely get a verification failure due to #15937.
  60. This is fixed in 0.2.8.
  61. HS Connection Tests:
  62. ./chutney configure networks/hs-025
  63. ./chutney start networks/hs-025
  64. ./chutney status networks/hs-025
  65. CHUTNEY_HS_MULTI_CLIENT=1 ./chutney verify networks/hs-025
  66. # Make a connection from each client to each hs
  67. # Default behavior is one client connects to each HS
  68. ./chutney stop networks/hs-025
  69. Waiting for the network to bootstrap:
  70. Commands like "chutney verify" start immediately, and keep trying for
  71. CHUTNEY_BOOTSTRAP_TIME seconds. If they haven't been successful after that
  72. time, they fail.
  73. The tools/test-network.sh script waits 15 seconds before calling chutney
  74. verify, because that's the minimum amount of time it takes to bootstrap a
  75. consensus containing relays.
  76. Changing the network address:
  77. Chutney defaults to binding to localhost. To change the bind address,
  78. set the CHUTNEY_LISTEN_ADDRESS environment variable. Setting it to some
  79. interface's IP address allows us to make the simulated Tor network
  80. available on the network.
  81. IPv6 support for both Tor and Chutney is a work in progress. If your system
  82. returns IPv6 ::1 as the (first) address for localhost, you might need to
  83. set CHUTNEY_LISTEN_ADDRESS="127.0.0.1" for chutney to work.
  84. The configuration files:
  85. networks/basic holds the configuration for the network you're configuring
  86. above. It refers to some torrc template files in torrc_templates/.
  87. The working files:
  88. chutney sticks its working files, including all data directories, log
  89. files, etc, in ./net/. Each tor instance gets a subdirectory of net/nodes.
  90. You can override the directory "./net" with the CHUTNEY_DATA_DIR
  91. environment variable.
  92. Test scripts:
  93. The test scripts are stored in the "scripts/chutney_tests" directory. These
  94. Python files must define a "run_test(network)" function. Files starting with
  95. an underscore ("_") are ignored.
  96. Test scripts can be run using the following syntax:
  97. ./chutney <script-name> networks/<network-name>
  98. The chutney verify command is implemented using a test script.
  99. Test scripts in the test directory with the same name as standard commands
  100. are run instead of that standard command. This allows expert users to replace
  101. the standard chutney commands with modified versions.