copy: link rather than copy symlinks, when --link used
[platform/upstream/coreutils.git] / tests / init.cfg
index fa15aa4..0711455 100644 (file)
@@ -216,6 +216,13 @@ skip_if_()
 
 require_selinux_()
 {
+  # When in a chroot of an SELinux-enabled system, but with a mock-simulated
+  # SELinux-*disabled* system, recognize that SELinux is disabled system wide:
+  grep 'selinuxfs$' /proc/filesystems > /dev/null \
+    || skip_test_ "this system lacks SELinux support"
+
+  # Independent of whether SELinux is enabled system-wide,
+  # the current file system may lack SELinux support.
   case `ls -Zd .` in
     '? .'|'unlabeled .')
       skip_test_ "this system (or maybe just" \
@@ -295,11 +302,16 @@ require_proc_pid_status_()
     kill $pid
 }
 
-# Return nonzero if the specified directory is on a file system
-# for which FIEMAP support exists.
+# Return nonzero if the specified path is on a file system for
+# which FIEMAP support exists.  Note some file systems (like ext3 and btrfs)
+# only support FIEMAP for files, not directories.
 fiemap_capable_()
 {
-  df -T -t btrfs -t xfs -t ext4 -t ocfs2 "$@"
+  if ! python < /dev/null; then
+    warn_ 'fiemap_capable_: python missing: assuming not fiemap capable'
+    return 1
+  fi
+  python $abs_srcdir/fiemap-capable "$@"
 }
 
 # Does the current (working-dir) file system support sparse files?