bug#20631: 'df/df-output ' test fails due to extra space in header line on large disk

2015-05-22 Thread Pádraig Brady
On 22/05/15 19:15, Assaf Gordon wrote:
> Hello,
> 
> Using the latest coreutils from git, 'tests/df/df-output' fails due to one 
> extra space in the header line, needed to accommodate a large disk.
> 
> Log attached, but the problem is likely this:
> 
>  # This is a large disk...
>  $ ./src/df -hl .
>  Filesystem  Size  Used Avail Use% Mounted on
>  /dev/sdb133T  2.0T   31T   6% /data2
> 
>  # The test command results in two spaces before the header
>  $ ./src/df -B1K --output=size .
>1K-blocks
>  35139364864

Pushed.

thanks!
Pádraig






bug#20631: 'df/df-output ' test fails due to extra space in header line on large disk

2015-05-22 Thread Assaf Gordon

Hello,

Using the latest coreutils from git, 'tests/df/df-output' fails due to one 
extra space in the header line, needed to accommodate a large disk.

Log attached, but the problem is likely this:

# This is a large disk...
$ ./src/df -hl .
Filesystem  Size  Used Avail Use% Mounted on
/dev/sdb133T  2.0T   31T   6% /data2

# The test command results in two spaces before the header
$ ./src/df -B1K --output=size .
  1K-blocks
35139364864

possible fix attached.

-assaf


>From 027c96eb977241d9c795fee510b51dd7b3013bd1 Mon Sep 17 00:00:00 2001
From: Assaf Gordon 
Date: Fri, 22 May 2015 14:09:27 -0400
Subject: [PATCH] tests: df-output: accept multiple spaces in header

* tests/df/df-output.sh: allow for multiple spaces in the header line of
'df', resulting from large disks.
---
 tests/df/df-output.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/df/df-output.sh b/tests/df/df-output.sh
index f469d41..d81f0ee 100755
--- a/tests/df/df-output.sh
+++ b/tests/df/df-output.sh
@@ -93,7 +93,7 @@ EOF
 
 df -B1K --output=size '.' >out || fail=1
 sed -e '1 {
-  s/ //
+  s/ *//
   q
 }' out > out2
 compare exp out2 || fail=1
-- 
1.9.1

==
   GNU coreutils 8.23.197-edc5b: ./tests/test-suite.log
==

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: tests/df/df-output


++ initial_cwd_=/data2/agordon/sources/coreutils
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /data2/agordon/sources/coreutils gt-df-output.sh.
+++ case $# in
+++ destdir_=/data2/agordon/sources/coreutils
+++ template_=gt-df-output.sh.
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
 unset TMPDIR
+++ d=/data2/agordon/sources/coreutils/gt-df-output.sh.Jwz9
+++ case $d in
+++ test -d /data2/agordon/sources/coreutils/gt-df-output.sh.Jwz9
 ls -dgo /data2/agordon/sources/coreutils/gt-df-output.sh.Jwz9
 tr S -
+++ perms='drwx-- 2 10 May 22 14:07 /data2/agordon/sources/coreutils/gt-df-output.sh.Jwz9'
+++ case $perms in
+++ test 0 = 0
+++ echo /data2/agordon/sources/coreutils/gt-df-output.sh.Jwz9
+++ return
++ test_dir_=/data2/agordon/sources/coreutils/gt-df-output.sh.Jwz9
++ cd /data2/agordon/sources/coreutils/gt-df-output.sh.Jwz9
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/data2/agordon/sources/coreutils/./src
+ case $abs_path_dir_ in
+ PATH=/data2/agordon/sources/coreutils/./src:/data2/agordon/sources/coreutils/src:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
+ create_exe_shims_ /data2/agordon/sources/coreutils/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ df
+ test yes = yes
+ local i
+ for i in '$*'
+ env df --version
df (GNU coreutils) 8.23.197-edc5b
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjorn Granlund, David MacKenzie, and Paul Eggert.
+ cat
+ df -i --output .
+ sed 's/ -i / OPT /' out
+ compare exp out2
+ compare_dev_null_ exp out2
+ test 2 = 2
+ test xexp = x/dev/null
+ test xout2 = x/dev/null
+ return 2
+ case $? in
+ compare_ exp out2
+ diff -u exp out2
+ df --output -i .
+ sed 's/ -i / OPT /' out
+ compare exp out2
+ compare_dev_null_ exp out2
+ test 2 = 2
+ test xexp = x/dev/null
+ test xout2 = x/dev/null
+ return 2
+ case $? in
+ compare_ exp out2
+ diff -u exp out2
+ df -P --output .
+ sed 's/ -P / OPT /' out
+ compare exp out2
+ compare_dev_null_ exp out2
+ test 2 = 2
+ test xexp = x/dev/null
+ test xout2 = x/dev/null
+ return 2
+ case $? in
+ compare_ exp out2
+ diff -u exp out2
+ df --output -P .
+ sed 's/ -P / OPT /' out
+ compare exp out2
+ compare_dev_null_ exp out2
+ test 2 = 2
+ test xexp = x/dev/null
+ test xout2 = x/dev/null
+ return 2
+ case $? in
+ compare_ exp out2
+ diff -u exp out2
+ df -T --output .
+ sed 's/ -T / OPT /' out
+ compare exp out2
+ compare_dev_null_ exp out2
+ test 2 = 2
+ test xexp = x/dev/null
+ test xout2 = x/dev/null
+ return 2
+ case $? in
+ compare_ exp out2