Name Date Size #Lines LOC

..--

misc/H05-Sep-2024-2,1691,801

unittests/H05-Sep-2024-10,8369,138

MakefileHD05-May-20259.1 KiB317271

README.regressHD05-Sep-20245.7 KiB162136

addrmatch.shHD05-Sep-20242.4 KiB6954

agent-getpeereid.shHD05-Sep-20241.4 KiB6148

agent-pkcs11-cert.shHD05-Sep-20242.9 KiB9371

agent-pkcs11-restrict.shHD05-Sep-20245.6 KiB194166

agent-pkcs11.shHD05-Sep-20241.2 KiB5543

agent-ptrace.shHD05-Sep-20241.4 KiB6856

agent-restrict.shHD05-Sep-202414.6 KiB496432

agent-subprocess.shHD05-Sep-2024517 2313

agent-timeout.shHD05-Sep-2024986 3932

agent.shHD05-Sep-20246.6 KiB228183

allow-deny-users.shHD05-Sep-20241.4 KiB4431

authinfo.shHD05-Sep-2024574 189

banner.shHD05-Sep-20241.3 KiB4732

broken-pipe.shHD05-Sep-2024281 138

brokenkeys.shHD05-Sep-2024462 2412

cert-file.shHD05-Sep-20245.3 KiB167120

cert-hostkey.shHD05-Sep-202410.5 KiB326275

cert-userkey.shHD05-Sep-202411.8 KiB397324

cfginclude.shHD05-May-20254.9 KiB316220

cfgmatch.shHD05-Sep-20244.8 KiB159124

cfgmatchlisten.shHD05-May-20256.3 KiB203155

cfgparse.shHD05-Sep-20242.2 KiB7652

channel-timeout.shHD05-Sep-20244.3 KiB162135

check-perm.cHD05-Sep-20244.3 KiB206163

cipher-speed.shHD05-Sep-20241 KiB4331

conch-ciphers.shHD05-Sep-2024879 3221

connect-privsep.shHD05-Sep-2024992 3524

connect-uri.shHD05-Sep-2024816 3020

connect.shHD05-Sep-2024407 1912

connection-timeout.shHD05-Sep-20242 KiB8872

dhgex.shHD05-Sep-20241.5 KiB6249

dropbear-ciphers.shHD05-May-20251.1 KiB3930

dropbear-kex.shHD05-May-2025892 3021

dsa_ssh2.prvHD05-Sep-2024863 1514

dsa_ssh2.pubHD05-Sep-2024732 1413

dynamic-forward.shHD05-Sep-20242.8 KiB11294

ed25519_openssh.prvHD05-Sep-2024419 87

ed25519_openssh.pubHD05-Sep-202481 21

envpass.shHD05-Sep-20243.2 KiB126108

exit-status-signal.shHD05-Sep-2024481 2515

exit-status.shHD05-Sep-2024562 2316

forcecommand.shHD05-Sep-20242.2 KiB6852

forward-control.shHD05-Sep-20247.5 KiB229185

forwarding.shHD05-Sep-20244.3 KiB137108

host-expand.shHD05-Sep-2024384 179

hostbased.shHD05-Sep-20242.1 KiB6747

hostkey-agent.shHD05-Sep-20242.8 KiB8867

hostkey-rotate.shHD05-Sep-20245.1 KiB153112

integrity.shHD05-Sep-20242.3 KiB7759

kextype.shHD05-Sep-2024587 2617

key-options.shHD05-May-20253.4 KiB125104

keygen-change.shHD05-Sep-2024522 2317

keygen-comment.shHD05-Sep-20241.4 KiB5343

keygen-convert.shHD05-Sep-20241.7 KiB5640

keygen-knownhosts.shHD05-Sep-20246.4 KiB221146

keygen-moduli.shHD05-Sep-2024900 2818

keygen-sshfp.shHD05-Sep-20241.7 KiB5038

keys-command.shHD05-Sep-20242.4 KiB8060

