blob: 218ac6b68e19a57556e8f3ea21ff3705e2fdd6b2 [file] [log] [blame]
Darren Tucker59d928d2013-05-17 15:32:29 +10001# $OpenBSD: stderr-after-eof.sh,v 1.2 2013/05/17 04:29:14 dtucker Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002# Placed in the Public Domain.
3
4tid="stderr data after eof"
5
Damien Miller38cd4352002-05-01 13:17:33 +10006# setup data
7rm -f ${DATA} ${COPY}
8cp /dev/null ${DATA}
9for i in 1 2 3 4 5 6; do
Darren Tuckerf8d5b342013-05-17 19:53:25 +100010 (date;echo $i) | md5 >> ${DATA}
Damien Miller38cd4352002-05-01 13:17:33 +100011done
12
13${SSH} -2 -F $OBJ/ssh_proxy otherhost \
14 exec sh -c \'"exec > /dev/null; sleep 2; cat ${DATA} 1>&2 $s"\' \
15 2> ${COPY}
16r=$?
17if [ $r -ne 0 ]; then
18 fail "ssh failed with exit code $r"
19fi
20egrep 'Disconnecting: Received extended_data after EOF' ${COPY} &&
21 fail "ext data received after eof"
22cmp ${DATA} ${COPY} || fail "stderr corrupt"
23
24rm -f ${DATA} ${COPY}