README 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. The environmental variables documented below also work with test-network.sh.
  21. Standard Actions:
  22. ./chutney configure networks/basic
  23. ./chutney start networks/basic
  24. ./chutney status networks/basic
  25. ./chutney verify networks/basic
  26. ./chutney hup networks/basic
  27. ./chutney stop networks/basic
  28. Bandwidth Tests:
  29. ./chutney configure networks/basic-min
  30. ./chutney start networks/basic-min
  31. ./chutney status networks/basic-min
  32. CHUTNEY_DATA_BYTES=104857600 ./chutney verify networks/basic-min
  33. # Send 100MB of data per client connection
  34. # verify produces performance figures for:
  35. # Single Stream Bandwidth: the speed of the slowest stream, end-to-end
  36. # Overall tor Bandwidth: the sum of the bandwidth across each tor instance
  37. # This approximates the CPU-bound tor performance on the current machine,
  38. # assuming everything is multithreaded and network performance is infinite.
  39. ./chutney stop networks/basic-min
  40. Connection Tests:
  41. ./chutney configure networks/basic-025
  42. ./chutney start networks/basic-025
  43. ./chutney status networks/basic-025
  44. CHUTNEY_CONNECTIONS=5 ./chutney verify networks/basic-025
  45. # Make 5 connections from each client through a random exit
  46. ./chutney stop networks/basic-025
  47. Note: If you create 7 or more connections to a hidden service from a single
  48. Tor 0.2.7 client, you'll likely get a verification failure due to #15937.
  49. This is fixed in 0.2.8.
  50. HS Connection Tests:
  51. ./chutney configure networks/hs-025
  52. ./chutney start networks/hs-025
  53. ./chutney status networks/hs-025
  54. CHUTNEY_HS_MULTI_CLIENT=1 ./chutney verify networks/hs-025
  55. # Make a connection from each client to each hs
  56. # Default behavior is one client connects to each HS
  57. ./chutney stop networks/hs-025
  58. Waiting for the network to bootstrap:
  59. Commands like "chutney verify" start immediately, and keep trying for
  60. CHUTNEY_BOOTSTRAP_TIME seconds. If they haven't been successful after that
  61. time, they fail.
  62. The tools/test-network.sh script waits 15 seconds before calling chutney
  63. verify, because that's the minimum amount of time it takes to bootstrap a
  64. consensus containing relays.
  65. Changing the network address:
  66. Chutney defaults to binding to localhost. To change the bind address,
  67. set the CHUTNEY_LISTEN_ADDRESS environment variable. Setting it to some
  68. interface's IP address allows us to make the simulated Tor network
  69. available on the network.
  70. IPv6 support for both Tor and Chutney is a work in progress. If your system
  71. returns IPv6 ::1 as the (first) address for localhost, you might need to
  72. set CHUTNEY_LISTEN_ADDRESS="127.0.0.1" for chutney to work.
  73. The configuration files:
  74. networks/basic holds the configuration for the network you're configuring
  75. above. It refers to some torrc template files in torrc_templates/.
  76. The working files:
  77. chutney sticks its working files, including all data directories, log
  78. files, etc, in ./net/. Each tor instance gets a subdirectory of net/nodes.
  79. You can override the directory "./net" with the CHUTNEY_DATA_DIR
  80. environment variable.
  81. Test scripts:
  82. The test scripts are stored in the "scripts/chutney_tests" directory. These
  83. Python files must define a "run_test(network)" function. Files starting with
  84. an underscore ("_") are ignored.
  85. Test scripts can be run using the following syntax:
  86. ./chutney <script-name> networks/<network-name>
  87. The chutney verify command is implemented using a test script.
  88. Test scripts in the test directory with the same name as standard commands
  89. are run instead of that standard command. This allows expert users to replace
  90. the standard chutney commands with modified versions.