]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: df/total-unprocessed: fix false failure with lofs
authorPádraig Brady <P@draigBrady.com>
Tue, 10 Dec 2013 16:29:11 +0000 (16:29 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 11 Dec 2013 14:15:33 +0000 (14:15 +0000)
* tests/df/total-unprocessed.sh: Skip the test when we can't
determine the file system type as the exclusion filter is not
applied in that case.  "lofs" being ignored is effectively
an unknown file system type.

tests/df/total-unprocessed.sh

index 24b83a9350fe1b63acbf8fdf188ec37af59c98cb..3bbfc6bfbc8bd52609867677b7524ea15dc0cbbc 100755 (executable)
@@ -25,11 +25,13 @@ cat <<\EOF > exp || framework_failure_
 df: no file systems processed
 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 -t _non_existent_fstype_ --total '.' 2>out && fail=1
-compare exp out || fail=1
+# Check we exit with non-Zero.
+# Note we don't check when the file system can't be determined
+# as -t filtering is not applied in that case.
+if test "$(df --output=fstype . | tail -n1)" != '-'; then
+  df -t _non_existent_fstype_ --total . 2>out && fail=1
+  compare exp out || fail=1
+fi
 
 cat <<\EOF > exp || framework_failure_
 df: '_does_not_exist_': No such file or directory