summaryrefslogtreecommitdiff
path: root/tests/011-cksum
diff options
context:
space:
mode:
Diffstat (limited to 'tests/011-cksum')
-rw-r--r--tests/011-cksum26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/011-cksum b/tests/011-cksum
new file mode 100644
index 0000000..beb8443
--- /dev/null
+++ b/tests/011-cksum
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Transfer a large chunk of data through pv and check data correctness
+# afterwards.
+
+rm -f $TMP1 $TMP2 2>/dev/null
+
+# exit on non-zero return codes
+set -e
+
+# generate some data
+dd if=/dev/urandom of=$TMP1 bs=1024 count=10240 2>/dev/null
+
+CKSUM1=`cksum $TMP1 | awk '{print $1}'`
+
+# read through pv and test afterwards
+$PROG -B 100000 -q $TMP1 > $TMP2
+
+CKSUM2=`cksum $TMP2 | awk '{print $1}'`
+
+test "x$CKSUM1" = "x$CKSUM2"
+
+# clean up
+rm -f $TMP1 $TMP2 2>/dev/null
+
+# EOF