]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: readdir-mountpoint-inode avoid false-positive w/virtualbox
authorJim Meyering <meyering@redhat.com>
Sat, 5 Dec 2009 16:41:28 +0000 (17:41 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 6 Dec 2009 07:48:51 +0000 (08:48 +0100)
* tests/ls/readdir-mountpoint-inode: With some systems, stat can
succeed on a mount point and report that the inode number is 0.
Since ls displays "?" for those, that would otherwise show up as a
difference.  Skip such mount points.  Reported by Sergei Steshenko
in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/19142

tests/ls/readdir-mountpoint-inode

index c0214732aff890b8045c35b78337b5ba3eaf421e..979b579b0082cf3d62cafbc33461e6f2d7b17c6d 100755 (executable)
@@ -65,6 +65,8 @@ inode_via_readdir()
 for dir in $mount_points; do
   readdir_inode=$(inode_via_readdir $dir)
   stat_inode=$(env stat --format=%i $dir)
+  # If stat fails or says the inode is 0, skip $dir.
+  case $stat_inode in 0|'') continue;; esac
   test "$readdir_inode" = "$stat_inode" || fail=1
 done