]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: exclude some tests when running on NFS
authorPádraig Brady <P@draigBrady.com>
Thu, 2 Sep 2010 12:22:41 +0000 (13:22 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 7 Sep 2010 09:49:55 +0000 (10:49 +0100)
All tests currently pass on NFS on Linux kernel 2.6.22 at least,
but some fail on 2.6.9, so we exclude those here.

* tests/init.cfg (is_local_dir_): A new function
returning if the specified directory is on a local file system.
(require_local_dir_): A new function to skip tests
if the current directory is not on a local file system.
* tests/cp/existing-perm-race: Skip if non local.
* tests/cp/file-perm-race: Likewise.
* tests/cp/parent-perm: Likewise.
* tests/cp/parent-perm-race: Likewise.
* tests/cp/preserve-2: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/du/basic: Use refactored function.
* tests/install/basic-1: Likewise.
* tests/mkdir/p-3: Likewise.
* tests/dd/skip-seek-past-dev: Likewise.
* tests/du/slink: Likewise.  Remove redundant test
for NFS file system.
* tests/misc/join: s/local/locale/.

13 files changed:
tests/cp/existing-perm-race
tests/cp/file-perm-race
tests/cp/parent-perm
tests/cp/parent-perm-race
tests/cp/preserve-2
tests/dd/skip-seek-past-dev
tests/du/basic
tests/du/slink
tests/init.cfg
tests/install/basic-1
tests/misc/join
tests/mkdir/p-3
tests/mv/part-symlink

index b6168f62e7bef3fb7ee6d8ed3ccd2c8bf159070f..ffd29f0f4ac2b012c94b27c78acff714cf4dc25d 100755 (executable)
@@ -22,8 +22,12 @@ if test "$VERBOSE" = yes; then
 fi
 
 . $srcdir/test-lib.sh
+
 require_membership_in_two_groups_
 
+# cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least
+require_local_dir_
+
 set _ $groups; shift
 g1=$1
 g2=$2
index ca47169c26cb5be387f1b89189007fd0f17c82a0..d807612595d488858ce699c3c1ad069276582784 100755 (executable)
@@ -23,6 +23,9 @@ fi
 
 . $srcdir/test-lib.sh
 
+# cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least
+require_local_dir_
+
 umask 022
 mkfifo fifo ||
   skip_test_ "fifos not supported"
index 4912694b9856d7719ebcb892d176ed45b12e7bbd..4a7d98947a38f99518906356973ac1358c990f0b 100755 (executable)
@@ -24,6 +24,8 @@ fi
 . $srcdir/test-lib.sh
 
 working_umask_or_skip_
+# cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least
+require_local_dir_
 
 mkdir -p a/b/c a/b/d e || framework_failure
 touch a/b/c/foo a/b/d/foo || framework_failure
index 546123836fe5b0f4e738a93954e1e3afe5b23ed5..e595d9ea8e81cc27214fe47dc87ccc06f778913d 100755 (executable)
@@ -23,6 +23,9 @@ fi
 
 . $srcdir/test-lib.sh
 
+# cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least
+require_local_dir_
+
 umask 002
 mkdir mode ownership d || framework_failure
 chmod g+s d 2>/dev/null # The cp test is valid either way.
index f65b4200fe2c5f39914dd5a2efb8d470cfbee6c0..9863952c2761d77dc22d1a07008c6af2b815733f 100755 (executable)
@@ -23,8 +23,10 @@ fi
 
 . $srcdir/test-lib.sh
 
-touch f || framework_failure
+# cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least
+require_local_dir_
 
+touch f || framework_failure
 
 cp --preserve=mode,links f g || fail=1
 
index c5b7aab3005ed8b3835cbb065029ba55f55da1f9..9e910e8ee99cf3a9046c10d2bc6114790c0102c6 100755 (executable)
@@ -23,9 +23,10 @@ fi
 
 . $srcdir/test-lib.sh
 
-# need write access to device
+# need write access to local device
 # (even though we don't actually write anything)
 require_root_
+require_local_dir_
 
 get_device_size() {
   BLOCKDEV=blockdev
@@ -36,8 +37,7 @@ get_device_size() {
 
 # Get path to device the current dir is on.
 # Note df can only get fs size, not device size.
-device=$(df -P --local . | tail -n1 | cut -d' ' -f1) ||
-  skip_test_ 'this test runs only on local file systems'
+device=$(df -P . | tail -n1 | cut -d' ' -f1) || framework_failure
 
 dev_size=$(get_device_size "$device") ||
   skip_test_ "failed to determine size of $device"
index 8b728537b2d137a6891d4936c83ba1c085d2e4d1..6d3eeb1e72dbb1d8f01fe634bb8a04b74c771c5f 100755 (executable)
@@ -63,7 +63,7 @@ compare out exp || fail=1
 
 # Perform this test only if "." is on a local file system.
 # Otherwise, it would fail e.g., on an NFS-mounted Solaris ZFS file system.
-if df --local . >/dev/null 2>&1; then
+if is_local_dir_ .; then
   rm -f out exp
   du --block-size=$B -a d | sort -r -k2,2 > out || fail=1
   echo === >> out
index 2bb3757144c9848cf123abbdf01a72c43235ec76..5c2b125c78894747934ebbe00293faa356de72fe 100755 (executable)
@@ -24,14 +24,9 @@ fi
 . $srcdir/test-lib.sh
 
 # Determine if `.' is on a local (would non-NFS be sufficient?) file system.
-# On at least some NFS implementations, symlinks never take up space,
-
-# So if this is a non-local file system, skip the test.
-if df --local . >/dev/null 2>&1; then
-  : # Ok.
-else
-  skip_test_ "\`.' is on a non-local file system"
-fi
+# At least on OSF/1 4.0d, when using an nfsv3 file system,
+# each created symlink can end up having a size of 0.
+require_local_dir_
 
 if df --type=xfs . >/dev/null 2>&1; then
   # At least on Irix-6.5.19, when using an xfs file system,
@@ -39,12 +34,6 @@ if df --type=xfs . >/dev/null 2>&1; then
   skip_test_ "\`.' is on an XFS file system"
 fi
 
-if df --type=nfsv3 . >/dev/null 2>&1; then
-  # At least on OSF/1 4.0d, when using an nfsv3 file system,
-  # each created symlink can end up having a size of 0.
-  skip_test_ "\`.' is on an NFS file system"
-fi
-
 symlink_name_lengths='1 15 16 31 32 59 60 63 64 127 128 255 256 511 512 1024'
 for len in $symlink_name_lengths; do
   name=`seq 1 $len|tr -c x y |head -c$len`
index 232cb9bae22bad1f6c62338b2486cb47347ed8fc..6c0ffd948e477d467df200565a9c6dbb0c751acd 100644 (file)
@@ -56,6 +56,18 @@ require_acl_()
     || skip_test_ "This test requires a local user named bin."
 }
 
+is_local_dir_()
+{
+  test $# = 1 || framework_failure
+  df --local "$1" >/dev/null 2>&1
+}
+
+require_local_dir_()
+{
+  is_local_dir_ . ||
+    skip_test_ "This test must be run on a local file system."
+}
+
 # Skip this test if we're not in SELinux "enforcing" mode.
 require_selinux_enforcing_()
 {
index 80c72d933599ab4813aa7eb5090de6befb5616ea..7ea103b28d0f01047399fe375788969a407548ba 100755 (executable)
@@ -105,7 +105,7 @@ test -d xx/rel && fail=1
 # inaccessible parent.  coreutils 5.97 fails this test.
 # Perform this test only if "." is on a local file system.
 # Otherwise, it would fail e.g., on an NFS-mounted file system.
-if df --local . >/dev/null 2>&1; then
+if is_local_dir_ .; then
   mkdir -p sub1/d || fail=1
   (cd sub1/d && chmod a-r . && chmod a-rx .. &&
    ginstall -d "$iwd/xx/zz" rel/a rel/b) || fail=1
index 0e34ba8676880986e1c5d76ce98f01c5428b330e..a319b943c103c2eeee2fc20cc270affcf80b60fa 100755 (executable)
@@ -135,7 +135,7 @@ my @tv = (
 
 # From Paul Eggert: fixed in 1.22n (this would fail on Solaris7,
 # with LC_ALL set to en_US).
-# Unfortunately, that Solaris7's en_US local folds case (making
+# Unfortunately, that Solaris7's en_US locale folds case (making
 # the first input file sorted) is not portable, so this test would
 # fail on e.g. Linux systems, because the input to join isn't sorted.
 # ['lc-collate', '', ["a 1a\nB 1B\n", "B 2B\n"], "B 1B 2B\n", 0],
index 6aa422ae49124b86bd5849f45f836e82ea1bf469..116c794be946e5b6aa4fb3c46495213e92c4bb33 100755 (executable)
@@ -42,7 +42,7 @@ test -d "$p/b/b" && test -d "$p/z" || fail=1
 # whose parent is inaccessible.  coreutils 5.97 fails this test.
 # Perform this test only if "." is on a local file system.
 # Otherwise, it would fail e.g., on an NFS-mounted file system.
-if df --local . >/dev/null 2>&1; then
+if is_local_dir_ .; then
   (cd no-acce3s/d && chmod a-r . && chmod a-rx .. &&
       mkdir -p a/b "$p/b/c" d/e && test -d a/b && test -d d/e) || fail=1
   test -d "$p/b/c" || fail=1
index 00c706b0e5a664e9b4c034e592c9c74d3d8df33c..3b8e442efc3177c6f6a665410f50c37ac21bca18 100755 (executable)
@@ -27,6 +27,10 @@ fi
 cleanup_() { rm -rf "$other_partition_tmpdir"; }
 . "$abs_srcdir/other-fs-tmpdir"
 
+# On NFS on Linux 2.6.9 at least we get:
+# mv: preserving permissions for `rem_sl': Operation not supported
+require_local_dir_
+
 pwd_tmp=`pwd`
 
 # Unset CDPATH.  Otherwise, output from the `cd dir' command