summaryrefslogtreecommitdiff
path: root/regress/stderr-data.sh
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-05-01 13:17:33 +1000
committerDamien Miller <djm@mindrot.org>2002-05-01 13:17:33 +1000
commit38cd4358921bd674cace17d6bae71143b716027d (patch)
tree6c5a048f13a0a413821bf75b8ad1346b7408447a /regress/stderr-data.sh
parent2f09289e741582871ff068f8697b924a257fb703 (diff)
- (djm) Import OpenBSD regression tests. Requires BSD make to run
Diffstat (limited to 'regress/stderr-data.sh')
-rw-r--r--regress/stderr-data.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/regress/stderr-data.sh b/regress/stderr-data.sh
new file mode 100644
index 000000000..0157690b0
--- /dev/null
+++ b/regress/stderr-data.sh
@@ -0,0 +1,33 @@
1# $OpenBSD: stderr-data.sh,v 1.2 2002/03/27 22:39:52 markus Exp $
2# Placed in the Public Domain.
3
4tid="stderr data transfer"
5
6DATA=/bin/ls
7COPY=${OBJ}/copy
8rm -f ${COPY}
9
10for n in '' -n; do
11for p in 1 2; do
12 verbose "test $tid: proto $p ($n)"
13 ${SSH} $n -$p -F $OBJ/ssh_proxy otherhost \
14 exec sh -c \'"exec > /dev/null; sleep 3; cat ${DATA} 1>&2 $s"\' \
15 2> ${COPY}
16 r=$?
17 if [ $r -ne 0 ]; then
18 fail "ssh failed with exit code $r"
19 fi
20 cmp ${DATA} ${COPY} || fail "stderr corrupt"
21 rm -f ${COPY}
22
23 ${SSH} $n -$p -F $OBJ/ssh_proxy otherhost \
24 exec sh -c \'"echo a; exec > /dev/null; sleep 3; cat ${DATA} 1>&2 $s"\' \
25 > /dev/null 2> ${COPY}
26 r=$?
27 if [ $r -ne 0 ]; then
28 fail "ssh failed with exit code $r"
29 fi
30 cmp ${DATA} ${COPY} || fail "stderr corrupt"
31 rm -f ${COPY}
32done
33done