summaryrefslogtreecommitdiff
path: root/tests/005-eta
diff options
context:
space:
mode:
Diffstat (limited to 'tests/005-eta')
-rw-r--r--tests/005-eta20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/005-eta b/tests/005-eta
new file mode 100644
index 0000000..0f0eb40
--- /dev/null
+++ b/tests/005-eta
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Check that the estimated time counter counts.
+
+dd if=/dev/zero bs=100 count=1 2>/dev/null \
+| $PROG -f -e -s 100 -i 0.1 -L 25 >/dev/null 2>$TMP1
+
+# Count the number of different ETA values there have been.
+#
+NUM=`tr '\r' '\n' < $TMP1 | tr -d ' ' | sed '/^$/d' | sort | uniq | wc -l | tr -d ' '`
+
+# 3 or less - not OK, since it should have taken 4 seconds.
+#
+test $NUM -gt 3 || exit 1
+
+# 8 or more - not OK, since even on a heavily loaded system that's too long.
+#
+test $NUM -lt 8
+
+# EOF