common/rc: skip atime related tests on CIFS
[xfstests-dev.git] / common / rc
index 52b128982e98c09587aeaee053579331f40ed38e..f04c9ea2fd89db90256a2f11e0dddc09d42249aa 100644 (file)
--- a/common/rc
+++ b/common/rc
 #  Mountain View, CA 94043, USA, or: http://www.sgi.com
 #-----------------------------------------------------------------------
 
-BC=$(which bc 2> /dev/null) || BC=
+. common/config
 
-# Valid test names start with 3 digits "NNN":
-#  "[0-9]\{3\}"
-# followed by an optional "-":
-#  "-\?"
-# followed by an optional combination of alphanumeric and "-" chars:
-#  "[[:alnum:]-]*"
-# e.g. 999-the-mark-of-fstests
-#
-VALID_TEST_ID="[0-9]\{3\}"
-VALID_TEST_NAME="$VALID_TEST_ID-\?[[:alnum:]-]*"
+BC=$(which bc 2> /dev/null) || BC=
 
 # Some tests are not relevant or functional when testing XFS realtime
 # subvolumes along with the rtinherit=1 mkfs option.  In these cases,
@@ -110,22 +101,18 @@ _ls_l()
        ls -l $* | sed "s/\(^[-rwxdlbcpsStT]*\)\. /\1 /" | grep -v 'lost+found'
 }
 
-# we need common/config
-if [ "$iam" != "check" ]
-then
-    if ! . ./common/config
-        then
-        echo "$iam: failed to source common/config"
-        exit 1
-    fi
-fi
-
 _dump_err()
 {
     _err_msg="$*"
     echo "$_err_msg"
 }
 
+_dump_err_cont()
+{
+    _err_msg="$*"
+    echo -n "$_err_msg"
+}
+
 _dump_err2()
 {
     _err_msg="$*"
@@ -2167,7 +2154,7 @@ _require_xfs_io_command()
                param_checked=1
                ;;
        "scrub"|"repair")
-               testio=`$XFS_IO_PROG -x -c "$command probe 0" $TEST_DIR 2>&1`
+               testio=`$XFS_IO_PROG -x -c "$command probe" $TEST_DIR 2>&1`
                echo $testio | grep -q "Inappropriate ioctl" && \
                        _notrun "xfs_io $command support is missing"
                ;;
@@ -3256,9 +3243,12 @@ _exclude_scratch_mount_option()
 _require_atime()
 {
        _exclude_scratch_mount_option "noatime"
-       if [ "$FSTYP" == "nfs" ]; then
-               _notrun "atime related mount options have no effect on NFS"
-       fi
+       case $FSTYP in
+       nfs|cifs)
+               _notrun "atime related mount options have no effect on $FSTYP"
+               ;;
+       esac
+
 }
 
 _require_relatime()
@@ -3574,10 +3564,6 @@ _disable_dmesg_check()
 
 init_rc()
 {
-       if [ "$iam" == new ]
-       then
-               return
-       fi
        # make some further configuration checks here
        if [ "$TEST_DEV" = ""  ]
        then