view tests/test-lseek.sh @ 13251:700012efeb01

tests: be robust to ignored SIGPIPE Noticed during a libvirt test run with trap '' SIGPIPE. * tests/test-select-in.sh: Consume all output. * tests/test-lseek.sh: Check correct exit status, while avoiding EPIPE. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Tue, 20 Apr 2010 09:34:04 -0600
parents 30d389dd4713
children 175d7ed26b82
line wrap: on
line source

#!/bin/sh

tmpfiles=
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles=t-lseek.tmp
# seekable files
./test-lseek${EXEEXT} 0 < "$srcdir/test-lseek.sh" > t-lseek.tmp || exit 1

# pipes
: | { ./test-lseek${EXEEXT} 1; echo $? > t-lseek.tmp; } | :
test "x`cat t-lseek.tmp`" = x0 || exit 1

# closed descriptors
./test-lseek${EXEEXT} 2 <&- >&- || exit 1

rm -rf $tmpfiles
exit 0