]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix validation of local file systems
authorPádraig Brady <P@draigBrady.com>
Wed, 8 Aug 2012 15:38:38 +0000 (16:38 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 8 Aug 2012 16:46:58 +0000 (17:46 +0100)
* tests/init.cfg (require_mount_list_): A new function
to ensure we can read the list of file systems.
(require_local_dir_): Call the above function, as otherwise
the check is invalid.
* tests/df/total-unprocessed: Ensure df can read the
list of mounted file systems so that --local can be honored.

tests/df/total-unprocessed
tests/init.cfg

index 9742591f7b50c910acbad86571d1f00e60763ae2..aa4983683d9b007507b2c7940490185166924e17 100755 (executable)
@@ -19,6 +19,7 @@
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ df
+require_mount_list_
 
 cat <<\EOF > exp || framework_failure_
 df: no file systems processed
@@ -27,7 +28,7 @@ EOF
 # The following simply finds no match for the combination
 # of the options --local and FS-type nfs together with the
 # argument ".". It must exit non-Zero nonetheless.
-df --local -t nfs --total "." 2>out && fail=1
+df --local -t nfs --total '.' 2>out && fail=1
 compare exp out || fail=1
 
 cat <<\EOF > exp || framework_failure_
index 506c9b3295cb68207efe671a6b624a6591e842d2..4ff5ad4d542061383c4874a4024e92850d9269f4 100644 (file)
@@ -77,8 +77,16 @@ is_local_dir_()
   df --local "$1" >/dev/null 2>&1
 }
 
+require_mount_list_()
+{
+  local mount_list_fail='cannot read table of mounted file systems'
+  df 2>&1 | grep -F "$mount_list_fail" >/dev/null &&
+    skip_ "$mount_list_fail"
+}
+
 require_local_dir_()
 {
+  require_mount_list_
   is_local_dir_ . ||
     skip_ "This test must be run on a local file system."
 }