keyscan.shHD05-Sep-2024492 2619

keytype.shHD05-Sep-20242.4 KiB8473

knownhosts-command.shHD05-Sep-20241.5 KiB5444

knownhosts.shHD05-Sep-20241.2 KiB3626

krl.shHD05-Sep-20247 KiB218172

limit-keytype.shHD05-Sep-20244.7 KiB13498

localcommand.shHD05-Sep-2024351 148

login-timeout.shHD05-Sep-2024581 1913

match-subsystem.shHD05-Sep-20242.2 KiB9168

mkdtemp.cHD05-Sep-20241.5 KiB6237

modpipe.cHD05-Sep-20243.8 KiB151123

moduli.inHD05-Sep-20241.6 KiB43

multiplex.shHD05-May-20257.8 KiB211173

multipubkey.shHD05-Sep-20242.7 KiB7651

netcat.cHD05-Sep-202440.4 KiB1,6871,315

penalty-expire.shHD05-May-2025981 3621

penalty.shHD05-May-20251.7 KiB5332

percent.shHD05-May-20253.5 KiB12597

portnum.shHD05-Sep-2024624 3527

principals-command.shHD05-Sep-20245.2 KiB169127

proto-mismatch.shHD05-Sep-2024368 1812

proto-version.shHD05-Sep-2024527 3124

proxy-connect.shHD05-Sep-2024706 2821

putty-ciphers.shHD05-Sep-20241.4 KiB5641

putty-kex.shHD05-Sep-2024970 3724

putty-transfer.shHD05-Sep-20241,015 4233

reconfigure.shHD05-Sep-20241.4 KiB6648

reexec.shHD05-Sep-20241.1 KiB5835

rekey.shHD05-May-20255.2 KiB211185

rsa_openssh.prvHD05-Sep-2024883 1615

rsa_openssh.pubHD05-Sep-2024213 21

rsa_ssh2.prvHD05-Sep-2024924 1716

scp-ssh-wrapper.shHD05-Sep-20241 KiB7263

scp-uri.shHD05-Sep-20242.2 KiB8059

scp.shHD05-Sep-20246 KiB206164

scp3.shHD05-Sep-20241.7 KiB7054

servcfginclude.shHD05-Sep-20243.8 KiB189139

setuid-allowed.cHD05-Sep-20241.5 KiB5932

sftp-badcmds.shHD05-Sep-20242.2 KiB6650

sftp-batch.shHD05-Sep-20241.2 KiB5638

sftp-chroot.shHD05-Sep-20241.2 KiB4834

sftp-cmds.shHD05-May-20257.4 KiB233174

sftp-glob.shHD05-Sep-20242.5 KiB7663

sftp-perm.shHD05-Sep-20245.4 KiB272210

sftp-uri.shHD05-Sep-20241.6 KiB6448

sftp.shHD05-Sep-2024737 3326

ssh-com-client.shHD05-Sep-20243 KiB131102

ssh-com-keygen.shHD05-Sep-20241.4 KiB7564

ssh-com-sftp.shHD05-Sep-20241.2 KiB6654

ssh-com.shHD05-Sep-20242.7 KiB12095

ssh2putty.shHD05-Sep-2024746 3725

sshcfgparse.shHD05-Sep-20244.8 KiB120100

sshfp-connect.shHD05-Sep-20242.8 KiB6736

sshsig.shHD05-Sep-202421.9 KiB541422

stderr-after-eof.shHD05-Sep-2024603 2517

stderr-data.shHD05-Sep-2024709 2822

t11.okHD05-Sep-202451 21

t4.okHD05-Sep-202452 21

t5.okHD05-Sep-202466 21

test-exec.shHD05-May-202526.2 KiB1,052849

timestamp.cHD05-Sep-20241.4 KiB4719

transfer.shHD05-Sep-2024583 2418

try-ciphers.shHD05-Sep-2024715 2920

valgrind-unit.shHD05-Sep-2024640 2515

yes-head.shHD05-May-2025402 149

README.regress

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