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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Assaf Gordon <assafgordon <at> gmail.com>
Subject: bug#13099: closed (Re: bug#13099: possible test bug in
 "tests/df/total-verify.sh")
Date: Thu, 06 Dec 2012 10:13:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#13099: possible test bug in "tests/df/total-verify.sh"

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 13099 <at> debbugs.gnu.org.

-- 
13099: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13099
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: Assaf Gordon <assafgordon <at> gmail.com>, 13099-done <at> debbugs.gnu.org
Subject: Re: bug#13099: possible test bug in "tests/df/total-verify.sh"
Date: Thu, 06 Dec 2012 09:55:02 +0000
On 12/06/2012 09:22 AM, Bernhard Voelker wrote:
> On 12/06/2012 04:39 AM, Assaf Gordon wrote:
>> Correction:
>>
>> On 12/05/12 22:33, Assaf Gordon wrote:
>>> ===
>>> $ 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 filesystem is  mounted with CIFS, not sshfs.
>
> Thanks for reporting.
>
> Actually the culprit is not CIFS but the underlying (remote) file system,
> i.e. CIFS exposes the inode statistics of e.g. an ext4 file system
> properly, while it can not do the same for vfat.
>
> The bug was introduced with my implementation of "df --output" where
> the "total" line now also has a "-" in the target ("Mounted on") field.
> Well, it seems that none of us had a vfat file system mounted while
> running the tests yet.
>
> I wrapped your fix in the following patch.
>
> As there's no official coreutils release yet with that bug, I didn't
> add a NEWS entry.
>
> Have a nice day,
> Berny
>
>>From d597168b25d58dbd29cf04222608eef262a7d08a Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <mail <at> bernhard-voelker.de>
> Date: Thu, 6 Dec 2012 10:11:42 +0100
> Subject: [PATCH] tests: fix regex to match "-" in ipcent field in
>   df/total-verify.sh
>
> The regular expression failed to match for file systems that
> do not provide inode statistics, e.g. VFAT or CIFS (depending
> on the underlying peer file system).
>
> * tests/df/total-verify.sh: Fix the regular expression to match
> a dash in the ipcent field again.
>
> Reported by Assaf Gordon in http://bugs.gnu.org/13099.
> Bug introduced in commit v8.20-18-gdae8d22.
> ---
>   tests/df/total-verify.sh |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tests/df/total-verify.sh b/tests/df/total-verify.sh
> index 18d215f..5f375bb 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 '-')
>         {
>

That still passes here with a "standard" file system at least.
Please push.

I'm marking this issue as "done" now.

thanks,
Pádraig.

[Message part 3 (message/rfc822, inline)]
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 228 days ago.

Previous Next


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