]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - crypto/openssh/regress/stderr-data.sh
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / crypto / openssh / regress / stderr-data.sh
1 #       $OpenBSD: stderr-data.sh,v 1.3 2013/05/17 04:29:14 dtucker Exp $
2 #       Placed in the Public Domain.
3
4 tid="stderr data transfer"
5
6 for n in '' -n; do
7 for p in 1 2; do
8         verbose "test $tid: proto $p ($n)"
9         ${SSH} $n -$p -F $OBJ/ssh_proxy otherhost \
10                 exec sh -c \'"exec > /dev/null; sleep 3; cat ${DATA} 1>&2 $s"\' \
11                 2> ${COPY}
12         r=$?
13         if [ $r -ne 0 ]; then
14                 fail "ssh failed with exit code $r"
15         fi
16         cmp ${DATA} ${COPY}     || fail "stderr corrupt"
17         rm -f ${COPY}
18
19         ${SSH} $n -$p -F $OBJ/ssh_proxy otherhost \
20                 exec sh -c \'"echo a; exec > /dev/null; sleep 3; cat ${DATA} 1>&2 $s"\' \
21                 > /dev/null 2> ${COPY}
22         r=$?
23         if [ $r -ne 0 ]; then
24                 fail "ssh failed with exit code $r"
25         fi
26         cmp ${DATA} ${COPY}     || fail "stderr corrupt"
27         rm -f ${COPY}
28 done
29 done