GNU bug report logs - #13099
possible test bug in "tests/df/total-verify.sh"

Previous Next

Package: coreutils;

Reported by: Assaf Gordon <assafgordon <at> gmail.com>

Date: Thu, 6 Dec 2012 03:26:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: possible test bug in "tests/df/total-verify.sh"
Date: Wed, 05 Dec 2012 22:33:46 -0500
Hello,

(properly reporting a bug I mentioned in another email).

The test "df/total-verify.sh" fails on my system, due to a wrong(?) regex to verify the output of "df --total -i -P".

To make a long story short, my "df" produces the following line:
===
$ df --total -i -P
Filesystem                       Inodes   IUsed     IFree IUse% Mounted on
< snip >
//bluearctitan3/foobar                0       0         0     - /media/foobar
===

The filesystem is mounted with fuse/sshfs (not sure if that makes a difference).
The test error is:
===
check-df: invalid input line
: //bluearctitan3/foobar                0       0         0     - /media/foobar
===

The 'bug' is that "check-df" script (in 'total-verify.sh') assumes that there are two (2) spaces following the dash, whereas on my system there's only one space.

A possible fix (not sure about the side-effects, though);
====
diff --git a/tests/df/total-verify.sh b/tests/df/total-verify.sh
index 18d215f..c36a7a7 100755
--- a/tests/df/total-verify.sh
+++ b/tests/df/total-verify.sh
@@ -32,7 +32,7 @@ while (<>)
     # /dev/sdc1                  0       0       0    -  /c
     # tmpfs                1536000   12965 1523035    1% /tmp
     # total                5285932  787409 4498523   15% -
-    /^(.*?) +(-?\d+|-) +(-?\d+|-) +(-?\d+|-) +(?:- |[0-9]+%) (.*)$/
+    /^(.*?) +(-?\d+|-) +(-?\d+|-) +(-?\d+|-) +(?:-|[0-9]+%) +(.*)$/
       or die "$0: invalid input line\n: $_";
     if ($1 eq 'total' && $5 eq '-')
       {
====

Regards,
  -gordon




This bug report was last modified 12 years and 229 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.