From patchwork Tue Jun 21 10:40:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9190311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A917601C0 for ; Tue, 21 Jun 2016 10:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ABEC23B23 for ; Tue, 21 Jun 2016 10:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F731280F4; Tue, 21 Jun 2016 10:41:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE3D923B23 for ; Tue, 21 Jun 2016 10:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751871AbcFUKlN (ORCPT ); Tue, 21 Jun 2016 06:41:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42078 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874AbcFUKlI (ORCPT ); Tue, 21 Jun 2016 06:41:08 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE1C6C04B31B; Tue, 21 Jun 2016 10:41:07 +0000 (UTC) Received: from localhost (dhcp-12-144.nay.redhat.com [10.66.12.144]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5LAf66c020844; Tue, 21 Jun 2016 06:41:07 -0400 From: Eryu Guan To: fstests@vger.kernel.org Cc: jack@suse.cz, Eryu Guan Subject: [PATCH v2 1/2] fstests: introduce _require_no_mount_opts helper Date: Tue, 21 Jun 2016 18:40:28 +0800 Message-Id: <1466505629-9402-1-git-send-email-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 21 Jun 2016 10:41:07 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Dave Chinner --- 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