_notrun "cloner binary not present at $CLONER_PROG"
}
-# skip test if MKFS_OPTIONS contains the given string
+# Normalize mount options from global $MOUNT_OPTIONS
+# Convert options like "-o opt1,opt2 -oopt3" to
+# "opt1 opt2 opt3"
+_normalize_mount_options()
+{
+ echo $MOUNT_OPTIONS | sed -n 's/-o\s*\(\S*\)/\1/gp'| sed 's/,/ /g'
+}
+
+# skip test if MOUNT_OPTIONS contains the given strings
_exclude_scratch_mount_option()
{
- if echo $MOUNT_OPTIONS | grep -q "$1"; then
- _notrun "mount option \"$1\" not allowed in this test"
- fi
+ local mnt_opts=$(_normalize_mount_options)
+
+ while [ $# -gt 0 ]; do
+ if echo $mnt_opts | grep -qw "$1"; then
+ _notrun "mount option \"$1\" not allowed in this test"
+ fi
+ shift
+ done
}
_require_atime()
_require_scratch
# this test needs no journal to be loaded, skip on journal related mount
# options, otherwise mount would fail with "-o noload" mount option
-_exclude_scratch_mount_option "data="
-_exclude_scratch_mount_option "commit="
-_exclude_scratch_mount_option "journal_checksum"
-_exclude_scratch_mount_option "journal_async_commit"
+_exclude_scratch_mount_option "data" "commit" "journal_checksum" \
+ "journal_async_commit"
rm -f $seqres.full
_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1
_require_test
_require_xfs_quota
# we can't run with group quotas
-_exclude_scratch_mount_option "gquota"
-_exclude_scratch_mount_option "grpquota"
+_exclude_scratch_mount_option "gquota" "grpquota"
dir=$SCRATCH_MNT/project