On 07/01/2014 06:02 PM, Pádraig Brady wrote:
> On 06/27/2014 08:36 AM, Jim Grisham wrote:
>> Test log file attached.
>>
>> $ uname -a
>> Darwin NFM-iMac.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 
>> 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
>>
>> ============================================================================
>> Testsuite summary for GNU coreutils 8.22
>> ============================================================================
>> # TOTAL: 551
>> # PASS:  398
>> # SKIP:  150
>> # XFAIL: 0
>> # FAIL:  1
>> # XPASS: 0
>> # ERROR: 2
>> ============================================================================
>>
> 
> Thanks a lot for the feed back
> 
> The 2 errors could probably be cleaned up with something like:
> I'll look into the FAIL later.

The false FAIL should be fixed with the attached.

thanks,
Pádraig.

>From 93ecbd1f92befef3cc8c8f5c582ff463e168045a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Wed, 2 Jul 2014 14:39:04 +0100
Subject: [PATCH] tests: avoid false failure with spaces in mount point paths

* tests/ls/readdir-mountpoint-inode.sh: Quote appropriately
to process mount points with spaces in the path.
Previously items like these would usually be skipped,
though if the path also contained a '-' for example,
that would stat stdin, thus producing a wrong inode
and a false failure.
---
 tests/ls/readdir-mountpoint-inode.sh |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/ls/readdir-mountpoint-inode.sh b/tests/ls/readdir-mountpoint-inode.sh
index dabd661..b8691ea 100755
--- a/tests/ls/readdir-mountpoint-inode.sh
+++ b/tests/ls/readdir-mountpoint-inode.sh
@@ -21,8 +21,8 @@ print_ver_ ls
 
 # We use --local here so as to not activate
 # potentially very many remote mounts.
-mount_points=$(df --local -P 2>&1 | sed -n 's,.*[0-9]% \(/.\),\1,p')
-test -z "$mount_points" &&
+df --local -P 2>&1 | sed -n 's,.*[0-9]% \(/.\),\1,p' > mount_points
+test -s mount_points ||
    skip_ "this test requires a non-root mount point"
 
 # Given e.g., /dev/shm, produce the list of GNU ls options that
@@ -48,23 +48,23 @@ ls_ignore_options()
 inode_via_readdir()
 {
   mount_point=$1
-  base=$(basename $mount_point)
-  case $base in
+  base=$(basename "$mount_point")
+  case "$base" in
     .*) skip_ 'mount point component starts with "."' ;;
     *[*?]*) skip_ 'mount point component contains "?" or "*"' ;;
   esac
   opts=$(ls_ignore_options "$base")
-  parent_dir=$(dirname $mount_point)
-  eval "ls -i $opts $parent_dir" | sed 's/ .*//'
+  parent_dir=$(dirname "$mount_point")
+  eval "ls -i $opts '$parent_dir'" | sed 's/ .*//'
 }
 
-for dir in $mount_points; do
-  readdir_inode=$(inode_via_readdir $dir)
+while read dir; do
+  readdir_inode=$(inode_via_readdir "$dir")
   test $? = 77 && continue
-  stat_inode=$(timeout 1 stat --format=%i $dir)
+  stat_inode=$(timeout 1 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
+done < mount_points
 
 Exit $fail
-- 
1.7.7.6

Reply via email to