xref: /freebsd/crypto/openssh/regress/README.regress (revision 2f513db72b034fd5ef7f080b11be5c711c15186a)
1ce3adf43SDag-Erling SmørgravOverview.
2ce3adf43SDag-Erling Smørgrav
3ce3adf43SDag-Erling Smørgrav$ ./configure && make tests
4ce3adf43SDag-Erling Smørgrav
5ce3adf43SDag-Erling SmørgravYou'll see some progress info. A failure will cause either the make to
6ce3adf43SDag-Erling Smørgravabort or the driver script to report a "FATAL" failure.
7ce3adf43SDag-Erling Smørgrav
8ce3adf43SDag-Erling SmørgravThe test consists of 2 parts. The first is the file-based tests which is
9ce3adf43SDag-Erling Smørgravdriven by the Makefile, and the second is a set of network or proxycommand
10ce3adf43SDag-Erling Smørgravbased tests, which are driven by a driver script (test-exec.sh) which is
11ce3adf43SDag-Erling Smørgravcalled multiple times by the Makefile.
12ce3adf43SDag-Erling Smørgrav
13ce3adf43SDag-Erling SmørgravFailures in the first part will cause the Makefile to return an error.
14ce3adf43SDag-Erling SmørgravFailures in the second part will print a "FATAL" message for the failed
15ce3adf43SDag-Erling Smørgravtest and continue.
16ce3adf43SDag-Erling Smørgrav
17ce3adf43SDag-Erling SmørgravOpenBSD has a system-wide regression test suite. OpenSSH Portable's test
18ce3adf43SDag-Erling Smørgravsuite is based on OpenBSD's with modifications.
19ce3adf43SDag-Erling Smørgrav
20ce3adf43SDag-Erling Smørgrav
21ce3adf43SDag-Erling SmørgravEnvironment variables.
22ce3adf43SDag-Erling Smørgrav
23*2f513db7SEd MasteSKIP_UNIT: Skip unit tests.
24*2f513db7SEd MasteSUDO: path to sudo/doas command, if desired. Note that some systems
25*2f513db7SEd Maste	(notably systems using PAM) require sudo to execute some tests.
26*2f513db7SEd MasteLTESTS: Whitespace separated list of tests (filenames without the .sh
27*2f513db7SEd Maste	extension) to run.
28ce3adf43SDag-Erling SmørgravOBJ: used by test scripts to access build dir.
29ce3adf43SDag-Erling SmørgravTEST_SHELL: shell used for running the test scripts.
30*2f513db7SEd MasteTEST_SSH_FAIL_FATAL: set to "yes" to make any failure abort the test
31*2f513db7SEd Maste	currently in progress.
32ce3adf43SDag-Erling SmørgravTEST_SSH_PORT: TCP port to be used for the listening tests.
33*2f513db7SEd MasteTEST_SSH_QUIET: set to "yes" to suppress non-fatal output.
34557f75e5SDag-Erling SmørgravTEST_SSH_SSHD_CONFOPTS: Configuration directives to be added to sshd_config
35ce3adf43SDag-Erling Smørgrav	before running each test.
36*2f513db7SEd MasteTEST_SSH_SSH_CONFOPTS: Configuration directives to be added to
37*2f513db7SEd Maste	ssh_config before running each test.
38*2f513db7SEd MasteTEST_SSH_TRACE: set to "yes" for verbose output from tests
39*2f513db7SEd MasteTEST_SSH_x: path to "ssh" command under test, where x is one of
40*2f513db7SEd Maste	SSH, SSHD, SSHAGENT, SSHADD, SSHKEYGEN, SSHKEYSCAN, SFTP or
41*2f513db7SEd Maste	SFTPSERVER
42*2f513db7SEd MasteUSE_VALGRIND: Run the tests under valgrind memory checker.
43ce3adf43SDag-Erling Smørgrav
44ce3adf43SDag-Erling Smørgrav
45ce3adf43SDag-Erling SmørgravIndividual tests.
46ce3adf43SDag-Erling Smørgrav
47ce3adf43SDag-Erling SmørgravYou can run an individual test from the top-level Makefile, eg:
48ce3adf43SDag-Erling Smørgrav$ make tests LTESTS=agent-timeout
49ce3adf43SDag-Erling Smørgrav
50ce3adf43SDag-Erling SmørgravIf you need to manipulate the environment more you can invoke test-exec.sh
51ce3adf43SDag-Erling Smørgravdirectly if you set up the path to find the binaries under test and the
52ce3adf43SDag-Erling Smørgravtest scripts themselves, for example:
53ce3adf43SDag-Erling Smørgrav
54ce3adf43SDag-Erling Smørgrav$ cd regress
55ce3adf43SDag-Erling Smørgrav$ PATH=`pwd`/..:$PATH:. TEST_SHELL=/bin/sh sh test-exec.sh `pwd` \
56ce3adf43SDag-Erling Smørgrav    agent-timeout.sh
57ce3adf43SDag-Erling Smørgravok agent timeout test
58ce3adf43SDag-Erling Smørgrav
59ce3adf43SDag-Erling Smørgrav
60ce3adf43SDag-Erling SmørgravFiles.
61ce3adf43SDag-Erling Smørgrav
62ce3adf43SDag-Erling Smørgravtest-exec.sh: the main test driver. Sets environment, creates config files
63ce3adf43SDag-Erling Smørgravand keys and runs the specified test.
64ce3adf43SDag-Erling Smørgrav
65ce3adf43SDag-Erling SmørgravAt the time of writing, the individual tests are:
66ce3adf43SDag-Erling Smørgravagent-timeout.sh:	agent timeout test
67ce3adf43SDag-Erling Smørgravagent.sh:		simple agent test
68ce3adf43SDag-Erling Smørgravbroken-pipe.sh:		broken pipe test
69ce3adf43SDag-Erling Smørgravconnect-privsep.sh:	proxy connect with privsep
70ce3adf43SDag-Erling Smørgravconnect.sh:		simple connect
71ce3adf43SDag-Erling Smørgravexit-status.sh:		remote exit status
72ce3adf43SDag-Erling Smørgravforwarding.sh:		local and remote forwarding
73ce3adf43SDag-Erling Smørgravkeygen-change.sh:	change passphrase for key
74ce3adf43SDag-Erling Smørgravkeyscan.sh:		keyscan
75ce3adf43SDag-Erling Smørgravproto-mismatch.sh:	protocol version mismatch
76ce3adf43SDag-Erling Smørgravproto-version.sh:	sshd version with different protocol combinations
77ce3adf43SDag-Erling Smørgravproxy-connect.sh:	proxy connect
78ce3adf43SDag-Erling Smørgravsftp.sh:		basic sftp put/get
79ce3adf43SDag-Erling Smørgravssh-com-client.sh:	connect with ssh.com client
80ce3adf43SDag-Erling Smørgravssh-com-keygen.sh:	ssh.com key import
81ce3adf43SDag-Erling Smørgravssh-com-sftp.sh:	basic sftp put/get with ssh.com server
82ce3adf43SDag-Erling Smørgravssh-com.sh:		connect to ssh.com server
83ce3adf43SDag-Erling Smørgravstderr-after-eof.sh:	stderr data after eof
84ce3adf43SDag-Erling Smørgravstderr-data.sh:		stderr data transfer
85ce3adf43SDag-Erling Smørgravtransfer.sh:		transfer data
86ce3adf43SDag-Erling Smørgravtry-ciphers.sh:		try ciphers
87ce3adf43SDag-Erling Smørgravyes-head.sh:		yes pipe head
88ce3adf43SDag-Erling Smørgrav
89ce3adf43SDag-Erling Smørgrav
90ce3adf43SDag-Erling SmørgravProblems?
91ce3adf43SDag-Erling Smørgrav
92ce3adf43SDag-Erling SmørgravRun the failing test with shell tracing (-x) turned on:
93ce3adf43SDag-Erling Smørgrav$ PATH=`pwd`/..:$PATH:. sh -x test-exec.sh `pwd` agent-timeout.sh
94ce3adf43SDag-Erling Smørgrav
95ce3adf43SDag-Erling SmørgravFailed tests can be difficult to diagnose. Suggestions:
96ce3adf43SDag-Erling Smørgrav- run the individual test via ./test-exec.sh `pwd` [testname]
97ce3adf43SDag-Erling Smørgrav- set LogLevel to VERBOSE in test-exec.sh and enable syslogging of
98ce3adf43SDag-Erling Smørgrav  auth.debug (eg to /var/log/authlog).
99ce3adf43SDag-Erling Smørgrav
100ce3adf43SDag-Erling Smørgrav
101ce3adf43SDag-Erling SmørgravKnown Issues.
102ce3adf43SDag-Erling Smørgrav
103ce3adf43SDag-Erling Smørgrav- Similarly, if you do not have "scp" in your system's $PATH then the
104ce3adf43SDag-Erling Smørgrav  multiplex scp tests will fail (since the system's shell startup scripts
105ce3adf43SDag-Erling Smørgrav  will determine where the shell started by sshd will look for scp).
106ce3adf43SDag-Erling Smørgrav
107ce3adf43SDag-Erling Smørgrav- Recent GNU coreutils deprecate "head -[n]": this will cause the yes-head
108ce3adf43SDag-Erling Smørgrav  test to fail.  The old behaviour can be restored by setting (and
109ce3adf43SDag-Erling Smørgrav  exporting) _POSIX2_VERSION=199209 before running the tests.
110