summaryrefslogtreecommitdiff
path: root/regress/forwarding.sh
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2019-10-09 22:59:48 +0100
committerColin Watson <cjwatson@debian.org>2019-10-09 23:39:39 +0100
commit767ee84d3465b6d244a9108de5c167a9ab866df9 (patch)
tree69b14ef6a62d7f133298a21d2ad6046f130b7801 /regress/forwarding.sh
parentddeaf9ee7d5c6612b88f1c4a83fc6fbccb93bf60 (diff)
parentefef12825b9582c1710da3b7e50135870963d4f4 (diff)
New upstream release (8.1p1)
Diffstat (limited to 'regress/forwarding.sh')
-rw-r--r--regress/forwarding.sh38
1 files changed, 19 insertions, 19 deletions
diff --git a/regress/forwarding.sh b/regress/forwarding.sh
index 7d0fae114..cd634f2f6 100644
--- a/regress/forwarding.sh
+++ b/regress/forwarding.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: forwarding.sh,v 1.20 2017/04/30 23:34:55 djm Exp $ 1# $OpenBSD: forwarding.sh,v 1.23 2019/07/20 09:50:58 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="local and remote forwarding" 4tid="local and remote forwarding"
@@ -26,7 +26,7 @@ done
26 26
27trace "start forwarding, fork to background" 27trace "start forwarding, fork to background"
28rm -f $CTL 28rm -f $CTL
29${SSH} -S $CTL -M -F $OBJ/ssh_config -f $fwd somehost sleep 10 29${SSH} -S $CTL -N -M -F $OBJ/ssh_config -f $fwd somehost
30 30
31trace "transfer over forwarded channels and check result" 31trace "transfer over forwarded channels and check result"
32${SSH} -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ 32${SSH} -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \
@@ -34,7 +34,7 @@ ${SSH} -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \
34test -s ${COPY} || fail "failed copy of ${DATA}" 34test -s ${COPY} || fail "failed copy of ${DATA}"
35cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" 35cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}"
36 36
37${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 37${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null
38 38
39for d in L R; do 39for d in L R; do
40 trace "exit on -$d forward failure" 40 trace "exit on -$d forward failure"
@@ -69,8 +69,8 @@ ${SSH} -F $OBJ/ssh_config -oClearAllForwardings=yes somehost true
69 69
70trace "clear local forward" 70trace "clear local forward"
71rm -f $CTL 71rm -f $CTL
72${SSH} -S $CTL -M -f -F $OBJ/ssh_config -L ${base}01:127.0.0.1:$PORT \ 72${SSH} -S $CTL -N -M -f -F $OBJ/ssh_config -L ${base}01:127.0.0.1:$PORT \
73 -oClearAllForwardings=yes somehost sleep 10 73 -oClearAllForwardings=yes somehost
74if [ $? != 0 ]; then 74if [ $? != 0 ]; then
75 fail "connection failed with cleared local forwarding" 75 fail "connection failed with cleared local forwarding"
76else 76else
@@ -79,12 +79,12 @@ else
79 >>$TEST_REGRESS_LOGFILE 2>&1 && \ 79 >>$TEST_REGRESS_LOGFILE 2>&1 && \
80 fail "local forwarding not cleared" 80 fail "local forwarding not cleared"
81fi 81fi
82${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 82${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null
83 83
84trace "clear remote forward" 84trace "clear remote forward"
85rm -f $CTL 85rm -f $CTL
86${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R ${base}01:127.0.0.1:$PORT \ 86${SSH} -S $CTL -N -M -f -F $OBJ/ssh_config -R ${base}01:127.0.0.1:$PORT \
87 -oClearAllForwardings=yes somehost sleep 10 87 -oClearAllForwardings=yes somehost
88if [ $? != 0 ]; then 88if [ $? != 0 ]; then
89 fail "connection failed with cleared remote forwarding" 89 fail "connection failed with cleared remote forwarding"
90else 90else
@@ -93,7 +93,7 @@ else
93 >>$TEST_REGRESS_LOGFILE 2>&1 && \ 93 >>$TEST_REGRESS_LOGFILE 2>&1 && \
94 fail "remote forwarding not cleared" 94 fail "remote forwarding not cleared"
95fi 95fi
96${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 96${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null
97 97
98trace "stdio forwarding" 98trace "stdio forwarding"
99cmd="${SSH} -F $OBJ/ssh_config" 99cmd="${SSH} -F $OBJ/ssh_config"
@@ -107,7 +107,7 @@ echo "RemoteForward ${base}02 127.0.0.1:${base}01" >> $OBJ/ssh_config
107 107
108trace "config file: start forwarding, fork to background" 108trace "config file: start forwarding, fork to background"
109rm -f $CTL 109rm -f $CTL
110${SSH} -S $CTL -M -F $OBJ/ssh_config -f somehost sleep 10 110${SSH} -S $CTL -N -M -F $OBJ/ssh_config -f somehost
111 111
112trace "config file: transfer over forwarded channels and check result" 112trace "config file: transfer over forwarded channels and check result"
113${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \ 113${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \
@@ -115,22 +115,22 @@ ${SSH} -F $OBJ/ssh_config -p${base}02 -o 'ConnectionAttempts=4' \
115test -s ${COPY} || fail "failed copy of ${DATA}" 115test -s ${COPY} || fail "failed copy of ${DATA}"
116cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" 116cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}"
117 117
118${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 118${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null
119 119
120trace "transfer over chained unix domain socket forwards and check result" 120trace "transfer over chained unix domain socket forwards and check result"
121rm -f $OBJ/unix-[123].fwd 121rm -f $OBJ/unix-[123].fwd
122rm -f $CTL $CTL.[123] 122rm -f $CTL $CTL.[123]
123${SSH} -S $CTL -M -f -F $OBJ/ssh_config -R${base}01:[$OBJ/unix-1.fwd] somehost sleep 10 123${SSH} -S $CTL -N -M -f -F $OBJ/ssh_config -R${base}01:[$OBJ/unix-1.fwd] somehost
124${SSH} -S $CTL.1 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-1.fwd]:[$OBJ/unix-2.fwd] somehost sleep 10 124${SSH} -S $CTL.1 -N -M -f -F $OBJ/ssh_config -L[$OBJ/unix-1.fwd]:[$OBJ/unix-2.fwd] somehost
125${SSH} -S $CTL.2 -M -f -F $OBJ/ssh_config -R[$OBJ/unix-2.fwd]:[$OBJ/unix-3.fwd] somehost sleep 10 125${SSH} -S $CTL.2 -N -M -f -F $OBJ/ssh_config -R[$OBJ/unix-2.fwd]:[$OBJ/unix-3.fwd] somehost
126${SSH} -S $CTL.3 -M -f -F $OBJ/ssh_config -L[$OBJ/unix-3.fwd]:127.0.0.1:$PORT somehost sleep 10 126${SSH} -S $CTL.3 -N -M -f -F $OBJ/ssh_config -L[$OBJ/unix-3.fwd]:127.0.0.1:$PORT somehost
127${SSH} -F $OBJ/ssh_config -p${base}01 -o 'ConnectionAttempts=4' \ 127${SSH} -F $OBJ/ssh_config -p${base}01 -o 'ConnectionAttempts=4' \
128 somehost cat ${DATA} > ${COPY} 128 somehost cat ${DATA} > ${COPY}
129test -s ${COPY} || fail "failed copy ${DATA}" 129test -s ${COPY} || fail "failed copy ${DATA}"
130cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" 130cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}"
131 131
132${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 132${SSH} -F $OBJ/ssh_config -S $CTL -O exit somehost 2>/dev/null
133${SSH} -F $OBJ/ssh_config -S $CTL.1 -O exit somehost 133${SSH} -F $OBJ/ssh_config -S $CTL.1 -O exit somehost 2>/dev/null
134${SSH} -F $OBJ/ssh_config -S $CTL.2 -O exit somehost 134${SSH} -F $OBJ/ssh_config -S $CTL.2 -O exit somehost 2>/dev/null
135${SSH} -F $OBJ/ssh_config -S $CTL.3 -O exit somehost 135${SSH} -F $OBJ/ssh_config -S $CTL.3 -O exit somehost 2>/dev/null
136 136