blob: 4f47bc3fdbb5cb315d5ca2d43f0248feea2ec86e [file] [log] [blame]
Darren Tucker5d909f02005-03-07 18:35:34 +11001# $OpenBSD: Makefile,v 1.36 2005/03/04 08:48:46 djm Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002
Darren Tuckerebc3c132003-09-04 15:37:58 +10003REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec
4tests: $(REGRESS_TARGETS)
Damien Miller38cd4352002-05-01 13:17:33 +10005
Darren Tuckerebc3c132003-09-04 15:37:58 +10006clean:
Darren Tuckerb12d16f2003-09-14 11:40:35 +10007 for F in $(CLEANFILES); do rm -f $(OBJ)$$F; done
Darren Tuckerebc3c132003-09-04 15:37:58 +10008distclean: clean
Damien Miller38cd4352002-05-01 13:17:33 +10009
10LTESTS= connect \
11 proxy-connect \
12 connect-privsep \
13 proto-version \
14 proto-mismatch \
15 exit-status \
Darren Tucker4c37ef02004-06-16 20:08:56 +100016 envpass \
Damien Miller38cd4352002-05-01 13:17:33 +100017 transfer \
Darren Tuckerdc001a52003-10-08 17:47:19 +100018 banner \
Darren Tuckerd57a76e2003-06-18 22:32:51 +100019 rekey \
Damien Miller38cd4352002-05-01 13:17:33 +100020 stderr-data \
21 stderr-after-eof \
22 broken-pipe \
23 try-ciphers \
24 yes-head \
Darren Tucker017fd612004-02-29 20:30:17 +110025 login-timeout \
Damien Miller38cd4352002-05-01 13:17:33 +100026 agent \
Damien Miller8b9cde72003-01-22 17:53:16 +110027 agent-getpeereid \
28 agent-timeout \
29 agent-ptrace \
Damien Miller38cd4352002-05-01 13:17:33 +100030 keyscan \
Damien Miller8b9cde72003-01-22 17:53:16 +110031 keygen-change \
Darren Tucker50433a92004-06-16 20:15:59 +100032 scp \
Damien Miller38cd4352002-05-01 13:17:33 +100033 sftp \
Damien Miller8b9cde72003-01-22 17:53:16 +110034 sftp-cmds \
Darren Tuckera4040f52003-06-18 22:35:11 +100035 sftp-badcmds \
Damien Miller8b9cde72003-01-22 17:53:16 +110036 sftp-batch \
Darren Tucker1c56ef62005-03-07 17:36:18 +110037 sftp-glob \
Darren Tucker50cea672003-06-18 22:45:34 +100038 reconfigure \
Darren Tuckere2f2be72003-07-03 20:27:55 +100039 dynamic-forward \
Darren Tuckere7d05832004-06-16 20:22:22 +100040 forwarding \
Darren Tucker977a9d22004-06-25 13:45:18 +100041 multiplex \
Darren Tucker124f58e2004-12-06 23:07:37 +110042 reexec \
43 brokenkeys
Damien Miller38cd4352002-05-01 13:17:33 +100044
45USER!= id -un
Darren Tucker7b6cb5c2003-09-14 13:16:55 +100046CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \
47 authorized_keys_${USER} known_hosts pidfile \
Darren Tucker3206e572004-12-06 23:04:57 +110048 ssh_config sshd_config.orig ssh_proxy sshd_config sshd_proxy \
Damien Miller38cd4352002-05-01 13:17:33 +100049 rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \
50 rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \
Darren Tucker50433a92004-06-16 20:15:59 +100051 ls.copy banner.in banner.out empty.in \
Darren Tucker5d909f02005-03-07 18:35:34 +110052 scp-ssh-wrapper.scp ssh_proxy_envpass \
Darren Tucker50433a92004-06-16 20:15:59 +100053 remote_pid
Damien Miller38cd4352002-05-01 13:17:33 +100054
Darren Tuckerb12d16f2003-09-14 11:40:35 +100055#LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp
Damien Miller38cd4352002-05-01 13:17:33 +100056
57t1:
58 ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv
59
60t2:
Tim Rice8b2157d2003-09-09 06:07:10 -070061 cat ${.CURDIR}/rsa_openssh.prv > $(OBJ)/t2.out
62 chmod 600 $(OBJ)/t2.out
63 ssh-keygen -yf $(OBJ)/t2.out | diff - ${.CURDIR}/rsa_openssh.pub
Damien Miller38cd4352002-05-01 13:17:33 +100064
65t3:
Darren Tuckerebc3c132003-09-04 15:37:58 +100066 ssh-keygen -ef ${.CURDIR}/rsa_openssh.pub >$(OBJ)/rsa_secsh.pub
67 ssh-keygen -if $(OBJ)/rsa_secsh.pub | diff - ${.CURDIR}/rsa_openssh.pub
68 rm -f ${.CURDIR}/rsa_secsh.pub
Damien Miller38cd4352002-05-01 13:17:33 +100069
70t4:
71 ssh-keygen -lf ${.CURDIR}/rsa_openssh.pub |\
72 awk '{print $$2}' | diff - ${.CURDIR}/t4.ok
73
74t5:
75 ssh-keygen -Bf ${.CURDIR}/rsa_openssh.pub |\
76 awk '{print $$2}' | diff - ${.CURDIR}/t5.ok
77
78t6:
Tim Rice8b2157d2003-09-09 06:07:10 -070079 ssh-keygen -if ${.CURDIR}/dsa_ssh2.prv > $(OBJ)/t6.out1
80 ssh-keygen -if ${.CURDIR}/dsa_ssh2.pub > $(OBJ)/t6.out2
81 chmod 600 $(OBJ)/t6.out1
82 ssh-keygen -yf $(OBJ)/t6.out1 | diff - $(OBJ)/t6.out2
Damien Miller38cd4352002-05-01 13:17:33 +100083
Tim Rice8b2157d2003-09-09 06:07:10 -070084$(OBJ)/t7.out:
Damien Miller38cd4352002-05-01 13:17:33 +100085 ssh-keygen -q -t rsa -N '' -f $@
86
Tim Rice8b2157d2003-09-09 06:07:10 -070087t7: $(OBJ)/t7.out
88 ssh-keygen -lf $(OBJ)/t7.out > /dev/null
89 ssh-keygen -Bf $(OBJ)/t7.out > /dev/null
Damien Miller38cd4352002-05-01 13:17:33 +100090
Darren Tuckerebc3c132003-09-04 15:37:58 +100091t-exec: ${LTESTS:=.sh}
92 @if [ "x$?" = "x" ]; then exit 0; fi; \
93 for TEST in ""$?; do \
94 echo "run test $${TEST}" ... 1>&2; \
Darren Tuckerb712fcc2005-03-07 18:27:28 +110095 (env SUDO=${SUDO} sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \
Darren Tuckerebc3c132003-09-04 15:37:58 +100096 done