README 5.8 KB

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