summaryrefslogtreecommitdiff
path: root/tests/010-pipe
diff options
context:
space:
mode:
Diffstat (limited to 'tests/010-pipe')
-rw-r--r--tests/010-pipe26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/010-pipe b/tests/010-pipe
new file mode 100644
index 0000000..8e569dd
--- /dev/null
+++ b/tests/010-pipe
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Check that there is no SIGPIPE or dropped data on bigger data transfers.
+
+# We nead GNU head. On some platforms it is named ghead instead of head.
+HEAD=head
+for p in `echo $PATH | tr ':' '\n'`
+do
+ if test -x $p/ghead
+ then
+ HEAD=$p/ghead
+ break
+ fi
+done
+
+# Don't use dd. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=324308
+COUNT1=100000000
+#COUNT2=`$PROG -B 100000 -q /dev/zero | $HEAD -c $COUNT1 | wc -c | tr -d ' '`
+# Remove \n to fix the test on AIX
+COUNT2=`$PROG -B 100000 -q /dev/zero | $HEAD -c $COUNT1 | tr -d '\n' | wc -c | tr -d ' '`
+
+#echo "[$COUNT1] [$COUNT2]"
+
+test "x$COUNT1" = "x$COUNT2"
+
+# EOF