xref: /freebsd-src/crypto/openssh/regress/README.regress (revision 19261079b74319502c6ffa1249920079f0f69a72)
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
232f513db7SEd MasteSKIP_UNIT: Skip unit tests.
242f513db7SEd MasteSUDO: path to sudo/doas command, if desired. Note that some systems
252f513db7SEd Maste	(notably systems using PAM) require sudo to execute some tests.
262f513db7SEd MasteLTESTS: Whitespace separated list of tests (filenames without the .sh
272f513db7SEd Maste	extension) to run.
28*19261079SEd MasteSKIP_LTESTS: Whitespace separated list of tests to skip.
29ce3adf43SDag-Erling SmørgravOBJ: used by test scripts to access build dir.
30ce3adf43SDag-Erling SmørgravTEST_SHELL: shell used for running the test scripts.
312f513db7SEd MasteTEST_SSH_FAIL_FATAL: set to "yes" to make any failure abort the test
322f513db7SEd Maste	currently in progress.
33ce3adf43SDag-Erling SmørgravTEST_SSH_PORT: TCP port to be used for the listening tests.
342f513db7SEd MasteTEST_SSH_QUIET: set to "yes" to suppress non-fatal output.
35557f75e5SDag-Erling SmørgravTEST_SSH_SSHD_CONFOPTS: Configuration directives to be added to sshd_config
36ce3adf43SDag-Erling Smørgrav	before running each test.
372f513db7SEd MasteTEST_SSH_SSH_CONFOPTS: Configuration directives to be added to
382f513db7SEd Maste	ssh_config before running each test.
392f513db7SEd MasteTEST_SSH_TRACE: set to "yes" for verbose output from tests
402f513db7SEd MasteTEST_SSH_x: path to "ssh" command under test, where x is one of
412f513db7SEd Maste	SSH, SSHD, SSHAGENT, SSHADD, SSHKEYGEN, SSHKEYSCAN, SFTP or
422f513db7SEd Maste	SFTPSERVER
432f513db7SEd MasteUSE_VALGRIND: Run the tests under valgrind memory checker.
44ce3adf43SDag-Erling Smørgrav
45ce3adf43SDag-Erling Smørgrav
46ce3adf43SDag-Erling SmørgravIndividual tests.
47ce3adf43SDag-Erling Smørgrav
48ce3adf43SDag-Erling SmørgravYou can run an individual test from the top-level Makefile, eg:
49ce3adf43SDag-Erling Smørgrav$ make tests LTESTS=agent-timeout
50ce3adf43SDag-Erling Smørgrav
51ce3adf43SDag-Erling SmørgravIf you need to manipulate the environment more you can invoke test-exec.sh
52ce3adf43SDag-Erling Smørgravdirectly if you set up the path to find the binaries under test and the
53ce3adf43SDag-Erling Smørgravtest scripts themselves, for example:
54ce3adf43SDag-Erling Smørgrav
55ce3adf43SDag-Erling Smørgrav$ cd regress
56ce3adf43SDag-Erling Smørgrav$ PATH=`pwd`/..:$PATH:. TEST_SHELL=/bin/sh sh test-exec.sh `pwd` \
57ce3adf43SDag-Erling Smørgrav    agent-timeout.sh
58ce3adf43SDag-Erling Smørgravok agent timeout test
59ce3adf43SDag-Erling Smørgrav
60ce3adf43SDag-Erling Smørgrav
61ce3adf43SDag-Erling SmørgravFiles.
62ce3adf43SDag-Erling Smørgrav
63ce3adf43SDag-Erling Smørgravtest-exec.sh: the main test driver. Sets environment, creates config files
64ce3adf43SDag-Erling Smørgravand keys and runs the specified test.
65ce3adf43SDag-Erling Smørgrav
66ce3adf43SDag-Erling SmørgravAt the time of writing, the individual tests are:
67ce3adf43SDag-Erling Smørgravconnect.sh:		simple connect
68ce3adf43SDag-Erling Smørgravproxy-connect.sh:	proxy connect
69*19261079SEd Masteconnect-privsep.sh:	proxy connect with privsep
70*19261079SEd Masteconnect-uri.sh:		uri connect
71*19261079SEd Masteproto-version.sh:	sshd version with different protocol combinations
72*19261079SEd Masteproto-mismatch.sh:	protocol version mismatch
73*19261079SEd Masteexit-status.sh:		remote exit status
74*19261079SEd Masteenvpass.sh:		environment passing
75*19261079SEd Mastetransfer.sh:		transfer data
76*19261079SEd Mastebanner.sh:		banner
77*19261079SEd Masterekey.sh:		rekey
78*19261079SEd Mastestderr-data.sh:		stderr data transfer
79*19261079SEd Mastestderr-after-eof.sh:	stderr data after eof
80*19261079SEd Mastebroken-pipe.sh:		broken pipe test
81*19261079SEd Mastetry-ciphers.sh:		try ciphers
82*19261079SEd Masteyes-head.sh:		yes pipe head
83*19261079SEd Mastelogin-timeout.sh:	connect after login grace timeout
84*19261079SEd Masteagent.sh:		simple connect via agent
85*19261079SEd Masteagent-getpeereid.sh:	disallow agent attach from other uid
86*19261079SEd Masteagent-timeout.sh:	agent timeout test
87*19261079SEd Masteagent-ptrace.sh:	disallow agent ptrace attach
88*19261079SEd Mastekeyscan.sh:		keyscan
89*19261079SEd Mastekeygen-change.sh:	change passphrase for key
90*19261079SEd Mastekeygen-convert.sh:	convert keys
91*19261079SEd Mastekeygen-moduli.sh:	keygen moduli
92*19261079SEd Mastekey-options.sh:		key options
93*19261079SEd Mastescp.sh:			scp
94*19261079SEd Mastescp-uri.sh:		scp-uri
95ce3adf43SDag-Erling Smørgravsftp.sh:		basic sftp put/get
96*19261079SEd Mastesftp-chroot.sh:		sftp in chroot
97*19261079SEd Mastesftp-cmds.sh:		sftp command
98*19261079SEd Mastesftp-badcmds.sh:	sftp invalid commands
99*19261079SEd Mastesftp-batch.sh:		sftp batchfile
100*19261079SEd Mastesftp-glob.sh:		sftp glob
101*19261079SEd Mastesftp-perm.sh:		sftp permissions
102*19261079SEd Mastesftp-uri.sh:		sftp-uri
103ce3adf43SDag-Erling Smørgravssh-com-client.sh:	connect with ssh.com client
104ce3adf43SDag-Erling Smørgravssh-com-keygen.sh:	ssh.com key import
105ce3adf43SDag-Erling Smørgravssh-com-sftp.sh:	basic sftp put/get with ssh.com server
106ce3adf43SDag-Erling Smørgravssh-com.sh:		connect to ssh.com server
107*19261079SEd Mastereconfigure.sh:		simple connect after reconfigure
108*19261079SEd Mastedynamic-forward.sh:	dynamic forwarding
109*19261079SEd Masteforwarding.sh:		local and remote forwarding
110*19261079SEd Mastemultiplex.sh:		connection multiplexing
111*19261079SEd Mastereexec.sh:		reexec tests
112*19261079SEd Mastebrokenkeys.sh:		broken keys
113*19261079SEd Mastesshcfgparse.sh:		ssh config parse
114*19261079SEd Mastecfgparse.sh:		sshd config parse
115*19261079SEd Mastecfgmatch.sh:		sshd_config match
116*19261079SEd Mastecfgmatchlisten.sh:	sshd_config matchlisten
117*19261079SEd Masteaddrmatch.sh:		address match
118*19261079SEd Mastelocalcommand.sh:	localcommand
119*19261079SEd Masteforcecommand.sh:	forced command
120*19261079SEd Masteportnum.sh:		port number parsing
121*19261079SEd Mastekeytype.sh:		login with different key types
122*19261079SEd Mastekextype.sh:		login with different key exchange algorithms
123*19261079SEd Mastecert-hostkey.sh		certified host keys
124*19261079SEd Mastecert-userkey.sh:	certified user keys
125*19261079SEd Mastehost-expand.sh:		expand %h and %n
126*19261079SEd Mastekeys-command.sh:	authorized keys from command
127*19261079SEd Masteforward-control.sh:	sshd control of local and remote forwarding
128*19261079SEd Masteintegrity.sh:		integrity
129*19261079SEd Mastekrl.sh:			key revocation lists
130*19261079SEd Mastemultipubkey.sh:		multiple pubkey
131*19261079SEd Mastelimit-keytype.sh:	restrict pubkey type
132*19261079SEd Mastehostkey-agent.sh:	hostkey agent
133*19261079SEd Mastekeygen-knownhosts.sh:	ssh-keygen known_hosts
134*19261079SEd Mastehostkey-rotate.sh:	hostkey rotate
135*19261079SEd Masteprincipals-command.sh:	authorized principals command
136*19261079SEd Mastecert-file.sh:		ssh with certificates
137*19261079SEd Mastecfginclude.sh:		config include
138*19261079SEd Masteallow-deny-users.sh:	AllowUsers/DenyUsers
139*19261079SEd Masteauthinfo.sh:		authinfo
140ce3adf43SDag-Erling Smørgrav
141ce3adf43SDag-Erling Smørgrav
142ce3adf43SDag-Erling SmørgravProblems?
143ce3adf43SDag-Erling Smørgrav
144ce3adf43SDag-Erling SmørgravRun the failing test with shell tracing (-x) turned on:
145ce3adf43SDag-Erling Smørgrav$ PATH=`pwd`/..:$PATH:. sh -x test-exec.sh `pwd` agent-timeout.sh
146ce3adf43SDag-Erling Smørgrav
147ce3adf43SDag-Erling SmørgravFailed tests can be difficult to diagnose. Suggestions:
148ce3adf43SDag-Erling Smørgrav- run the individual test via ./test-exec.sh `pwd` [testname]
149ce3adf43SDag-Erling Smørgrav- set LogLevel to VERBOSE in test-exec.sh and enable syslogging of
150ce3adf43SDag-Erling Smørgrav  auth.debug (eg to /var/log/authlog).
151ce3adf43SDag-Erling Smørgrav
152ce3adf43SDag-Erling Smørgrav
153ce3adf43SDag-Erling SmørgravKnown Issues.
154ce3adf43SDag-Erling Smørgrav
155ce3adf43SDag-Erling Smørgrav- Similarly, if you do not have "scp" in your system's $PATH then the
156ce3adf43SDag-Erling Smørgrav  multiplex scp tests will fail (since the system's shell startup scripts
157ce3adf43SDag-Erling Smørgrav  will determine where the shell started by sshd will look for scp).
158ce3adf43SDag-Erling Smørgrav
159ce3adf43SDag-Erling Smørgrav- Recent GNU coreutils deprecate "head -[n]": this will cause the yes-head
160ce3adf43SDag-Erling Smørgrav  test to fail.  The old behaviour can be restored by setting (and
161ce3adf43SDag-Erling Smørgrav  exporting) _POSIX2_VERSION=199209 before running the tests.
162