summaryrefslogtreecommitdiff
path: root/tests/dd/stats.sh
diff options
context:
space:
mode:
authorFederico Simoncelli <fsimonce@redhat.com>2014-09-26 17:12:32 +0000
committerPádraig Brady <P@draigBrady.com>2014-09-30 16:08:43 +0100
commitaf2a4ed22594badd2719c0123441d69b17bd8328 (patch)
tree7b27a3c86f8d6d75b4b8f6cead88e9b6f1378958 /tests/dd/stats.sh
parent27d2c7383f18d0f59b0d096f156ed6cb1677642b (diff)
downloadcoreutils-af2a4ed22594badd2719c0123441d69b17bd8328.tar.xz
dd: new status=progress level to print stats periodically
* src/dd.c: Report the transfer progress every second when the new status=progress level is used. Adjust the handling and description of the status= option so that they're treated as mutually exclusive levels, rather than flags with implicit precedence. * doc/coreutils.texi (dd invocation): Document the new progress status level. Reference the new level in the description of SIGUSR1. * tests/dd/stats.sh: Add new test for status=progress. * tests/dd/misc.sh: Change so status=none only takes precedence if it's the last level specified. * NEWS: Mention the feature.
Diffstat (limited to 'tests/dd/stats.sh')
-rwxr-xr-xtests/dd/stats.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/dd/stats.sh b/tests/dd/stats.sh
index 386752e77..24b8c496b 100755
--- a/tests/dd/stats.sh
+++ b/tests/dd/stats.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Check robust handling of SIG{INFO,USR1}
+# Check stats output for SIG{INFO,USR1} and status=progress
# Copyright (C) 2014 Free Software Foundation, Inc.
@@ -54,4 +54,12 @@ for open in '' '1'; do
grep '500000000 bytes .* copied' err || { cat err; fail=1; }
done
+progress_output()
+{
+ { sleep "$1"; echo 1; } | dd bs=1 status=progress of=/dev/null 2>err
+ # Progress output should be for "byte ... copied", while final is "bytes ..."
+ grep 'byte .* copied' err
+}
+retry_delay_ progress_output 1 4 || { cat err; fail=1; }
+
Exit $fail