public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: XiaoLi Feng <xifeng@redhat.com>
To: fstests@vger.kernel.org
Cc: xiaoli feng <xifeng@redhat.com>
Subject: [PATCH] common/rc: add the function _require_noatime
Date: Fri, 18 May 2018 19:10:29 +0800	[thread overview]
Message-ID: <1526641829-9893-1-git-send-email-xifeng@redhat.com> (raw)

From: xiaoli feng <xifeng@redhat.com>

In the generic/120, it will make the test not-pass if the filesystem
mounts failed with noatime. Now change this result to norun. The
filesystem cifs doesn't support noatime. Just make the test norun
until it supports noatime.

Signed-off-by: xiaoli feng <xifeng@redhat.com>
---
 common/rc         | 8 +++++++-
 tests/generic/120 | 7 +------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/rc b/common/rc
index ffe5323..9c45f1b 100644
--- a/common/rc
+++ b/common/rc
@@ -3244,7 +3244,13 @@ _require_atime()
 	_exclude_scratch_mount_option "noatime"
 	if [ "$FSTYP" == "nfs" ]; then
 		_notrun "atime related mount options have no effect on NFS"
-	fi
+}
+
+_require_noatime()
+{
+	_exclude_scratch_mount_option "atime"
+	 _try_scratch_mount -o noatime || \
+                _notrun "noatime not supported by the current tested filesystem"
 }
 
 _require_relatime()
diff --git a/tests/generic/120 b/tests/generic/120
index 1180c10..ddd61b3 100755
--- a/tests/generic/120
+++ b/tests/generic/120
@@ -60,12 +60,7 @@ _compare_access_times()
 
 }
 
-if ! _try_scratch_mount "-o noatime" >$tmp.out 2>&1
-then
-    cat $tmp.out
-    echo "!!! mount failed"
-    exit
-fi
+_require_noatime
 
 #executable file
 echo "*** copying file ***"
-- 
1.8.3.1


             reply	other threads:[~2018-05-18 11:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 11:10 XiaoLi Feng [this message]
2018-05-21  7:50 ` [PATCH] common/rc: add the function _require_noatime Eryu Guan
2018-05-21  8:50   ` Fwd: " Xiaoli Feng
2018-05-21 23:54     ` Steve French
2018-05-22  2:21       ` Eryu Guan
2018-05-22  2:54       ` Xiaoli Feng

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=1526641829-9893-1-git-send-email-xifeng@redhat.com \
    --to=xifeng@redhat.com \
    --cc=fstests@vger.kernel.org \
    /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