bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: be robust to ignored SIGPIPE


From: Eric Blake
Subject: [PATCH] tests: be robust to ignored SIGPIPE
Date: Tue, 20 Apr 2010 09:44:21 -0600

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 <address@hidden>
---
 ChangeLog               |    7 +++++++
 tests/test-lseek.sh     |    3 ++-
 tests/test-select-in.sh |    3 ++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1cbf33d..e1e4c5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-20  Eric Blake  <address@hidden>
+
+       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-02-17  Eric Blake  <address@hidden>

        manywarnings: add more warnings
diff --git a/tests/test-lseek.sh b/tests/test-lseek.sh
index e84c2bb..576008c 100755
--- a/tests/test-lseek.sh
+++ b/tests/test-lseek.sh
@@ -8,7 +8,8 @@ tmpfiles=t-lseek.tmp
 ./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
diff --git a/tests/test-select-in.sh b/tests/test-select-in.sh
index 13f6bbb..44f5dbb 100755
--- a/tests/test-select-in.sh
+++ b/tests/test-select-in.sh
@@ -18,7 +18,8 @@ test `cat t-select-in.tmp` = "1" || 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
-- 
1.6.6.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]