[PATCH] common/rc: add the function _require_noatime

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



From: xiaoli feng <xifeng@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux