summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/Makefile5
-rw-r--r--regress/multiplex.sh55
-rw-r--r--regress/test-exec.sh7
3 files changed, 64 insertions, 3 deletions
diff --git a/regress/Makefile b/regress/Makefile
index 8f15f3b4d..64674521b 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.29 2004/06/13 13:51:02 dtucker Exp $ 1# $OpenBSD: Makefile,v 1.30 2004/06/13 15:04:08 djm Exp $
2 2
3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec 3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec
4tests: $(REGRESS_TARGETS) 4tests: $(REGRESS_TARGETS)
@@ -36,7 +36,8 @@ LTESTS= connect \
36 sftp-batch \ 36 sftp-batch \
37 reconfigure \ 37 reconfigure \
38 dynamic-forward \ 38 dynamic-forward \
39 forwarding 39 forwarding \
40 multiplex
40 41
41USER!= id -un 42USER!= id -un
42CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ 43CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \
diff --git a/regress/multiplex.sh b/regress/multiplex.sh
new file mode 100644
index 000000000..70a4e677f
--- /dev/null
+++ b/regress/multiplex.sh
@@ -0,0 +1,55 @@
1# $OpenBSD: multiplex.sh,v 1.1 2004/06/13 15:04:08 djm Exp $
2# Placed in the Public Domain.
3
4CTL=$OBJ/ctl-sock
5
6tid="connection multiplexing"
7
8start_sshd
9
10trace "start master, fork to background"
11${SSH} -2 -MS$CTL -F $OBJ/ssh_config -f somehost sleep 60
12
13trace "ssh transfer over multiplexed connection and check result"
14${SSH} -S$CTL otherhost cat /bin/ls > $OBJ/ls.copy
15test -f $OBJ/ls.copy || fail "failed copy /bin/ls"
16cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls"
17
18trace "ssh transfer over multiplexed connection and check result"
19${SSH} -S $CTL otherhost cat /bin/ls > $OBJ/ls.copy
20test -f $OBJ/ls.copy || fail "failed copy /bin/ls"
21cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls"
22
23rm -f $OBJ/ls.copy
24trace "sftp transfer over multiplexed connection and check result"
25echo "get /bin/ls $OBJ/ls.copy" | \
26 ${SFTP} -oControlPath=$CTL otherhost
27test -f $OBJ/ls.copy || fail "failed copy /bin/ls"
28cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls"
29
30rm -f $OBJ/ls.copy
31trace "scp transfer over multiplexed connection and check result"
32${SCP} -oControlPath=$CTL otherhost:/bin/ls $OBJ/ls.copy
33test -f $OBJ/ls.copy || fail "failed copy /bin/ls"
34cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls"
35
36for s in 0 1 4 5 44; do
37 trace "exit status $s over multiplexed connection"
38 verbose "test $tid: status $s"
39 ${SSH} -S $CTL otherhost exit $s
40 r=$?
41 if [ $r -ne $s ]; then
42 fail "exit code mismatch for protocol $p: $r != $s"
43 fi
44
45 # same with early close of stdout/err
46 trace "exit status $s with early close over multiplexed connection"
47 ${SSH} -S $CTL -n otherhost \
48 exec sh -c \'"sleep 2; exec > /dev/null 2>&1; sleep 3; exit $s"\'
49 r=$?
50 if [ $r -ne $s ]; then
51 fail "exit code (with sleep) mismatch for protocol $p: $r != $s"
52 fi
53done
54
55sleep 30 # early close test sleeps 5 seconds per test
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index c8827b631..1f7e38d6a 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.17 2004/06/13 13:51:02 dtucker Exp $ 1# $OpenBSD: test-exec.sh,v 1.18 2004/06/13 15:04:08 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4PORT=4242 4PORT=4242
@@ -41,6 +41,7 @@ unset SSH_AUTH_SOCK
41# defaults 41# defaults
42SSH=ssh 42SSH=ssh
43SSHD=sshd 43SSHD=sshd
44SCP=scp
44SSHAGENT=ssh-agent 45SSHAGENT=ssh-agent
45SSHADD=ssh-add 46SSHADD=ssh-add
46SSHKEYGEN=ssh-keygen 47SSHKEYGEN=ssh-keygen
@@ -55,6 +56,9 @@ fi
55if [ "x$TEST_SSH_SSHD" != "x" ]; then 56if [ "x$TEST_SSH_SSHD" != "x" ]; then
56 SSHD="${TEST_SSH_SSHD}" 57 SSHD="${TEST_SSH_SSHD}"
57fi 58fi
59if [ "x$TEST_SSH_SCP" != "x" ]; then
60 SCP="${TEST_SSH_SCP}"
61fi
58if [ "x$TEST_SSH_SSHAGENT" != "x" ]; then 62if [ "x$TEST_SSH_SSHAGENT" != "x" ]; then
59 SSHAGENT="${TEST_SSH_SSHAGENT}" 63 SSHAGENT="${TEST_SSH_SSHAGENT}"
60fi 64fi
@@ -168,6 +172,7 @@ cat << EOF > $OBJ/sshd_config
168 LogLevel QUIET 172 LogLevel QUIET
169 AcceptEnv _XXX_TEST_* 173 AcceptEnv _XXX_TEST_*
170 AcceptEnv _XXX_TEST 174 AcceptEnv _XXX_TEST
175 Subsystem sftp $SFTPSERVER
171 StrictModes no 176 StrictModes no
172EOF 177EOF
173 178