summaryrefslogtreecommitdiff
path: root/regress/multiplex.sh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-06-16 20:22:22 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-06-16 20:22:22 +1000
commite7d0583f36d060d199c44cbd16b367b0b9907333 (patch)
tree04070c413e33cb7ae0e555dcb4995943c44866bb /regress/multiplex.sh
parent50433a924344b295cd34ecdbba0c6b8f6add9231 (diff)
- djm@cvs.openbsd.org 2004/06/13 15:04:08
[regress/Makefile regress/test-exec.sh, added regress/multiplex.sh] regress test for client multiplexing; ok markus@
Diffstat (limited to 'regress/multiplex.sh')
-rw-r--r--regress/multiplex.sh55
1 files changed, 55 insertions, 0 deletions
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