Some tests require that there's no certain mount option in
MKFS_OPTIONS, so introduce a new helper
_exclude_scratch_mount_option() to do the check on $MOUNT_OPTIONS.
Also convert generic/192 and xfs/134 to use this helper.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
_notrun "cloner binary not present at $CLONER_PROG"
}
+# skip test if MKFS_OPTIONS contains the given string
+_exclude_scratch_mount_option()
+{
+ if echo $MOUNT_OPTIONS | grep -q "$1"; then
+ _notrun "mount option \"$1\" not allowed in this test"
+ fi
+}
+
_require_atime()
{
+ _exclude_scratch_mount_option "noatime"
if [ "$FSTYP" == "nfs" ]; then
_notrun "atime related mount options have no effect on NFS"
fi
stat -c %X $1
}
-is_noatime_set() {
- case "$MOUNT_OPTIONS" in
- *noatime*) return 0;;
- esac
- return 1
-}
-
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
#delay=45
delay=40
-if is_noatime_set; then
- _notrun "this test makes no sense with noatime"
-fi
-
testfile=$TEST_DIR/testfile
rm -f $testfile
rm -f $seqres.full
_require_test
_require_xfs_quota
+# we can't run with group quotas
+_exclude_scratch_mount_option "gquota"
+_exclude_scratch_mount_option "grpquota"
dir=$SCRATCH_MNT/project
#if pquota's already in mount options then we dont need to enable
-# we can't run with group quotas
-if ( `echo $MOUNT_OPTIONS | grep -q gquota` || `echo $MOUNT_OPTIONS | grep -q grpquota` )
-then
- _notrun "Can't run with group quotas enabled"
-fi
EXTRA_MOUNT_OPTIONS="-o pquota"
if ! _scratch_mount "$EXTRA_MOUNT_OPTIONS" >$tmp.out 2>&1