# RMT_TAPE_DEV - the remote tape device for the xfsdump tests
# RMT_IRIXTAPE_DEV- the IRIX remote tape device for the xfsdump tests
# RMT_TAPE_USER - remote user for tape device
+# SELINUX_MOUNT_OPTIONS - Options to use when SELinux is enabled.
#
# - These can be added to $HOST_CONFIG_DIR (witch default to ./config)
# below or a separate local configuration file can be used (using
export RECREATE_TEST_DEV=false
-# $1 = prog to look for, $2* = default pathnames if not found in $PATH
+# $1 = prog to look for
set_prog_path()
{
- p=`which $1 2> /dev/null`
- if [ -n "$p" -a -x "$p" ]; then
- echo $p
- return 0
- fi
- p=$1
-
- shift
- for f; do
- if [ -x $f ]; then
- echo $f
- return 0
- fi
- done
-
- echo ""
- return 1
+ type -P $1
}
# Handle mkfs.btrfs which does (or does not) require -f to overwrite
esac
# SELinux adds extra xattrs which can mess up our expected output.
-# So, mount with a context, and they won't be created
-# # nfs_t is a "liberal" context so we can use it.
+# So, mount with a context, and they won't be created.
+#
+# Since the context= option only accepts contexts defined in the SELinux
+# policy, and different systems may have different policies with
+# different context names, use the context of an existing directory.
+# Assume that any valid context is fine, since xfstests should really
+# only be run from an "unconfined" process, or with SELinux in permissive
+# mode. But if not, just specify your own SELINUX_MOUNT_OPTIONS.
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
- SELINUX_MOUNT_OPTIONS="-o context=system_u:object_r:nfs_t:s0"
+ : ${SELINUX_MOUNT_OPTIONS:="-o context=$(stat -c %C /)"}
export SELINUX_MOUNT_OPTIONS
fi
ceph)
export MOUNT_OPTIONS=$CEPHFS_MOUNT_OPTIONS
;;
+ glusterfs)
+ export MOUNT_OPTIONS=$GLUSTERFS_MOUNT_OPTIONS
+ ;;
overlay)
export MOUNT_OPTIONS=$OVERLAY_MOUNT_OPTIONS
;;
ceph)
export TEST_FS_MOUNT_OPTS=$CEPHFS_MOUNT_OPTIONS
;;
+ nfs)
+ export TEST_FS_MOUNT_OPTS=$NFS_MOUNT_OPTIONS
+ ;;
+ glusterfs)
+ export TEST_FS_MOUNT_OPTS=$GLUSTERFS_MOUNT_OPTIONS
+ ;;
*)
;;
esac