public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: fstests@vger.kernel.org
Cc: jack@suse.cz, Eryu Guan <eguan@redhat.com>
Subject: [PATCH v2 1/2] fstests: introduce _require_no_mount_opts helper
Date: Tue, 21 Jun 2016 18:40:28 +0800	[thread overview]
Message-ID: <1466505629-9402-1-git-send-email-eguan@redhat.com> (raw)

Some tests require that there's no certain mount option, so
introduce a new helper _require_no_mount_opts() to do the check on
$MOUNT_OPTIONS.

Also convert generic/192 and xfs/134 to use this helper.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
v2:
- rebase on top of current master

 common/rc         |  8 ++++++++
 tests/generic/192 | 11 -----------
 tests/xfs/134     |  8 +++-----
 3 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/common/rc b/common/rc
index 3a9c4d1..680ea2b 100644
--- a/common/rc
+++ b/common/rc
@@ -2926,8 +2926,16 @@ _require_cloner()
 		_notrun "cloner binary not present at $CLONER_PROG"
 }
 
+_require_no_mount_opts()
+{
+	if echo $MOUNT_OPTIONS | grep -q "$1"; then
+		_notrun "mount option \"$1\" not allowed in this test"
+	fi
+}
+
 _require_atime()
 {
+	_require_no_mount_opts "noatime"
 	if [ "$FSTYP" == "nfs" ]; then
 		_notrun "atime related mount options have no effect on NFS"
 	fi
diff --git a/tests/generic/192 b/tests/generic/192
index 6bbc87c..d3ed0ec 100755
--- a/tests/generic/192
+++ b/tests/generic/192
@@ -38,13 +38,6 @@ _access_time()
 	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
@@ -61,10 +54,6 @@ _require_atime
 #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
diff --git a/tests/xfs/134 b/tests/xfs/134
index cd47069..a7df9fe 100755
--- a/tests/xfs/134
+++ b/tests/xfs/134
@@ -50,6 +50,9 @@ _supported_os Linux IRIX
 
 _require_test
 _require_xfs_quota
+# we can't run with group quotas
+_require_no_mount_opts "gquota"
+_require_no_mount_opts "grpquota"
 
 dir=$SCRATCH_MNT/project
 
@@ -70,11 +73,6 @@ _scratch_mkfs_xfs >/dev/null 2>&1
 
 #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
-- 
2.5.5


             reply	other threads:[~2016-06-21 10:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21 10:40 Eryu Guan [this message]
2016-06-21 10:40 ` [PATCH v2 2/2] ext4/271: _notrun if there are journal related mount options Eryu Guan
2016-06-21 23:42 ` [PATCH v2 1/2] fstests: introduce _require_no_mount_opts helper Dave Chinner
2016-06-22  3:23   ` Eryu Guan
2016-06-22 23:06     ` Dave Chinner
2016-06-24  4:50       ` Eryu Guan
2016-06-27  0:39         ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466505629-9402-1-git-send-email-eguan@redhat.com \
    --to=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jack@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox