Darren Tucker | f3568fc | 2013-05-17 09:35:26 +1000 | [diff] [blame] | 1 | # $OpenBSD: Makefile,v 1.65 2013/04/18 02:46:12 djm Exp $ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 2 | |
Damien Miller | 3a0e9f6 | 2010-11-05 10:16:34 +1100 | [diff] [blame] | 3 | REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t-exec |
Tim Rice | c31db8c | 2013-02-19 19:01:51 -0800 | [diff] [blame] | 4 | tests: $(REGRESS_TARGETS) |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 5 | |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 6 | # Interop tests are not run by default |
Damien Miller | 6642996 | 2008-03-13 12:05:40 +1100 | [diff] [blame] | 7 | interop interop-tests: t-exec-interop |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 8 | |
Darren Tucker | ebc3c13 | 2003-09-04 15:37:58 +1000 | [diff] [blame] | 9 | clean: |
Darren Tucker | b12d16f | 2003-09-14 11:40:35 +1000 | [diff] [blame] | 10 | for F in $(CLEANFILES); do rm -f $(OBJ)$$F; done |
Darren Tucker | f3568fc | 2013-05-17 09:35:26 +1000 | [diff] [blame] | 11 | test -z "${SUDO}" || ${SUDO} rm -f ${SUDO_CLEAN} |
Damien Miller | 9c8a427 | 2008-03-27 17:42:06 +1100 | [diff] [blame] | 12 | rm -rf $(OBJ).putty |
| 13 | |
Darren Tucker | ebc3c13 | 2003-09-04 15:37:58 +1000 | [diff] [blame] | 14 | distclean: clean |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 15 | |
| 16 | LTESTS= connect \ |
| 17 | proxy-connect \ |
| 18 | connect-privsep \ |
| 19 | proto-version \ |
| 20 | proto-mismatch \ |
| 21 | exit-status \ |
Darren Tucker | 4c37ef0 | 2004-06-16 20:08:56 +1000 | [diff] [blame] | 22 | envpass \ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 23 | transfer \ |
Darren Tucker | dc001a5 | 2003-10-08 17:47:19 +1000 | [diff] [blame] | 24 | banner \ |
Darren Tucker | d57a76e | 2003-06-18 22:32:51 +1000 | [diff] [blame] | 25 | rekey \ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 26 | stderr-data \ |
| 27 | stderr-after-eof \ |
| 28 | broken-pipe \ |
| 29 | try-ciphers \ |
| 30 | yes-head \ |
Darren Tucker | 017fd61 | 2004-02-29 20:30:17 +1100 | [diff] [blame] | 31 | login-timeout \ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 32 | agent \ |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 33 | agent-getpeereid \ |
| 34 | agent-timeout \ |
| 35 | agent-ptrace \ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 36 | keyscan \ |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 37 | keygen-change \ |
Damien Miller | b6bd3c2 | 2010-02-24 17:24:56 +1100 | [diff] [blame] | 38 | keygen-convert \ |
Damien Miller | 2e80cf2 | 2008-06-30 08:06:25 +1000 | [diff] [blame] | 39 | key-options \ |
Darren Tucker | 50433a9 | 2004-06-16 20:15:59 +1000 | [diff] [blame] | 40 | scp \ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 41 | sftp \ |
Darren Tucker | f3568fc | 2013-05-17 09:35:26 +1000 | [diff] [blame] | 42 | sftp-chroot \ |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 43 | sftp-cmds \ |
Darren Tucker | a4040f5 | 2003-06-18 22:35:11 +1000 | [diff] [blame] | 44 | sftp-badcmds \ |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 45 | sftp-batch \ |
Darren Tucker | 1c56ef6 | 2005-03-07 17:36:18 +1100 | [diff] [blame] | 46 | sftp-glob \ |
Darren Tucker | 50cea67 | 2003-06-18 22:45:34 +1000 | [diff] [blame] | 47 | reconfigure \ |
Darren Tucker | e2f2be7 | 2003-07-03 20:27:55 +1000 | [diff] [blame] | 48 | dynamic-forward \ |
Darren Tucker | e7d0583 | 2004-06-16 20:22:22 +1000 | [diff] [blame] | 49 | forwarding \ |
Darren Tucker | 977a9d2 | 2004-06-25 13:45:18 +1000 | [diff] [blame] | 50 | multiplex \ |
Darren Tucker | 124f58e | 2004-12-06 23:07:37 +1100 | [diff] [blame] | 51 | reexec \ |
Damien Miller | 7b1877c | 2006-07-24 15:31:41 +1000 | [diff] [blame] | 52 | brokenkeys \ |
| 53 | cfgmatch \ |
Darren Tucker | 10f9242 | 2008-06-10 23:16:46 +1000 | [diff] [blame] | 54 | addrmatch \ |
Damien Miller | a5e5842 | 2008-03-12 23:58:05 +1100 | [diff] [blame] | 55 | localcommand \ |
Darren Tucker | 287b932 | 2009-10-07 10:31:56 +1100 | [diff] [blame] | 56 | forcecommand \ |
Damien Miller | 58ac6de | 2010-02-27 07:57:12 +1100 | [diff] [blame] | 57 | portnum \ |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 58 | keytype \ |
| 59 | kextype \ |
Damien Miller | 58ac6de | 2010-02-27 07:57:12 +1100 | [diff] [blame] | 60 | cert-hostkey \ |
Damien Miller | 7d06b00 | 2011-01-07 09:54:20 +1100 | [diff] [blame] | 61 | cert-userkey \ |
Damien Miller | 771c43c | 2012-12-03 10:12:13 +1100 | [diff] [blame] | 62 | host-expand \ |
Damien Miller | 999bd2d | 2012-12-03 10:13:39 +1100 | [diff] [blame] | 63 | keys-command \ |
Damien Miller | 1fb593a | 2012-12-12 10:54:37 +1100 | [diff] [blame] | 64 | forward-control \ |
Damien Miller | ebafebd | 2013-01-18 11:51:56 +1100 | [diff] [blame] | 65 | integrity \ |
| 66 | krl |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 67 | |
Damien Miller | 4268a13 | 2008-06-30 08:07:56 +1000 | [diff] [blame] | 68 | INTEROP_TESTS= putty-transfer putty-ciphers putty-kex conch-ciphers |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 69 | #INTEROP_TESTS+=ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp |
| 70 | |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 71 | #LTESTS= cipher-speed |
| 72 | |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 73 | USER!= id -un |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 74 | CLEANFILES= t2.out t3.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ |
Damien Miller | 3a0e9f6 | 2010-11-05 10:16:34 +1100 | [diff] [blame] | 75 | t8.out t8.out.pub t9.out t9.out.pub \ |
Darren Tucker | fe10a28 | 2013-03-12 11:19:40 +1100 | [diff] [blame] | 76 | authorized_keys_${USER} known_hosts pidfile testdata \ |
Darren Tucker | 3206e57 | 2004-12-06 23:04:57 +1100 | [diff] [blame] | 77 | ssh_config sshd_config.orig ssh_proxy sshd_config sshd_proxy \ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 78 | rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \ |
| 79 | rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \ |
Darren Tucker | 50433a9 | 2004-06-16 20:15:59 +1000 | [diff] [blame] | 80 | ls.copy banner.in banner.out empty.in \ |
Damien Miller | 7b1877c | 2006-07-24 15:31:41 +1000 | [diff] [blame] | 81 | scp-ssh-wrapper.scp ssh_proxy_envpass remote_pid \ |
Damien Miller | 9c8a427 | 2008-03-27 17:42:06 +1100 | [diff] [blame] | 82 | sshd_proxy_bak rsa_ssh2_cr.prv rsa_ssh2_crnl.prv \ |
Damien Miller | ebafebd | 2013-01-18 11:51:56 +1100 | [diff] [blame] | 83 | known_hosts-cert host_ca_key* cert_host_key* cert_user_key* \ |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 84 | putty.rsa2 sshd_proxy_orig ssh_proxy_bak \ |
| 85 | key.rsa-* key.dsa-* key.ecdsa-* \ |
Damien Miller | 999bd2d | 2012-12-03 10:13:39 +1100 | [diff] [blame] | 86 | authorized_principals_${USER} expect actual ready \ |
Darren Tucker | 7512902 | 2013-05-17 09:19:10 +1000 | [diff] [blame] | 87 | sshd_proxy.* authorized_keys_${USER}.* modpipe revoked-* krl-* \ |
Darren Tucker | dfea3bc | 2013-05-17 09:31:39 +1000 | [diff] [blame] | 88 | ssh.log failed-ssh.log sshd.log failed-sshd.log \ |
| 89 | regress.log failed-regress.log ssh-log-wrapper.sh |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 90 | |
Darren Tucker | f3568fc | 2013-05-17 09:35:26 +1000 | [diff] [blame] | 91 | SUDO_CLEAN+= /var/run/testdata_${USER} /var/run/keycommand_${USER} |
| 92 | |
Damien Miller | 8f9492c | 2010-02-24 17:28:45 +1100 | [diff] [blame] | 93 | # Enable all malloc(3) randomisations and checks |
| 94 | TEST_ENV= "MALLOC_OPTIONS=AFGJPRX" |
| 95 | |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 96 | TEST_SSH_SSHKEYGEN?=ssh-keygen |
| 97 | |
Damien Miller | b3764e1 | 2013-02-19 13:15:01 +1100 | [diff] [blame] | 98 | CPPFLAGS=-I.. |
| 99 | |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 100 | t1: |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 101 | ${TEST_SSH_SSHKEYGEN} -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 102 | tr '\n' '\r' <${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_cr.prv |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 103 | ${TEST_SSH_SSHKEYGEN} -if ${.OBJDIR}/rsa_ssh2_cr.prv | diff - ${.CURDIR}/rsa_openssh.prv |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 104 | awk '{print $$0 "\r"}' ${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_crnl.prv |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 105 | ${TEST_SSH_SSHKEYGEN} -if ${.OBJDIR}/rsa_ssh2_crnl.prv | diff - ${.CURDIR}/rsa_openssh.prv |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 106 | |
| 107 | t2: |
Tim Rice | 8b2157d | 2003-09-09 06:07:10 -0700 | [diff] [blame] | 108 | cat ${.CURDIR}/rsa_openssh.prv > $(OBJ)/t2.out |
| 109 | chmod 600 $(OBJ)/t2.out |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 110 | ${TEST_SSH_SSHKEYGEN} -yf $(OBJ)/t2.out | diff - ${.CURDIR}/rsa_openssh.pub |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 111 | |
| 112 | t3: |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 113 | ${TEST_SSH_SSHKEYGEN} -ef ${.CURDIR}/rsa_openssh.pub >$(OBJ)/t3.out |
| 114 | ${TEST_SSH_SSHKEYGEN} -if $(OBJ)/t3.out | diff - ${.CURDIR}/rsa_openssh.pub |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 115 | |
| 116 | t4: |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 117 | ${TEST_SSH_SSHKEYGEN} -lf ${.CURDIR}/rsa_openssh.pub |\ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 118 | awk '{print $$2}' | diff - ${.CURDIR}/t4.ok |
| 119 | |
| 120 | t5: |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 121 | ${TEST_SSH_SSHKEYGEN} -Bf ${.CURDIR}/rsa_openssh.pub |\ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 122 | awk '{print $$2}' | diff - ${.CURDIR}/t5.ok |
| 123 | |
| 124 | t6: |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 125 | ${TEST_SSH_SSHKEYGEN} -if ${.CURDIR}/dsa_ssh2.prv > $(OBJ)/t6.out1 |
| 126 | ${TEST_SSH_SSHKEYGEN} -if ${.CURDIR}/dsa_ssh2.pub > $(OBJ)/t6.out2 |
Tim Rice | 8b2157d | 2003-09-09 06:07:10 -0700 | [diff] [blame] | 127 | chmod 600 $(OBJ)/t6.out1 |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 128 | ${TEST_SSH_SSHKEYGEN} -yf $(OBJ)/t6.out1 | diff - $(OBJ)/t6.out2 |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 129 | |
Tim Rice | 8b2157d | 2003-09-09 06:07:10 -0700 | [diff] [blame] | 130 | $(OBJ)/t7.out: |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 131 | ${TEST_SSH_SSHKEYGEN} -q -t rsa -N '' -f $@ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 132 | |
Tim Rice | 8b2157d | 2003-09-09 06:07:10 -0700 | [diff] [blame] | 133 | t7: $(OBJ)/t7.out |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 134 | ${TEST_SSH_SSHKEYGEN} -lf $(OBJ)/t7.out > /dev/null |
| 135 | ${TEST_SSH_SSHKEYGEN} -Bf $(OBJ)/t7.out > /dev/null |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 136 | |
Tim Rice | 522262f | 2010-11-07 13:00:27 -0800 | [diff] [blame] | 137 | $(OBJ)/t8.out: |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 138 | ${TEST_SSH_SSHKEYGEN} -q -t dsa -N '' -f $@ |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 139 | |
Tim Rice | 522262f | 2010-11-07 13:00:27 -0800 | [diff] [blame] | 140 | t8: $(OBJ)/t8.out |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 141 | ${TEST_SSH_SSHKEYGEN} -lf $(OBJ)/t8.out > /dev/null |
| 142 | ${TEST_SSH_SSHKEYGEN} -Bf $(OBJ)/t8.out > /dev/null |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 143 | |
Tim Rice | 522262f | 2010-11-07 13:00:27 -0800 | [diff] [blame] | 144 | $(OBJ)/t9.out: |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 145 | test "${TEST_SSH_ECC}" != yes || \ |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 146 | ${TEST_SSH_SSHKEYGEN} -q -t ecdsa -N '' -f $@ |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 147 | |
Tim Rice | 522262f | 2010-11-07 13:00:27 -0800 | [diff] [blame] | 148 | t9: $(OBJ)/t9.out |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 149 | test "${TEST_SSH_ECC}" != yes || \ |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 150 | ${TEST_SSH_SSHKEYGEN} -lf $(OBJ)/t9.out > /dev/null |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 151 | test "${TEST_SSH_ECC}" != yes || \ |
Damien Miller | 369c0e8 | 2011-01-17 10:51:40 +1100 | [diff] [blame] | 152 | ${TEST_SSH_SSHKEYGEN} -Bf $(OBJ)/t9.out > /dev/null |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 153 | |
Damien Miller | faabeb6 | 2012-12-12 12:51:54 +1100 | [diff] [blame] | 154 | t-exec: ${LTESTS:=.sh} |
Darren Tucker | ebc3c13 | 2003-09-04 15:37:58 +1000 | [diff] [blame] | 155 | @if [ "x$?" = "x" ]; then exit 0; fi; \ |
| 156 | for TEST in ""$?; do \ |
| 157 | echo "run test $${TEST}" ... 1>&2; \ |
Damien Miller | 527ded7 | 2010-07-02 13:40:16 +1000 | [diff] [blame] | 158 | (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \ |
Darren Tucker | ebc3c13 | 2003-09-04 15:37:58 +1000 | [diff] [blame] | 159 | done |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 160 | |
| 161 | t-exec-interop: ${INTEROP_TESTS:=.sh} |
| 162 | @if [ "x$?" = "x" ]; then exit 0; fi; \ |
| 163 | for TEST in ""$?; do \ |
| 164 | echo "run test $${TEST}" ... 1>&2; \ |
Damien Miller | 527ded7 | 2010-07-02 13:40:16 +1000 | [diff] [blame] | 165 | (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \ |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 166 | done |
| 167 | |
Darren Tucker | eab5f0d | 2010-11-05 18:23:38 +1100 | [diff] [blame] | 168 | # Not run by default |
| 169 | interop: ${INTEROP_TARGETS} |