coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coreutils] testsuite failures on Fedora


From: Pádraig Brady
Subject: Re: [coreutils] testsuite failures on Fedora
Date: Sat, 18 Sep 2010 00:53:47 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 17/09/10 11:06, Pádraig Brady wrote:
> On 17/09/10 10:34, Jim Meyering wrote:
>>> FAIL: misc/stat-mount (exit: 1)
>>> ===============================
>> ...
>>> + stat_mnt=/shared/home
>>> + test /shared = /shared/home
>>> + fail=1
>> ...
>>> Here, the failure is that I have /home bind-mounted on /shared/home,
>>> and since I ran the test under /home, the mount location reported by
>>> df is different than the one reported by stat -c%m.  This is a new
>>> test, and I'm not sure what to do about the issue (whether stat needs
>>> fixing to deal with bind mounts, or whether the test is at fault).
>>
>> If there's a reliable mechanism to determine
>> that there is a potentially interfering bind mount,
>> I'd like to skip this test.
> 
> Oops, invalid test.
> I had forgotten I resolved the bind mount in that case also.
> I'll cook up a fix this evening to skip the test if the inodes match
> or something like that.

Note `stat -c%m` was outputting the bind mount (/shared/home) in this case,
while df was just outputting the original mount point for the device.

One could assume the difference is due to bind mounts if
the dev,inode were the same and pass in that case.
Alternatively, one could run `stat -c%m` in a loop to get
the base device mount point. However one could contrive a
situation (using bind mounts) where df is outputting
the original mount point for the device, while stat is
outputting the current different alias.
So in summary it's usually but not always valid
to compare the mount points from `df` and `stat`.
So I'll adjust the test as follows, to just
check that stat outputs something.

diff --git a/tests/misc/stat-mount b/tests/misc/stat-mount
index c1c43d4..063e3d2 100755
--- a/tests/misc/stat-mount
+++ b/tests/misc/stat-mount
@@ -18,14 +18,8 @@

 . "${srcdir=.}/init.sh"; path_prepend_ ../src

-# Note we assume that the current directory is not bind mounted
-# (as then, stat and df may have different results).
-# This should be the case given the directory is temporary
-# for the duration of the test.
+stat_mnt=$(stat -c%m .) || fail=1

-df_mnt=$(df -P . | sed -n '2s/.* \([^ ]*$\)/\1/p')
-stat_mnt=$(stat -c%m .)
-
-test "$df_mnt" = "$stat_mnt" || fail=1
+test "$stat_mnt" || fail=1

 Exit $fail




reply via email to

[Prev in Thread] Current Thread [Next in Thread]