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>
+2010-04-20 Eric Blake <eblake@redhat.com>
+
+ tests: be robust to ignored SIGPIPE
+ * tests/test-select-in.sh: Consume all output.
+ * tests/test-lseek.sh: Check correct exit status, while avoiding
+ EPIPE.
+
2010-04-20 Simon Josefsson <simon@josefsson.org>
Bruno Haible <bruno@clisp.org>
./test-lseek${EXEEXT} 0 < "$srcdir/test-lseek.sh" > t-lseek.tmp || exit 1
# pipes
-echo hi | ./test-lseek${EXEEXT} 1 | cat || exit 1
+: | { ./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
# Pipes.
rm -f t-select-in.tmp
-{ sleep 1; echo abc; } | ./test-select-fd${EXEEXT} r 0 t-select-in.tmp
+{ sleep 1; echo abc; } | \
+ { ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; }
test `cat t-select-in.tmp` = "0" || exit 1
rm -f t-select-in.tmp