summaryrefslogtreecommitdiff
path: root/tests/df
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-11-09 01:11:18 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-11-09 01:11:45 -0800
commita395b637a62a380f2d11e12f8c9e0eceb9e86a8f (patch)
tree3a37024dc8854a113bdde9ce09411439030e9511 /tests/df
parente73bb23f4f1165c3fd387308e7f76684fabc8c0e (diff)
downloadcoreutils-a395b637a62a380f2d11e12f8c9e0eceb9e86a8f.tar.xz
df: port the new df test to POSIX sed, larger file systems
* tests/df/df-output.sh: For the test "df -B1K --output=size", do not assume that the file system size fits in 9 bytes; it might be larger than that, so omit leading space. Also, use portable 'sed' commands: POSIX says sed commands inside { } should all end in newline.
Diffstat (limited to 'tests/df')
-rw-r--r--tests/df/df-output.sh27
1 files changed, 22 insertions, 5 deletions
diff --git a/tests/df/df-output.sh b/tests/df/df-output.sh
index 0b40b2842..f58633489 100644
--- a/tests/df/df-output.sh
+++ b/tests/df/df-output.sh
@@ -72,11 +72,17 @@ EOF
df -h --o=source,fstype,size,used,avail,pcent \
--o=itotal,iused,iavail,ipcent,target '.' >out || fail=1
-sed -e '1 {s/ [ ]*/ /g;q}' out > out2
+sed -e '1 {
+ s/ [ ]*/ /g
+ q
+ }' out > out2
compare exp out2 || fail=1
df -h --output '.' >out || fail=1
-sed -e '1 {s/ [ ]*/ /g;q}' out > out2
+sed -e '1 {
+ s/ [ ]*/ /g
+ q
+ }' out > out2
compare exp out2 || fail=1
# Ensure that --output indicates the block size
@@ -86,7 +92,11 @@ cat <<\EOF > exp || framework_failure_
EOF
df -B1K --output=size '.' >out || fail=1
-sed -e '1 {s/ [ ]*/ /g;q}' out > out2
+sed -e '1 {
+ s/ [ ]*/ /g
+ s/^ //
+ q
+ }' out > out2
compare exp out2 || fail=1
# Ensure that the grand total line now contains a "-" in the TARGET field ...
@@ -95,7 +105,11 @@ cat <<\EOF > exp || framework_failure_
EOF
df --output=source,target --total '.' >out || fail=1
-sed -n -e '3 {s/^total[ ]*//;p;q}' out > out2
+sed -n -e '3 {
+ s/^total[ ]*//
+ p
+ q
+ }' out > out2
compare exp out2 || fail=1
# ... but it should read "total" if there is no SOURCE field.
@@ -104,7 +118,10 @@ total
EOF
df --output=target --total '.' >out || fail=1
-sed -n -e '3 {p;q}' out > out2
+sed -n -e '3 {
+ p
+ q
+ }' out > out2
compare exp out2 || fail=1
# Ensure that --output is mentioned in the usage.