README.regress 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. Overview.
  2. $ ./configure && make tests
  3. You'll see some progress info. A failure will cause either the make to
  4. abort or the driver script to report a "FATAL" failure.
  5. The test consists of 2 parts. The first is the file-based tests which is
  6. driven by the Makefile, and the second is a set of network or proxycommand
  7. based tests, which are driven by a driver script (test-exec.sh) which is
  8. called multiple times by the Makefile.
  9. Failures in the first part will cause the Makefile to return an error.
  10. Failures in the second part will print a "FATAL" message for the failed
  11. test and continue.
  12. OpenBSD has a system-wide regression test suite. OpenSSH Portable's test
  13. suite is based on OpenBSD's with modifications.
  14. Environment variables.
  15. SKIP_UNIT: Skip unit tests.
  16. SUDO: path to sudo/doas command, if desired. Note that some systems
  17. (notably systems using PAM) require sudo to execute some tests.
  18. LTESTS: Whitespace separated list of tests (filenames without the .sh
  19. extension) to run.
  20. SKIP_LTESTS: Whitespace separated list of tests to skip.
  21. OBJ: used by test scripts to access build dir.
  22. TEST_SHELL: shell used for running the test scripts.
  23. TEST_SSH_FAIL_FATAL: set to "yes" to make any failure abort the test
  24. currently in progress.
  25. TEST_SSH_PORT: TCP port to be used for the listening tests.
  26. TEST_SSH_QUIET: set to "yes" to suppress non-fatal output.
  27. TEST_SSH_SSHD_CONFOPTS: Configuration directives to be added to sshd_config
  28. before running each test.
  29. TEST_SSH_SSH_CONFOPTS: Configuration directives to be added to
  30. ssh_config before running each test.
  31. TEST_SSH_TRACE: set to "yes" for verbose output from tests
  32. TEST_SSH_x: path to "ssh" command under test, where x is one of
  33. SSH, SSHD, SSHAGENT, SSHADD, SSHKEYGEN, SSHKEYSCAN, SFTP or
  34. SFTPSERVER
  35. USE_VALGRIND: Run the tests under valgrind memory checker.
  36. Individual tests.
  37. You can run an individual test from the top-level Makefile, eg:
  38. $ make tests LTESTS=agent-timeout
  39. If you need to manipulate the environment more you can invoke test-exec.sh
  40. directly if you set up the path to find the binaries under test and the
  41. test scripts themselves, for example:
  42. $ cd regress
  43. $ PATH=`pwd`/..:$PATH:. TEST_SHELL=/bin/sh sh test-exec.sh `pwd` \
  44. agent-timeout.sh
  45. ok agent timeout test
  46. Files.
  47. test-exec.sh: the main test driver. Sets environment, creates config files
  48. and keys and runs the specified test.
  49. At the time of writing, the individual tests are:
  50. connect.sh: simple connect
  51. proxy-connect.sh: proxy connect
  52. connect-privsep.sh: proxy connect with privsep
  53. connect-uri.sh: uri connect
  54. proto-version.sh: sshd version with different protocol combinations
  55. proto-mismatch.sh: protocol version mismatch
  56. exit-status.sh: remote exit status
  57. envpass.sh: environment passing
  58. transfer.sh: transfer data
  59. banner.sh: banner
  60. rekey.sh: rekey
  61. stderr-data.sh: stderr data transfer
  62. stderr-after-eof.sh: stderr data after eof
  63. broken-pipe.sh: broken pipe test
  64. try-ciphers.sh: try ciphers
  65. yes-head.sh: yes pipe head
  66. login-timeout.sh: connect after login grace timeout
  67. agent.sh: simple connect via agent
  68. agent-getpeereid.sh: disallow agent attach from other uid
  69. agent-timeout.sh: agent timeout test
  70. agent-ptrace.sh: disallow agent ptrace attach
  71. keyscan.sh: keyscan
  72. keygen-change.sh: change passphrase for key
  73. keygen-convert.sh: convert keys
  74. keygen-moduli.sh: keygen moduli
  75. key-options.sh: key options
  76. scp.sh: scp
  77. scp-uri.sh: scp-uri
  78. sftp.sh: basic sftp put/get
  79. sftp-chroot.sh: sftp in chroot
  80. sftp-cmds.sh: sftp command
  81. sftp-badcmds.sh: sftp invalid commands
  82. sftp-batch.sh: sftp batchfile
  83. sftp-glob.sh: sftp glob
  84. sftp-perm.sh: sftp permissions
  85. sftp-uri.sh: sftp-uri
  86. ssh-com-client.sh: connect with ssh.com client
  87. ssh-com-keygen.sh: ssh.com key import
  88. ssh-com-sftp.sh: basic sftp put/get with ssh.com server
  89. ssh-com.sh: connect to ssh.com server
  90. reconfigure.sh: simple connect after reconfigure
  91. dynamic-forward.sh: dynamic forwarding
  92. forwarding.sh: local and remote forwarding
  93. multiplex.sh: connection multiplexing
  94. reexec.sh: reexec tests
  95. brokenkeys.sh: broken keys
  96. sshcfgparse.sh: ssh config parse
  97. cfgparse.sh: sshd config parse
  98. cfgmatch.sh: sshd_config match
  99. cfgmatchlisten.sh: sshd_config matchlisten
  100. addrmatch.sh: address match
  101. localcommand.sh: localcommand
  102. forcecommand.sh: forced command
  103. portnum.sh: port number parsing
  104. keytype.sh: login with different key types
  105. kextype.sh: login with different key exchange algorithms
  106. cert-hostkey.sh certified host keys
  107. cert-userkey.sh: certified user keys
  108. host-expand.sh: expand %h and %n
  109. keys-command.sh: authorized keys from command
  110. forward-control.sh: sshd control of local and remote forwarding
  111. integrity.sh: integrity
  112. krl.sh: key revocation lists
  113. multipubkey.sh: multiple pubkey
  114. limit-keytype.sh: restrict pubkey type
  115. hostkey-agent.sh: hostkey agent
  116. keygen-knownhosts.sh: ssh-keygen known_hosts
  117. hostkey-rotate.sh: hostkey rotate
  118. principals-command.sh: authorized principals command
  119. cert-file.sh: ssh with certificates
  120. cfginclude.sh: config include
  121. allow-deny-users.sh: AllowUsers/DenyUsers
  122. authinfo.sh: authinfo
  123. Problems?
  124. Run the failing test with shell tracing (-x) turned on:
  125. $ PATH=`pwd`/..:$PATH:. sh -x test-exec.sh `pwd` agent-timeout.sh
  126. Failed tests can be difficult to diagnose. Suggestions:
  127. - run the individual test via ./test-exec.sh `pwd` [testname]
  128. - set LogLevel to VERBOSE in test-exec.sh and enable syslogging of
  129. auth.debug (eg to /var/log/authlog).
  130. Known Issues.
  131. - Similarly, if you do not have "scp" in your system's $PATH then the
  132. multiplex scp tests will fail (since the system's shell startup scripts
  133. will determine where the shell started by sshd will look for scp).
  134. - Recent GNU coreutils deprecate "head -[n]": this will cause the yes-head
  135. test to fail. The old behaviour can be restored by setting (and
  136. exporting) _POSIX2_VERSION=199209 before running the tests.