1124208SdesOverview.
2124208Sdes
3124208Sdes$ ./configure && make tests
4124208Sdes
5124208SdesYou'll see some progress info. A failure will cause either the make to
6124208Sdesabort or the driver script to report a "FATAL" failure.
7124208Sdes
8124208SdesThe test consists of 2 parts. The first is the file-based tests which is
9124208Sdesdriven by the Makefile, and the second is a set of network or proxycommand
10124208Sdesbased tests, which are driven by a driver script (test-exec.sh) which is
11124208Sdescalled multiple times by the Makefile.
12124208Sdes
13124208SdesFailures in the first part will cause the Makefile to return an error.
14124208SdesFailures in the second part will print a "FATAL" message for the failed
15124208Sdestest and continue.
16124208Sdes
17124208SdesOpenBSD has a system-wide regression test suite. OpenSSH Portable's test
18124208Sdessuite is based on OpenBSD's with modifications.
19124208Sdes
20124208Sdes
21124208SdesEnvironment variables.
22124208Sdes
23124208SdesSUDO: path to sudo command, if desired. Note that some systems (notably
24124208Sdes	systems using PAM) require sudo to execute some tests.
25126274SdesTEST_SSH_TRACE: set to "yes" for verbose output from tests 
26124208SdesTEST_SSH_QUIET: set to "yes" to suppress non-fatal output.
27124208SdesTEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD
28124208Sdes	SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER
29124208SdesOBJ: used by test scripts to access build dir.
30137015SdesTEST_SHELL: shell used for running the test scripts.
31137015SdesTEST_SSH_PORT: TCP port to be used for the listening tests.
32214979SdesTEST_SSH_SSH_CONFOPTS: Configuration directives to be added to ssh_config
33137015Sdes	before running each test.
34137015SdesTEST_SSH_SSHD_CONFOTPS: Configuration directives to be added to sshd_config
35137015Sdes	before running each test.
36124208Sdes
37124208Sdes
38124208SdesIndividual tests.
39124208Sdes
40137015SdesYou can run an individual test from the top-level Makefile, eg:
41137015Sdes$ make tests LTESTS=agent-timeout
42124208Sdes
43137015SdesIf you need to manipulate the environment more you can invoke test-exec.sh
44137015Sdesdirectly if you set up the path to find the binaries under test and the
45137015Sdestest scripts themselves, for example:
46137015Sdes
47124208Sdes$ cd regress
48137015Sdes$ PATH=`pwd`/..:$PATH:. TEST_SHELL=/bin/sh sh test-exec.sh `pwd` \
49137015Sdes    agent-timeout.sh
50124208Sdesok agent timeout test
51124208Sdes
52124208Sdes
53124208SdesFiles.
54124208Sdes
55124208Sdestest-exec.sh: the main test driver. Sets environment, creates config files
56124208Sdesand keys and runs the specified test.
57124208Sdes
58124208SdesAt the time of writing, the individual tests are:
59124208Sdesagent-timeout.sh:	agent timeout test
60124208Sdesagent.sh:		simple agent test
61124208Sdesbroken-pipe.sh:		broken pipe test
62124208Sdesconnect-privsep.sh:	proxy connect with privsep
63124208Sdesconnect.sh:		simple connect
64124208Sdesexit-status.sh:		remote exit status
65124208Sdesforwarding.sh:		local and remote forwarding
66124208Sdeskeygen-change.sh:	change passphrase for key
67124208Sdeskeyscan.sh:		keyscan
68124208Sdesproto-mismatch.sh:	protocol version mismatch
69124208Sdesproto-version.sh:	sshd version with different protocol combinations
70124208Sdesproxy-connect.sh:	proxy connect
71124208Sdessftp.sh:		basic sftp put/get
72124208Sdesssh-com-client.sh:	connect with ssh.com client
73124208Sdesssh-com-keygen.sh:	ssh.com key import
74124208Sdesssh-com-sftp.sh:	basic sftp put/get with ssh.com server
75124208Sdesssh-com.sh:		connect to ssh.com server
76124208Sdesstderr-after-eof.sh:	stderr data after eof
77124208Sdesstderr-data.sh:		stderr data transfer
78124208Sdestransfer.sh:		transfer data
79124208Sdestry-ciphers.sh:		try ciphers
80124208Sdesyes-head.sh:		yes pipe head
81124208Sdes
82124208Sdes
83124208SdesProblems?
84124208Sdes
85124208SdesRun the failing test with shell tracing (-x) turned on:
86124208Sdes$ PATH=`pwd`/..:$PATH:. sh -x test-exec.sh `pwd` agent-timeout.sh
87124208Sdes
88124208SdesFailed tests can be difficult to diagnose. Suggestions:
89124208Sdes- run the individual test via ./test-exec.sh `pwd` [testname]
90124208Sdes- set LogLevel to VERBOSE in test-exec.sh and enable syslogging of
91124208Sdes  auth.debug (eg to /var/log/authlog).
92124208Sdes
93124208Sdes
94124208SdesKnown Issues.
95124208Sdes
96157016Sdes- Similarly, if you do not have "scp" in your system's $PATH then the
97157016Sdes  multiplex scp tests will fail (since the system's shell startup scripts
98157016Sdes  will determine where the shell started by sshd will look for scp).
99157016Sdes
100137015Sdes- Recent GNU coreutils deprecate "head -[n]": this will cause the yes-head
101137015Sdes  test to fail.  The old behaviour can be restored by setting (and
102137015Sdes  exporting) _POSIX2_VERSION=199209 before running the tests.
103137015Sdes
104225825Sdes$Id: README.regress,v 1.12 2011/05/05 03:48:42 djm Exp $
105