diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/Makefile | 5 | ||||
-rw-r--r-- | regress/README.regress | 12 | ||||
-rw-r--r-- | regress/agent-ptrace.sh | 13 | ||||
-rw-r--r-- | regress/banner.sh | 44 | ||||
-rw-r--r-- | regress/sftp-badcmds.sh | 2 | ||||
-rw-r--r-- | regress/sftp-batch.sh | 4 | ||||
-rw-r--r-- | regress/sftp-cmds.sh | 16 | ||||
-rw-r--r-- | regress/ssh-com.sh | 4 | ||||
-rw-r--r-- | regress/test-exec.sh | 3 |
9 files changed, 89 insertions, 14 deletions
diff --git a/regress/Makefile b/regress/Makefile index 623be8d82..76e28d36d 100644 --- a/regress/Makefile +++ b/regress/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.24 2003/07/03 08:24:13 markus Exp $ | 1 | # $OpenBSD: Makefile,v 1.26 2003/10/11 11:49:49 dtucker Exp $ |
2 | 2 | ||
3 | REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec | 3 | REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec |
4 | tests: $(REGRESS_TARGETS) | 4 | tests: $(REGRESS_TARGETS) |
@@ -14,6 +14,7 @@ LTESTS= connect \ | |||
14 | proto-mismatch \ | 14 | proto-mismatch \ |
15 | exit-status \ | 15 | exit-status \ |
16 | transfer \ | 16 | transfer \ |
17 | banner \ | ||
17 | rekey \ | 18 | rekey \ |
18 | stderr-data \ | 19 | stderr-data \ |
19 | stderr-after-eof \ | 20 | stderr-after-eof \ |
@@ -40,7 +41,7 @@ CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ | |||
40 | ssh_config ssh_proxy sshd_config sshd_proxy \ | 41 | ssh_config ssh_proxy sshd_config sshd_proxy \ |
41 | rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \ | 42 | rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \ |
42 | rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \ | 43 | rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \ |
43 | ls.copy remote_pid | 44 | ls.copy banner.in banner.out empty.in remote_pid |
44 | 45 | ||
45 | #LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp | 46 | #LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp |
46 | 47 | ||
diff --git a/regress/README.regress b/regress/README.regress index 916894a88..b479c6c07 100644 --- a/regress/README.regress +++ b/regress/README.regress | |||
@@ -22,7 +22,7 @@ Environment variables. | |||
22 | 22 | ||
23 | SUDO: path to sudo command, if desired. Note that some systems (notably | 23 | SUDO: path to sudo command, if desired. Note that some systems (notably |
24 | systems using PAM) require sudo to execute some tests. | 24 | systems using PAM) require sudo to execute some tests. |
25 | TEST_SSH_TRACE: set yo "yes" for verbose output from tests | 25 | TEST_SSH_TRACE: set to "yes" for verbose output from tests |
26 | TEST_SSH_QUIET: set to "yes" to suppress non-fatal output. | 26 | TEST_SSH_QUIET: set to "yes" to suppress non-fatal output. |
27 | TEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD | 27 | TEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD |
28 | SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER | 28 | SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER |
@@ -82,5 +82,13 @@ Failed tests can be difficult to diagnose. Suggestions: | |||
82 | 82 | ||
83 | Known Issues. | 83 | Known Issues. |
84 | 84 | ||
85 | - If you build with tcpwrappers and try to run the regression tests, | ||
86 | your hosts.allow must permit connections from localhost and from | ||
87 | "unknown". This is because some tests are performed via the loopback | ||
88 | interface, while others are done with "sshd -i" as a ProxyCommand. In | ||
89 | the latter case, when sshd calls getpeername() on the socket it will | ||
90 | fail (because it's not a tcp socket) and will be identified as | ||
91 | "unknown", which is then checked against tcpwrappers. | ||
85 | 92 | ||
86 | $Id: README.regress,v 1.1 2003/09/04 05:39:54 dtucker Exp $ | 93 | |
94 | $Id: README.regress,v 1.3 2004/01/28 01:26:14 dtucker Exp $ | ||
diff --git a/regress/agent-ptrace.sh b/regress/agent-ptrace.sh index cd9c0023d..bd79d7cb8 100644 --- a/regress/agent-ptrace.sh +++ b/regress/agent-ptrace.sh | |||
@@ -5,7 +5,7 @@ tid="disallow agent ptrace attach" | |||
5 | 5 | ||
6 | if have_prog uname ; then | 6 | if have_prog uname ; then |
7 | case `uname` in | 7 | case `uname` in |
8 | Linux|HP-UX|SunOS|NetBSD|AIX|CYGWIN*) | 8 | AIX|CYGWIN*) |
9 | echo "skipped (not supported on this platform)" | 9 | echo "skipped (not supported on this platform)" |
10 | exit 0 | 10 | exit 0 |
11 | ;; | 11 | ;; |
@@ -19,6 +19,15 @@ else | |||
19 | exit 0 | 19 | exit 0 |
20 | fi | 20 | fi |
21 | 21 | ||
22 | if test -z "$SUDO" ; then | ||
23 | echo "skipped (SUDO not set)" | ||
24 | exit 0 | ||
25 | else | ||
26 | $SUDO chown 0 ${SSHAGENT} | ||
27 | $SUDO chgrp 0 ${SSHAGENT} | ||
28 | $SUDO chmod 2755 ${SSHAGENT} | ||
29 | fi | ||
30 | |||
22 | trace "start agent" | 31 | trace "start agent" |
23 | eval `${SSHAGENT} -s` > /dev/null | 32 | eval `${SSHAGENT} -s` > /dev/null |
24 | r=$? | 33 | r=$? |
@@ -32,7 +41,7 @@ EOF | |||
32 | if [ $? -ne 0 ]; then | 41 | if [ $? -ne 0 ]; then |
33 | fail "gdb failed: exit code $?" | 42 | fail "gdb failed: exit code $?" |
34 | fi | 43 | fi |
35 | grep 'ptrace: Operation not permitted.' >/dev/null ${OBJ}/gdb.out | 44 | egrep 'ptrace: Operation not permitted.|procfs:.*Permission denied.|ttrace attach: Permission denied.' >/dev/null ${OBJ}/gdb.out |
36 | r=$? | 45 | r=$? |
37 | rm -f ${OBJ}/gdb.out | 46 | rm -f ${OBJ}/gdb.out |
38 | if [ $r -ne 0 ]; then | 47 | if [ $r -ne 0 ]; then |
diff --git a/regress/banner.sh b/regress/banner.sh new file mode 100644 index 000000000..0b9c95007 --- /dev/null +++ b/regress/banner.sh | |||
@@ -0,0 +1,44 @@ | |||
1 | # $OpenBSD: banner.sh,v 1.2 2003/10/11 11:49:49 dtucker Exp $ | ||
2 | # Placed in the Public Domain. | ||
3 | |||
4 | tid="banner" | ||
5 | echo "Banner $OBJ/banner.in" >> $OBJ/sshd_proxy | ||
6 | |||
7 | rm -f $OBJ/banner.out $OBJ/banner.in $OBJ/empty.in | ||
8 | touch $OBJ/empty.in | ||
9 | |||
10 | trace "test missing banner file" | ||
11 | verbose "test $tid: missing banner file" | ||
12 | ( ${SSH} -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out && \ | ||
13 | cmp $OBJ/empty.in $OBJ/banner.out ) || \ | ||
14 | fail "missing banner file" | ||
15 | |||
16 | for s in 0 10 100 1000 10000 100000 ; do | ||
17 | if [ "$s" = "0" ]; then | ||
18 | # create empty banner | ||
19 | touch $OBJ/banner.in | ||
20 | elif [ "$s" = "10" ]; then | ||
21 | # create 10-byte banner file | ||
22 | echo "abcdefghi" >$OBJ/banner.in | ||
23 | else | ||
24 | # increase size 10x | ||
25 | cp $OBJ/banner.in $OBJ/banner.out | ||
26 | for i in 0 1 2 3 4 5 6 7 8 ; do | ||
27 | cat $OBJ/banner.out >> $OBJ/banner.in | ||
28 | done | ||
29 | fi | ||
30 | |||
31 | trace "test banner size $s" | ||
32 | verbose "test $tid: size $s" | ||
33 | ( ${SSH} -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out && \ | ||
34 | cmp $OBJ/banner.in $OBJ/banner.out ) || \ | ||
35 | fail "banner size $s mismatch" | ||
36 | done | ||
37 | |||
38 | trace "test suppress banner (-q)" | ||
39 | verbose "test $tid: suppress banner (-q)" | ||
40 | ( ${SSH} -q -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out && \ | ||
41 | cmp $OBJ/empty.in $OBJ/banner.out ) || \ | ||
42 | fail "suppress banner (-q)" | ||
43 | |||
44 | rm -f $OBJ/banner.out $OBJ/banner.in $OBJ/empty.in | ||
diff --git a/regress/sftp-badcmds.sh b/regress/sftp-badcmds.sh index a6a19409d..eac189aaf 100644 --- a/regress/sftp-badcmds.sh +++ b/regress/sftp-badcmds.sh | |||
@@ -4,7 +4,7 @@ | |||
4 | tid="sftp invalid commands" | 4 | tid="sftp invalid commands" |
5 | 5 | ||
6 | DATA=/bin/ls${EXEEXT} | 6 | DATA=/bin/ls${EXEEXT} |
7 | DATA2=/bin/cat${EXEEXT} | 7 | DATA2=/bin/sh${EXEEXT} |
8 | NONEXIST=/NONEXIST.$$ | 8 | NONEXIST=/NONEXIST.$$ |
9 | COPY=${OBJ}/copy | 9 | COPY=${OBJ}/copy |
10 | GLOBFILES=`(cd /bin;echo l*)` | 10 | GLOBFILES=`(cd /bin;echo l*)` |
diff --git a/regress/sftp-batch.sh b/regress/sftp-batch.sh index f648eae80..365c47cfc 100644 --- a/regress/sftp-batch.sh +++ b/regress/sftp-batch.sh | |||
@@ -1,11 +1,11 @@ | |||
1 | # $OpenBSD: sftp-batch.sh,v 1.2 2003/01/10 07:52:41 djm Exp $ | 1 | # $OpenBSD: sftp-batch.sh,v 1.3 2004/01/13 09:49:06 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="sftp batchfile" | 4 | tid="sftp batchfile" |
5 | 5 | ||
6 | DATA=/bin/ls${EXEEXT} | 6 | DATA=/bin/ls${EXEEXT} |
7 | COPY=${OBJ}/copy | 7 | COPY=${OBJ}/copy |
8 | BATCH=${OBJ}/sftp-batch.tmp | 8 | BATCH=${OBJ}/sftp.bb |
9 | 9 | ||
10 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* | 10 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* |
11 | 11 | ||
diff --git a/regress/sftp-cmds.sh b/regress/sftp-cmds.sh index 1256aeb2d..3669b19ff 100644 --- a/regress/sftp-cmds.sh +++ b/regress/sftp-cmds.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: sftp-cmds.sh,v 1.5 2003/07/19 00:46:31 djm Exp $ | 1 | # $OpenBSD: sftp-cmds.sh,v 1.6 2003/10/07 07:04:52 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | # XXX - TODO: | 4 | # XXX - TODO: |
@@ -79,6 +79,20 @@ echo "get $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | |||
79 | || fail "get failed" | 79 | || fail "get failed" |
80 | cmp $DATA ${COPY} || fail "corrupted copy after get" | 80 | cmp $DATA ${COPY} || fail "corrupted copy after get" |
81 | 81 | ||
82 | rm -f ${COPY} | ||
83 | verbose "$tid: get quoted" | ||
84 | echo "get \"$DATA\" $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
85 | || fail "get failed" | ||
86 | cmp $DATA ${COPY} || fail "corrupted copy after get" | ||
87 | |||
88 | rm -f ${QUOTECOPY} | ||
89 | cp $DATA ${QUOTECOPY} | ||
90 | verbose "$tid: get filename with quotes" | ||
91 | echo "get \"$QUOTECOPY_ARG\" ${COPY}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
92 | || fail "put failed" | ||
93 | cmp ${COPY} ${QUOTECOPY} || fail "corrupted copy after get with quotes" | ||
94 | rm -f ${QUOTECOPY} ${COPY} | ||
95 | |||
82 | rm -f ${COPY}.dd/* | 96 | rm -f ${COPY}.dd/* |
83 | verbose "$tid: get to directory" | 97 | verbose "$tid: get to directory" |
84 | echo "get $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | 98 | echo "get $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ |
diff --git a/regress/ssh-com.sh b/regress/ssh-com.sh index 78ae6e9e1..c3715a242 100644 --- a/regress/ssh-com.sh +++ b/regress/ssh-com.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: ssh-com.sh,v 1.5 2003/05/14 22:08:27 markus Exp $ | 1 | # $OpenBSD: ssh-com.sh,v 1.6 2003/11/07 10:16:44 jmc Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="connect to ssh.com server" | 4 | tid="connect to ssh.com server" |
@@ -29,7 +29,7 @@ SRC=`dirname ${SCRIPT}` | |||
29 | # ssh.com | 29 | # ssh.com |
30 | cat << EOF > $OBJ/sshd2_config | 30 | cat << EOF > $OBJ/sshd2_config |
31 | #*: | 31 | #*: |
32 | # Port and ListenAdress are not used. | 32 | # Port and ListenAddress are not used. |
33 | QuietMode yes | 33 | QuietMode yes |
34 | Port 4343 | 34 | Port 4343 |
35 | ListenAddress 127.0.0.1 | 35 | ListenAddress 127.0.0.1 |
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index cc7ea67fe..98851dc97 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -30,7 +30,7 @@ if [ ! -f $SCRIPT ]; then | |||
30 | echo "not a file: $SCRIPT" | 30 | echo "not a file: $SCRIPT" |
31 | exit 2 | 31 | exit 2 |
32 | fi | 32 | fi |
33 | if sh -n $SCRIPT; then | 33 | if $TEST_SHELL -n $SCRIPT; then |
34 | true | 34 | true |
35 | else | 35 | else |
36 | echo "syntax error in $SCRIPT" | 36 | echo "syntax error in $SCRIPT" |
@@ -185,7 +185,6 @@ Host * | |||
185 | ChallengeResponseAuthentication no | 185 | ChallengeResponseAuthentication no |
186 | HostbasedAuthentication no | 186 | HostbasedAuthentication no |
187 | PasswordAuthentication no | 187 | PasswordAuthentication no |
188 | RhostsAuthentication no | ||
189 | RhostsRSAAuthentication no | 188 | RhostsRSAAuthentication no |
190 | BatchMode yes | 189 | BatchMode yes |
191 | StrictHostKeyChecking yes | 190 | StrictHostKeyChecking yes |