/tests/README

https://code.google.com/ · #! · 80 lines · 62 code · 18 blank · 0 comment · 0 complexity · ba15d697540aff4d2c5dbd9e9bc16b7b MD5 · raw file

  1. Pdsh Tests
  2. ----------
  3. This directory contains many basic test scripts for pdsh
  4. and its modules. The test framework is borrowed from the
  5. core Git testsuite, and thus shares many of the Git
  6. test features, including output in the Test Anything
  7. Protocol (TAP, testanything.org) format.
  8. Running Tests
  9. -------------
  10. Tests may be run in 3 different ways, the easiest of which
  11. is by issuing "make check" from this directory or the top
  12. level pdsh build directory. The tests may also all be
  13. invoked via ./runtests.sh. Finally, since the tests output
  14. TAP, the tests may be run with any TAP harness, most
  15. notably the prove(1) command, e.g.
  16. prove --timer -j 4 t[0-9]*.sh
  17. [15:47:54] t0002-internal.sh ........ ok 79 ms
  18. [15:47:54] t0101-dshgroup.sh ........ ok 263 ms
  19. [15:47:54] t1000-dshbak.sh .......... ok 365 ms
  20. [15:47:54] t0004-module-loading.sh .. ok 329 ms
  21. [15:47:54] t0003-wcoll.sh ........... ok 569 ms
  22. [15:47:54] t0001-basic.sh ........... ok 676 ms
  23. [15:47:54]
  24. All tests successful.
  25. Files=8, Tests=55, 1 wallclock secs ( 0.13 usr 0.05 sys + 0.75 cusr 1.64 csys = 2.57 CPU)
  26. Result: PASS
  27. Test scripts may be run individually as well, e.g.
  28. ./t0003-wcoll.sh
  29. ok 1 - hostname range expansion works
  30. ok 2 - host range expansion does not strip leading zeros
  31. ok 3 - host range expansion handles mixed size suffixes
  32. ...
  33. ok 11 - WCOLL environment variable works
  34. ok 12 - ranges can be embedded in wcoll files
  35. # passed all 12 test(s)
  36. 1..12
  37. Tests also support a standard set of options:
  38. -v, --verbose Print commands being run and their output
  39. -d, --debug Enable any test debugging
  40. -i, --immediate Fail immediately on first failed test
  41. -l, --long-tests Run additional long-running tests
  42. --tee Also write test output to test-results/$TEST_NAME.out
  43. --root=dir Create 'trash' directories under "dir"
  44. Skipping Tests
  45. --------------
  46. The environment variable PDSH_SKIP_TESTS is a space separated list
  47. of patterns that tells which tests to skip, and can either match
  48. the test number t[0-9]{4} to skip an entire test script, or
  49. have an appended .$number to skip a particular test in a test script.
  50. Test Naming
  51. -------------
  52. The test files are by convention named
  53. tNNNN-<name>.sh
  54. where N is a decimal digit. For pdsh, only the first digit has meaning,
  55. where so far the only digits used are:
  56. 0 - basic pdsh functionality tests
  57. 1 - pdsh misc module tests
  58. 2 - pdsh rcmd module tests
  59. 5 - other tools tests (e.g. dshbak)
  60. 6 - pdsh regression tests (that don't fit in other categories)
  61. Obviously, tests are run in numerical order, so if one test depends on
  62. another it should be numbered higher.